-
Notifications
You must be signed in to change notification settings - Fork 1
/
nightwatch.conf.js
74 lines (71 loc) · 2.43 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
const lodash = require('lodash');
const config = {
src_folders: ['test/e2e/'],
test_settings: {
default: {
launch_url: 'http://localhost:8080',
filter: './test/e2e/*.spec.js',
output_folder: false,
},
},
// disable parallel tests because they create problems on travis/saucelabs
test_workers: false,
selenium: {
start_process: false,
},
};
if (process.env.TRAVIS_JOB_NUMBER) {
lodash.assign(config.test_settings.default, {
selenium_port: 443,
selenium_host: 'ondemand.saucelabs.com',
use_ssl: true,
username: process.env.SAUCE_USERNAME,
access_key: process.env.SAUCE_ACCESS_KEY,
});
// construct multiple test_settings (aka environments)
const defaultDesiredCapabilities = {
build: `build-${process.env.TRAVIS_JOB_NUMBER}`,
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
tags: ['paperhive-widget'],
};
const browsers = {
android: {
browserName: 'Browser',
deviceName: 'Android Emulator',
platformVersion: '5.1',
platformName: 'Android',
},
chrome: { browserName: 'chrome', version: 'latest', platform: 'Windows 10' },
edge: { browserName: 'MicrosoftEdge', version: 'latest', platform: 'Windows 10' },
firefox: { browserName: 'firefox', version: 'latest', platform: 'Windows 10' },
ie: { browserName: 'internet explorer', version: '11', platform: 'Windows 10' },
safari: { browserName: 'safari', version: 'latest', platform: 'OS X 10.11' },
safariIOS: {
browserName: 'Safari',
deviceName: 'iPhone 7 Simulator',
platformVersion: '10.0',
platformName: 'iOS',
},
};
lodash.forEach(browsers, (value, key) => {
const desiredCapabilities = lodash.assign({}, defaultDesiredCapabilities, value);
config.test_settings[key] = { desiredCapabilities };
});
} else {
config.selenium = {
start_process: true,
server_path: './node_modules/selenium-standalone/.selenium/selenium-server/3.4.0-server.jar',
cli_args: {
'webdriver.chrome.driver':
'./node_modules/selenium-standalone/.selenium/chromedriver/2.33-x64-chromedriver',
'webdriver.gecko.driver': './node_modules/selenium-standalone/.selenium/geckodriver/0.16.0-x64-geckodriver',
},
};
config.test_settings.default.desiredCapabilities = {
browserName: 'chrome', // e.g. chrome, firefox
// marionette: true, // for firefox
javascriptEnabled: true,
acceptSslCerts: true,
};
}
module.exports = config;