-
Notifications
You must be signed in to change notification settings - Fork 0
/
nightwatch.conf.js
62 lines (59 loc) · 2.37 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
var os = require('os');
var url = require('./env/url.js');
var config = {
"src_folders": [
"test" // Where you are storing your Nightwatch e2e tests
],
'page_objects_path': ['test/pages'],
"output_folder": "./reports", // reports (test outcome) output by nightwatch
"selenium": { // downloaded by selenium-download module (see readme)
"start_process": true, // tells nightwatch to start/stop the selenium process
"server_path": "./bin/selenium-server.jar",
"host": "127.0.0.1",
"port": 4444, // standard selenium port
"cli_args": { // chromedriver is downloaded by selenium-download (see readme)
"webdriver.chrome.driver": "nightwatch",
"webdriver.firefox.profile": "nightwatch"
}
},
"test_settings": {
"default": {
"screenshots": {
"enabled": false, // if you want to keep screenshots
"path": './screenshots' // save screenshots here
},
"globals": {
"waitForConditionTimeout": 5000, // sometimes internet is slow so wait.
"url_index": url.index
},
"desiredCapabilities": { // use Chrome as the default browser for tests
"browserName": "chrome"
},
// "desiredCapabilities": {
// "browserName": "phantomjs",
// "javascriptEnabled": true,
// "acceptSslCerts": true,
// "phantomjs.binary.path": "node_modules/phantomjs/bin/phantomjs",
// "phantomjs.cli.args": "--webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444"
// },
"skip_testcases_on_fail": true
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true // set to false to test progressive enhancement
}
}
}
}
// condition os type
var os_type = os.type().toLowerCase();
var selenium_cli = config.selenium.cli_args;
if (os_type.indexOf('windows') > -1) {
selenium_cli['webdriver.chrome.driver'] = 'bin/chromedriver_windows.exe';
} else if (os_type.indexOf('darwin') > -1) {
selenium_cli['webdriver.chrome.driver'] = 'bin/chromedriver_mac';
} else {
selenium_cli['webdriver.chrome.driver'] = 'bin/chromedriver_linux64';
}
module.exports = config;