Sha256: d28b0bcb5ea1f162e82dba5e445bff45bb26076ed1028ecb7929b3210ac565cf

Contents?: true

Size: 921 Bytes

Versions: 42

Compression:

Stored size: 921 Bytes

Contents

var page = require('webpage').create();

page.open("http://localhost:3000/test/index.html", function (status) {
  if (status != "success") {
    console.log("page couldn't be loaded successfully");
    phantom.exit(1);
  }
  waitFor(function () {
    return page.evaluate(function () {
      var output = document.getElementById('status');
      if (!output) { return false; }
      return (/^(\d+ failures?|all passed)/i).test(output.innerText);
    });
  }, function () {
    var failed = page.evaluate(function () { return window.failed; });
    var output = page.evaluate(function () {
      return document.getElementById('output').innerText + "\n" +
        document.getElementById('status').innerText;
    });
    console.log(output);
    phantom.exit(failed > 0 ? 1 : 0);
  });
});

function waitFor (test, cb) {
  if (test()) {
    cb();
  } else {
    setTimeout(function () { waitFor(test, cb); }, 250);
  }
}

Version data entries

42 entries across 42 versions & 7 rubygems

Version Path
lines-engine-0.9.0 public/codemirror/test/phantom_driver.js
gump-0.1.6 server/assets/js/jquery.codemirror/test/phantom_driver.js
mdbe-0.1.0 public/libs/codemirror/test/phantom_driver.js
poly-cms-0.1.2 core/admin/assets/js/vendor/codemirror/test/phantom_driver.js
poly-cms-0.1.1 core/admin/assets/js/vendor/codemirror/test/phantom_driver.js
poly-cms-0.1.0 core/admin/assets/js/vendor/codemirror/test/phantom_driver.js
bonethug-0.0.17 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/lib/codemirror/test/phantom_driver.js
maglev-database-explorer-0.0.5 public/libs/codemirror/test/phantom_driver.js
maglev-database-explorer-0.0.4 public/libs/codemirror/test/phantom_driver.js
maglev-database-explorer-0.0.3 public/libs/codemirror/test/phantom_driver.js