2019-04-25 11:06:40 -04:00
|
|
|
// @ts-check
|
2018-02-27 18:24:07 -05:00
|
|
|
// Protractor configuration file, see link for more information
|
|
|
|
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
|
|
|
|
2019-04-25 11:06:40 -04:00
|
|
|
/**
|
|
|
|
* @type { import("protractor").Config }
|
|
|
|
*/
|
2018-02-27 18:24:07 -05:00
|
|
|
exports.config = {
|
|
|
|
allScriptsTimeout: 11000,
|
2018-10-22 08:33:40 -04:00
|
|
|
suites: {
|
|
|
|
full: './*.e2e-spec.ts',
|
|
|
|
smoke: './smoke-tests.e2e-spec.ts',
|
|
|
|
},
|
|
|
|
suite: 'full',
|
2018-02-27 18:24:07 -05:00
|
|
|
capabilities: {
|
|
|
|
browserName: 'chrome',
|
2020-02-13 09:46:38 -05:00
|
|
|
chromeOptions: {
|
2020-02-07 06:38:58 -05:00
|
|
|
binary: require('puppeteer').executablePath(),
|
|
|
|
// See /integration/README.md#browser-tests for more info on these args
|
2020-02-13 09:46:38 -05:00
|
|
|
args: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage', '--hide-scrollbars', '--mute-audio'],
|
|
|
|
},
|
2018-02-27 18:24:07 -05:00
|
|
|
},
|
|
|
|
directConnect: true,
|
|
|
|
framework: 'jasmine',
|
|
|
|
jasmineNodeOpts: {
|
|
|
|
showColors: true,
|
|
|
|
defaultTimeoutInterval: 30000,
|
|
|
|
print: function() {}
|
|
|
|
},
|
|
|
|
params: {
|
|
|
|
sitemapUrls: [],
|
|
|
|
legacyUrls: [],
|
|
|
|
},
|
|
|
|
beforeLaunch() {
|
2019-04-25 11:06:40 -04:00
|
|
|
const {join} = require('path');
|
2018-02-27 18:24:07 -05:00
|
|
|
const {register} = require('ts-node');
|
2019-04-25 11:06:40 -04:00
|
|
|
|
|
|
|
register({project: join(__dirname, './tsconfig.json')});
|
2018-02-27 18:24:07 -05:00
|
|
|
},
|
|
|
|
onPrepare() {
|
|
|
|
const {SpecReporter} = 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: true}}));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|