-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathnightwatch.conf.js
76 lines (66 loc) · 1.83 KB
/
nightwatch.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* eslint-env node */
/**
* !!! Important !!!
*
* Nightwatch for BrowserStack is supposed to be run via `scripts/nightwatch-runner.js`.
*/
// The following environment variables must be set (e.g. in .bashrc or via CLI) before running `nightwatch-runner`.
const bsUser = process.env.BROWSER_STACK_USERNAME;
const bsKey = process.env.BROWSER_STACK_ACCESS_KEY;
const bsBrowser = process.env.BROWSER_STACK_BROWSER;
// The following environment variables should be set before running `nightwatch-runner` but are optional.
const bsBuildName = process.env.BROWSER_STACK_BUILD_NAME;
// The following variables will be set via `nightwatch-runner` script.
// It's important that `localIdentifier` passed to `browserstack-local` and to Nightwatch config match.
const bsLocalIdentifier = process.env.BROWSER_STACK_LOCAL_IDENTIFIER;
const browsers = {
chrome: {
os: 'Windows',
os_version: '10'
},
edge: {
os: 'Windows',
os_version: '10'
},
firefox: {
os: 'Windows',
os_version: '10'
},
ie: {
os: 'Windows',
os_version: '10'
},
safari: {
os: 'OS X',
os_version: 'Catalina'
}
};
const nightwatchConfig = {
selenium: {
start_process: false,
host: 'hub-cloud.browserstack.com',
port: 443
},
output_folder: '.tmp-e2e-output',
test_settings: {
default: {
desiredCapabilities: {
build: bsBuildName,
'browserstack.user': bsUser,
'browserstack.key': bsKey,
'browserstack.debug': true,
'browserstack.local': true,
'browserstack.localIdentifier': bsLocalIdentifier,
browser: bsBrowser,
version: 'latest',
...browsers[ bsBrowser ]
}
}
}
};
for ( const i in nightwatchConfig.test_settings ) {
const config = nightwatchConfig.test_settings[ i ];
config.selenium_host = nightwatchConfig.selenium.host;
config.selenium_port = nightwatchConfig.selenium.port;
}
module.exports = nightwatchConfig;