-
Notifications
You must be signed in to change notification settings - Fork 4
/
protractor.conf.js
83 lines (73 loc) · 2.22 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
const path = require("path");
const USE_HEADLESS_MODE = false;
const CPU_THROTTLE_RATE = process.env.CPU_THROTTLE_RATE;
exports.config = {
directConnect: true,
chromeDriver: path.resolve("./node_modules/chromedriver/bin/chromedriver"),
// SELENIUM_PROMISE_MANAGER: false,
capabilities: {
browserName: "chrome",
chromeOptions: {
args: [
"--js-flags=--expose-gc",
"--window-size=1300,1000",
...(USE_HEADLESS_MODE ? ["--headless", "--disable-gpu"] : []),
],
perfLoggingPrefs: {
traceCategories:
"v8,blink.console,devtools.timeline,devtools.timeline.frame,blink.user_timing",
},
// 'mobileEmulation': {
// 'deviceMetrics': {
// 'width': 600,
// 'height': 960,
// 'pixelRatio': 1
// }
// }
},
loggingPrefs: {
performance: "ALL",
browser: "ALL",
driver: "ALL",
},
},
specs: ["test/spec/**/*.spec.js"],
// specs: ['test/config.js', 'test/spec/arrow-keys-navigation.spec.js', 'test/spec/editing.spec.js'],
// specs: ['test/config.js', 'test/spec/arrow-keys-navigation.spec.js'],
// specs: ['test/config.js', 'test/spec/editing.spec.js'],
// specs: ['test/config.js', 'test/spec/altering.spec.js'],
// specs: ['test/config.js', 'test/spec/view-scrolling.spec.js'],
framework: "jasmine2",
onPrepare: function () {
patchProtractorWait(browser);
beforeEach(function () {
patchProtractorWait(browser);
});
},
restartBrowserBetweenTests: true,
skipSourceMapSupport: true,
jasmineNodeOpts: {
showColors: true,
// 5 minute timeout
defaultTimeoutInterval: 300000,
},
};
function patchProtractorWait(browser) {
// Tells protractor this isn't an Angular application
browser.ignoreSynchronization = true;
if (CPU_THROTTLE_RATE) {
browser.driver.sendChromiumCommand("Emulation.setCPUThrottlingRate", {
rate: parseInt(CPU_THROTTLE_RATE, 10),
});
}
// const _get = browser.get;
// const sleepInterval = process.env.TRAVIS || process.env.JENKINS_URL ? 7000 : 3000;
//
// browser.get = function() {
// const result = _get.apply(this, arguments);
//
// browser.sleep(sleepInterval);
//
// return result;
// }
}