This repository was archived by the owner on Jan 19, 2023. It is now read-only.
forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotractor.conf.js
65 lines (61 loc) · 1.96 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
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
suites: {
full: './*.e2e-spec.ts',
smoke: './smoke-tests.e2e-spec.ts',
},
suite: 'full',
capabilities: {
browserName: 'chrome',
chromeOptions: {
binary: require('puppeteer').executablePath(),
// See /integration/README.md#browser-tests for more info on these args
args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'],
},
},
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
params: {
sitemapUrls: [],
legacyUrls: [],
},
beforeLaunch() {
const {join} = require('path');
const {register} = require('ts-node');
register({project: join(__dirname, './tsconfig.json')});
},
onPrepare() {
const {SpecReporter, StacktraceOption} = require('jasmine-spec-reporter');
const {browser} = require('protractor');
const {loadLegacyUrls, loadRemoteSitemapUrls} = require('../shared/helpers');
return Promise.all([
browser.getProcessedConfig(),
loadRemoteSitemapUrls(browser.baseUrl),
loadLegacyUrls(),
]).then(([config, sitemapUrls, legacyUrls]) => {
if (sitemapUrls.length <= 100) {
throw new Error(`Too few sitemap URLs. (Expected: >100 | Found: ${sitemapUrls.length})`);
} else if (legacyUrls.length <= 100) {
throw new Error(`Too few legacy URLs. (Expected: >100 | Found: ${legacyUrls.length})`);
}
Object.assign(config.params, {sitemapUrls, legacyUrls});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY,
},
}));
});
}
};