-
Notifications
You must be signed in to change notification settings - Fork 0
/
protractor.config.js
58 lines (50 loc) · 1.56 KB
/
protractor.config.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
import mkdirp from 'mkdirp';
const REPORTS_FOLDER = 'target/test-reports/';
mkdirp(REPORTS_FOLDER);
// TODO create other browser's configurations and parallel tests
const chrome = {
browserName: 'chrome',
reportPath: `${REPORTS_FOLDER}report.json`,
chromeOptions: {
args: ['no-sandbox', '--headless'],
prefs: {
credentials_enable_service: false,
},
},
};
const capabilities = [chrome];
const configuration = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
specs: [
'src/test/features/*.feature',
],
multiCapabilities: capabilities,
noGlobals: true,
baseUrl: 'http://localhost:8080/',
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
resultJsonOutputFile: `${REPORTS_FOLDER}/protractor.json`,
ignoreSynchronization: true,
restartBrowserBetweenTests: true,
cucumberOpts: {
require: [
'src/common.js',
'src/test/steps/*.js'
],
format: 'pretty',
strict: true
},
params: {
URI: 'http://jsonplaceholder.typicode.com'
},
onPrepare() {
const protractor = require('protractor');
const browser = protractor.browser;
browser.manage().timeouts().setScriptTimeout(60000);
return browser.getProcessedConfig().then(config => config.cucumberOpts.format = `json:${config.capabilities.reportPath}`);
},
};
// TODO Add other browsers
configuration.multiCapabilities = [];
configuration.multiCapabilities.push(chrome);
module.exports.config = configuration;