const baseUrl = '<BASEURL>';
const maxNumberOfInstances = process.env.NUMBER_OF_INSTANCES ? process.env.NUMBER_OF_INSTANCES : 1;
const reportPath = 'protractor/report';
const HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
const screenShotReporter = new HtmlScreenshotReporter({
dest: reportPath,
filename: 'artemis-e2e-report.html'
});
const SAUCELABS_USERNAME = '<SAUCEUSERNAME';
const SAUCELABS_AUTHKEY = '<SAUCEKEY>';
const chromeArgs = process.env.IS_LOCAL ? ['--no-sandbox', '--test-type=browser', '--lang=en', '--window-size=1680,1050'] : ['--disable-gpu', '--no-sandbox', '--test-type=browser', '--lang=en', '--window-size=1680,1050'];
const browserCapabilities = [{
sauceUser: SAUCELABS_USERNAME,
sauceKey: SAUCELABS_AUTHKEY,
browserName: 'chrome',
tunnelIdentifier: '<SAUCETUNNEL>',
shardTestFiles: true,
maxInstances: maxNumberOfInstances,
platform: 'Windows 10',
version: '73.0',
screenResolution: '1280x1024',
chromeOptions: {
args: chromeArgs,
prefs: {
'credentials_enable_service': false,
'profile': {
'password_manager_enabled': false
},
download: {
prompt_for_download: false,
directory_upgrade: true,
default_directory: 'C:\\downloads\\'
},
},
},
loggingPrefs: {
browser: 'SEVERE'
},
}, ];
// Protractor config
exports.config = {
baseUrl: baseUrl,
directConnect: true,
allScriptsTimeout: 2 * 60 * 1000,
jasmineNodeOpts: {
defaultTimeoutInterval: 3 * 60 * 1000
},
getPageTimeout: 2 * 60 * 1000,
suites: {
smoke: 'protractor/smokeTests/*.scenario.ts',
},
multiCapabilities: browserCapabilities,
framework: 'jasmine2',
onPrepare: function () {
browser.waitForAngularEnabled(true);
require('ts-node').register({
project: 'protractor/tsconfig.json',
});
const jasmineReporters = require('jasmine-reporters');
const jUnitXMLReporter = new jasmineReporters.JUnitXmlReporter({
consolidateAll: false,
savePath: reportPath,
filePrefix: 'xmloutput'
});
const JasmineConsoleReporter = require('jasmine-console-reporter');
const consoleReporter = new JasmineConsoleReporter({
colors: 1,
cleanStack: 1,
verbosity: 4,
listStyle: 'indent',
activity: true,
emoji: true,
beep: true,
timeThreshold: {
ok: 10000,
warn: 15000,
ouch: 30000,
}
});
jasmine.getEnv().addReporter(jUnitXMLReporter);
jasmine.getEnv().addReporter(screenShotReporter);
jasmine.getEnv().addReporter(consoleReporter);
browser.get(browser.baseUrl);
},
beforeLaunch: function () {
return new Promise(function (resolve) {
screenShotReporter.beforeLaunch(resolve);
});
},
afterLaunch: function (exitCode) {
return new Promise(function (resolve) {
screenShotReporter.afterLaunch(resolve.bind(this, exitCode));
});
},
};