How to use the nightwatch/lib/index.js.cli function in nightwatch

To help you get started, we’ve selected a few nightwatch 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 keystonejs / keystone-nightwatch-e2e / index.js View on Github external
function runNightwatch (done) {
	console.log([moment().format('HH:mm:ss:SSS')] + ' kne: running nightwatch...');

	try {
		Nightwatch.cli(function (argv) {
			// Set app-specific env for nightwatch session
			process.env.KNE_TEST_ENV = argv.env;

			if (argv['browser-name']) {
				process.env.KNE_BROWSER_NAME = argv['browser-name'];
			}

			if (argv['browser-version']) {
				process.env.KNE_BROWSER_VERSION = argv['browser-version'];
			}

			// If possible, argv inputs and environment variables will be merged together
			// If not, argv inputs will override environment variables.
			process.env.KNE_TEST_PATHS = process.env.KNE_TEST_PATHS || '';
			if (argv.test_paths) {
				// If argv.test_paths is set, add these paths to the environment variable

nightwatch

Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.

MIT
Latest version published 16 hours ago

Package Health Score

92 / 100
Full package analysis