How to use the zombie.prototype function in zombie

To help you get started, we’ve selected a few zombie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TheFive / osmbc / test / testutil.js View on Github external
debug("nockHtmlPages");
  var file =  path.resolve(__dirname, "NockedPages", "NockedPages.json");
  var nocks =  JSON.parse(fs.readFileSync(file));
  for (let site in nocks) {
    for (let page in nocks[site]) {
      nock(site)
        .get(page)
        .replyWithFile(200, path.resolve(__dirname, "NockedPages", nocks[site][page]));
    }
  }
};
exports.nockHtmlPagesClear = function nockHtmlPagesClear() {
  nock.cleanAll();
};

Browser.prototype.keyUp = function(targetSelector, keyCode) {
  let event = this.window.document.createEvent("HTMLEvents");
  event.initEvent("keyup", true, true);
  event.which = keyCode;
  let target = this.window.document.querySelector(targetSelector);
  if (target) target.dispatchEvent(event);
};

Browser.Assert.prototype.expectHtmlSync = function expectHtmlSync(errorList, givenPath, name) {
  let stopOnError = false;
  if (!Array.isArray(errorList)) {
    stopOnError = true;
    name = givenPath;
    givenPath = errorList;
    errorList = undefined;
  }
  let expected = "not read yet";

zombie

Insanely fast, full-stack, headless browser testing using Node.js

MIT
Latest version published 6 years ago

Package Health Score

56 / 100
Full package analysis