debug.log
yalc.lock
.yalc
+local.log
+_selenium-server.log
--- /dev/null
+require('dotenv').config()
+const Nightwatch = require('nightwatch')
+const browserstack = require('browserstack-local')
+const path = require('path')
+
+const { BROWSERSTACK_ACCESS_KEY } = process.env
+if (!BROWSERSTACK_ACCESS_KEY) {
+ throw new Error(
+ `
+(ONLY FOR MAINTAINERS)
+BROWSERSTACK_ACCESS_KEY is not set. Did you create the .env file?
+`
+ )
+}
+
+try {
+ require.main.filename = path.resolve(
+ __dirname,
+ '../../../node_modules/.bin/nightwatch'
+ )
+
+ // Code to start browserstack local before start of test
+ console.log('Connecting local')
+
+ const bs_local = new browserstack.Local()
+ Nightwatch.bs_local = bs_local
+
+ bs_local.start(
+ { key: process.env.BROWSERSTACK_ACCESS_KEY },
+ function (error) {
+ if (error) throw error
+
+ console.log('Connected. Now testing...')
+ Nightwatch.cli(function (argv) {
+ Nightwatch.CliRunner(argv)
+ .setup()
+ .runTests()
+ .catch(err => {
+ throw err
+ })
+ .finally(() => {
+ // Code to stop browserstack local after end of single test
+ bs_local.stop(function () {})
+ })
+ })
+ }
+ )
+} catch (ex) {
+ console.log('There was an error while starting the test runner:\n\n')
+ process.stderr.write(ex.stack + '\n')
+ process.exit(2)
+}
module.exports = {
// An array of folders (excluding subfolders) where your tests are located;
// if this is not specified, the test source must be passed as the second argument to the test runner.
- src_folders: [],
+ src_folders: ['e2e/specs'],
// See https://nightwatchjs.org/guide/working-with-page-objects/using-page-objects.html
page_objects_path: ['node_modules/nightwatch/examples/pages/'],
browserName: 'chrome',
'goog:chromeOptions': {
w3c: true,
- args: ['--headless'],
+ args: ['window-size=1280,800', 'headless'],
},
},
},
},
- 'browserstack.ie': {
- extends: 'browserstack',
- desiredCapabilities: {
- browserName: 'internet explorer',
- browserVersion: '11.0',
- },
- },
-
'browserstack.safari': {
extends: 'browserstack',
desiredCapabilities: {
extends: 'browserstack.local',
desiredCapabilities: {
browserName: 'firefox',
+ browserVersion: '58.0',
+ },
+ },
+
+ // Use https://www.browserstack.com/automate/capabilities?tag=selenium-4 to generate configs
+
+ edge_pre_chrome: {
+ extends: 'browserstack.local',
+ desiredCapabilities: {
+ browserName: 'Edge',
+ browserVersion: '18.0',
+ },
+ },
+
+ android5: {
+ extends: 'browserstack.local',
+ desiredCapabilities: {
+ deviceName: 'Samsung Galaxy S6',
+ realMobile: 'true',
+ osVersion: '5.0',
+ },
+ },
+
+ ios10: {
+ extends: 'browserstack.local',
+ desiredCapabilities: {
+ deviceName: 'iPhone 7',
+ realMobile: 'true',
+ osVersion: '10',
},
},
"test:e2e:headless": "node e2e/runner.js -e chrome-headless --skiptags no-headless",
"test:e2e:native": "node e2e/runner.js -e chrome --tag no-headless",
"test:e2e:ci": "node e2e/runner.js -e firefox --retries 2",
- "test:e2e:bs": "node e2e/runner.js --local -e edge_pre_chrome,android44 -c e2e/nightwatch.browserstack.js --tag browserstack"
+ "test:e2e:bs": "node e2e/local.runner.js -e edge_pre_chrome,android44 --tag browserstack"
},
"gitHooks": {
"pre-commit": "lint-staged",