This repository has been archived by the owner on Sep 6, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathprotractor.conf.js
88 lines (79 loc) · 2.83 KB
/
protractor.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
// Protractor configuration file,
// see link for more information https://github.com/angular/protractor/blob/master/lib/config.ts
const {SpecReporter} = require('jasmine-spec-reporter');
const {CUSTOM_LAUNCHERS, SAUCE_ALIASES} = require('./browsers');
const config = {};
const timeout = 120 * 1000;
const capabilities = {
browserName: 'chrome',
chromeOptions: {
// Use headless Chrome https://github.com/angular/protractor/blob/master/docs/browser-setup.md#using-headless-chrome
args: [
'--headless',
'--disable-gpu',
'--js-flags=--expose-gc',
'--no-sandbox'
],
perfLoggingPrefs: {
traceCategories: 'v8,blink.console,disabled-by-default-devtools.timeline,devtools.timeline'
}
},
loggingPrefs: {
performance: 'ALL',
browser: 'ALL'
}
};
// On Travis we use Saucelabs browsers.
if (process.env.TRAVIS) {
Object.assign(config, {
sauceUser: process.env.SAUCE_USERNAME,
sauceKey: process.env.SAUCE_ACCESS_KEY,
multiCapabilities: SAUCE_ALIASES.CI.map(key => CUSTOM_LAUNCHERS[key])
.map(capability => ({
...capability,
build: `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`,
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
name: 'Angular Lab (E2E)'
}))
});
}
Object.assign(config, {
capabilities,
allScriptsTimeout: timeout,
getPageTimeout: timeout,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
// https://github.com/angular/protractor/blob/master/docs/server-setup.md#connecting-directly-to-browser-drivers
directConnect: !process.env.TRAVIS,
baseUrl: 'http://localhost:4224/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
showTiming: true,
defaultTimeoutInterval: timeout,
print: () => {}
},
// Option for Angular to test against Angular 2+ applications on the page.
// Protractor will wait for the app to be stable before each action, and search within all apps when finding elements.
// rootElement: 'rj-lab',
// TODO: Use above when https://github.com/angular/protractor/issues/4336 is fixed
useAllAngular2AppRoots: true,
// Turn off control flow (https://github.com/angular/protractor/tree/master/exampleTypescript/asyncAwait)
SELENIUM_PROMISE_MANAGER: false,
onPrepare: () => {
// Add jasmine spec reporter
jasmine.getEnv()
.addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
// Include jasmine expect
require('jasmine-expect');
// Transpile all TS to JS
require('ts-node')
.register({
project: 'e2e/tsconfig.e2e.json'
});
}
});
module.exports = {
config
};