}
/**
- * Generates an object with beforeEach and afterEach functions to be added
- * to every test suite. It cannot be added globably because these must be
- * executed before each test (instead of each test suite as it does in globalModules)
+ * Generates an object with beforeEach and afterEach functions to be added to
+ * every test suite. It cannot be added globally because these must be executed
+ * before each test (instead of each test suite as it does in globalModules)
*/
module.exports = function sendStatus() {
const sessionMap = Object.create(null)
// yarn nightwatch -e chrome,safari,firefox
+/** @type {import('nightwatch').NightwatchTestSettingScreenshots} */
+const browserDefaults = {
+ selenium_port: 4444,
+ selenium_host: 'localhost',
+ silent: true,
+ screenshots: {
+ enabled: true,
+ on_failure: true,
+ on_error: false,
+ path: 'e2e/screenshots',
+ },
+}
+
/** @type {import('nightwatch').NightwatchOptions} */
module.exports = {
src_folders: ['e2e/specs'],
selenium: {
start_process: true,
- server_path: require('selenium-server').path,
+ start_session: true,
host: '127.0.0.1',
port: 4444,
+ server_path: require('selenium-server').path,
cli_args: {
'webdriver.chrome.driver': require('chromedriver').path,
- // 'webdriver.gecko.driver': require('geckodriver').path
+ // 'webdriver.gecko.driver': require('geckodriver').path,
},
},
+ webdriver: {
+ start_process: false,
+ },
+
test_settings: {
default: {
- selenium_port: 4444,
- selenium_host: 'localhost',
- silent: true,
- screenshots: {
- enabled: true,
- on_failure: true,
- on_error: false,
- path: 'e2e/screenshots',
- },
- desiredCapabilities: {
- browserName: 'chrome',
- acceptSslCerts: true,
- chromeOptions: {
- // https://github.com/nightwatchjs/nightwatch/releases/tag/v1.1.12
- w3c: false,
- args: ['window-size=1280,800'],
- },
- },
+ launch_url: 'https://nightwatchjs.org',
},
chrome: {
+ ...browserDefaults,
desiredCapabilities: {
browserName: 'chrome',
acceptSslCerts: true,
},
},
- // TODO: generate these and add skip tags
'chrome-headless': {
+ ...browserDefaults,
desiredCapabilities: {
browserName: 'chrome',
acceptSslCerts: true,
},
safari: {
+ ...browserDefaults,
desiredCapabilities: {
browserName: 'safari',
acceptSslCerts: true,
},
},
+ // TODO: not working
firefox: {
+ ...browserDefaults,
desiredCapabilities: {
browserName: 'firefox',
acceptSslCerts: true,
- },
- },
-
- ie: {
- desiredCapabilities: {
- browser: 'internet explorer',
+ 'moz:firefoxOptions': {
+ args: [],
+ },
},
},
},
? resolve(__dirname, './nightwatch.browserstack.js')
: resolve(__dirname, './nightwatch.config.js')
-// check -c option is passed when usig multiple environments
+// check -c option is passed when using multiple environments
if (args.indexOf('-c') < 0) {
// check if multiple envs are provided. The way Nightwatch works
- // requires to explicitely provide the conf
+ // requires to explicitly provide the conf
const envs = args[args.indexOf('-e') + 1]
if (envs && envs.indexOf(',') > -1) {
console.warn(
"test:types": "tsc --build tsconfig.json",
"test:unit": "jest --coverage",
"test": "yarn run test:types && yarn run test:unit",
- "test:e2e": "node e2e/runner.js",
- "test:e2e:ci": "node e2e/runner.js --local -e ie,android44 -c e2e/nightwatch.browserstack.js e2e/specs/basic.js"
+ "test:e2e": "node e2e/runner.js -e chrome",
+ "test:e2e:ci": "node e2e/runner.js --local -e ie,android44 -c e2e/nightwatch.browserstack.js e2e/specs/encoding.js"
},
"gitHooks": {
"pre-commit": "lint-staged",