Sha256: 960e702e62b2280163a6af2d5394ce450129135f774a7f1fc84b06ee8ec4fa8d

Contents?: true

Size: 860 Bytes

Versions: 45

Compression:

Stored size: 860 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('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

45 entries across 45 versions & 2 rubygems

Version Path
rearview-1.2.3-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.2.2.rc.2-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.2.2.rc.1-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.2.1-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.2.0-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.1.2-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.1.1-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.1.0-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.3.rc.4-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.3.rc.3-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.3.rc.2-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.3.rc.1-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.2-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.2.rc.4-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.2.rc.3-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.2.rc.2-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.2.rc.1-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.1-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.0-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js
rearview-1.0.0.rc5-jruby public/rearview-src/vendor/codemirror/test/phantom_driver.js