-
Notifications
You must be signed in to change notification settings - Fork 3
/
nightwatch.conf.js
executable file
·108 lines (96 loc) · 2.99 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
104
105
106
107
108
const Services = {}; loadServices();
require('events').EventEmitter.defaultMaxListeners = 1000;
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: ['tests/step-definitions'],
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
custom_commands_path: './lib/custom-commands',
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
custom_assertions_path: './lib/custom-assertions',
test_runner: {
type: 'cucumber',
options: {
feature_path: 'tests/features/*.feature',
additional_config: '',
parallel: 1,
},
},
test_settings: {
default: {
launch_url: 'http://localhost:8080',
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: true,
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 : ''),
},
},
webdriver: {
start_process: false
},
},
'selenium.chrome': {
extends: 'selenium_server',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
w3c: false,
},
},
}
};
function loadServices() {
try {
Services.seleniumServer = require('selenium-server');
} catch (err) { }
try {
Services.chromedriver = require('chromedriver');
} catch (err) { }
try {
Services.geckodriver = require('geckodriver');
} catch (err) { }
}