How to use the zombie.extend 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
// there is a difference, so create the actual data as file
  // do easier fix the test.
  fs.writeFileSync(actualFile, string, "UTF8");
  should(string).eql(expected, "HTML File " + name + " is different.");
  return cb();
};


process.on("unhandledRejection", (reason, p) => {
  console.error("Unhandled Rejection at: Promise", p, "reason:", reason);
  console.error(reason.stack);
  // application specific logging, throwing an error, or other logic here
});


Browser.extend(function(browser) {
  browser.on("request", function (req) {
    if (browser.location) {
      req.headers.set("Referer", browser.location.href);
    }
  });
});



exports.nockLoginPage = nockLoginPage;
github contently / xdomain-cookies / test / test_suite.js View on Github external
const 	TEST_COOKIE_NAME = 'test_cookie', 
		HTML_DOMAIN_1 = 'test_domain_site1.com',
		HTML_DOMAIN_2 = 'test_domain_site2.com',
		IFRAME_DOMAIN = 'test_domain_iframe.com',
		EXPECTED_UNSET_COOKIE_VAL = 'test1234',
		EXPECTED_SET_COOKIE_VAL = 'preset1234',
		JS_VAR_EXISTING_VAL = 'existing_cookie_val',
		JS_VAR_FINAL_VAL = 'final_cookie_val',
		JS_CAPTURED_ERRORS = 'js_errors',
		POSTMESSAGE_WAIT_MS = 50;

Browser.localhost(HTML_DOMAIN_1,3005);
Browser.localhost(HTML_DOMAIN_2,3005);
Browser.localhost(IFRAME_DOMAIN,3005);

Browser.extend(function(browser) {
  browser.on('console', function(level, message) {
    //console.log(message);
  });
  browser.on('log', function(level, message) {
    //console.log(message);
  });
});

describe("Iframe shared cookie (http)", function(){
	this.timeout(5000);

	before(function() {
		this.server = app.startHttpApp(3005);
	});
	after(function(done) {
    	this.server.close(done);

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