-
Notifications
You must be signed in to change notification settings - Fork 0
/
nightwatch.conf.js
executable file
·103 lines (92 loc) · 2.95 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
100
101
102
103
const Services = {}; loadServices();
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: ['node_modules/webship-js/tests/step-definitions'],
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
custom_commands_path: './node_modules/webship-js/lib/custom-commands',
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
custom_assertions_path: './node_modules/webship-js/lib/custom-assertions',
test_runner: {
type: 'cucumber',
options: {
feature_path: 'tests/features/*.feature',
additional_config: '',
parallel: 2,
},
},
test_settings: {
default: {
launch_url: 'PROJECT_BASE_URL',
selenium_port: 4444,
selenium_host: '127.0.0.1',
silent: true,
screenshots: {
enabled: true,
path: './reports/screenshots',
},
desiredCapabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
//
// w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
w3c: false,
args: [
'--headless',
'--start-maximized',
'--disable-gpu',
'--window-size=1600,1200',
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--disable-web-security',
'--DNS-prefetch-disable',
'--disable-translate',
'--ignore-certificate-errors',
'--test-type',
'--disable-extensions',
'--incognito',
'--disable-infobars',
'--remote-debugging-port=9222',
'--allowed-ips=*',
'--whitelisted-ips=*',
'--allow-insecure-localhost',
],
},
},
},
},
selenium_server: {
// Selenium Server is running locally and is managed by Nightwatch
selenium: {
start_process: true,
port: 4444,
server_path: (Services.seleniumServer ? Services.seleniumServer.path : ''),
cli_args: {
'webdriver.gecko.driver': (Services.geckodriver ? Services.geckodriver.path : ''),
'webdriver.chrome.driver': (Services.chromedriver ? Services.chromedriver.path : ''),
},
},
},
'selenium.chrome': {
extends: 'selenium_server',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
w3c: true,
},
},
}
};
function loadServices() {
try {
Services.seleniumServer = require('selenium-server');
} catch (err) { }
try {
Services.chromedriver = require('chromedriver');
} catch (err) { }
try {
Services.geckodriver = require('geckodriver');
} catch (err) { }
}