-
Notifications
You must be signed in to change notification settings - Fork 3
/
nightwatch.conf.js
99 lines (93 loc) · 2.46 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
const fs = require('fs');
const binpath = './node_modules/nightwatch/bin/';
const seleniumServer = require('selenium-server');
const chromedriver = require('chromedriver');
const TRAVIS_JOB_NUMBER = process.env.TRAVIS_JOB_NUMBER;
const SELENIUM_PORT = process.env.NW_ENV === 'travis' ? 4445 : 4444;
module.exports = {
src_folders: ['test/client'],
output_folder: 'reports',
custom_commands_path: '',
custom_assertions_path: '',
page_objects_path: '',
globals_path: '',
selenium: {
start_process: true,
server_path: seleniumServer.path,
log_path: '',
host: '127.0.0.1',
port: SELENIUM_PORT,
cli_args: {
'webdriver.chrome.driver': chromedriver.path
}
},
test_settings: {
travis: {
launch_url: 'ondemand.saucelabs.com:80',
selenium_port: 80,
selenium_host: 'ondemand.saucelabs.com',
silent: true,
username: process.env.SAUCE_USERNAME,
access_key: process.env.SAUCE_ACCESS_KEY,
screenshots: {
enabled: false,
path: ''
},
globals: {
waitForConditionTimeout: 10000
},
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
w3c: false,
args: ['--disable-dev-shm-usage']
},
javascriptEnabled: true,
acceptSslCerts: true,
build: `build-${TRAVIS_JOB_NUMBER}`,
'tunnel-identifier': TRAVIS_JOB_NUMBER
}
},
default: {
launch_url: 'http://localhost',
selenium_port: 4444,
selenium_host: 'localhost',
silent: true,
screenshots: {
enabled: false,
path: ''
},
globals: {
waitForConditionTimeout: 10000
},
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
w3c: false,
args: ['--disable-dev-shm-usage']
},
javascriptEnabled: true,
acceptSslCerts: true
}
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
w3c: false,
args: ['--disable-dev-shm-usage']
},
javascriptEnabled: true,
acceptSslCerts: true
}
}
}
};
fs.stat(binpath + 'selenium.jar', function (err, stat) {
if (err || !stat || stat.size < 1) {
// require('selenium-download').ensure(binpath, function (error) {
// if (error) throw new Error(error);
// console.log('✔ Selenium & Chromedriver downloaded to:', binpath);
// });
}
});