forked from hmcts/sptribs-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saucelabs.conf.js
143 lines (136 loc) · 4.45 KB
/
saucelabs.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* eslint-disable no-console */
const testConfig = require('./src/test/e2e/config');
const supportedBrowsers = require('./src/test/e2e/crossbrowser/supportedBrowsers.js');
const testUserConfig = require('./src/test/config.js').config;
const waitForTimeout = parseInt(process.env.WAIT_FOR_TIMEOUT) || 30000;
const smartWait = parseInt(process.env.SMART_WAIT) || 30000;
const browser = process.env.SAUCELABS_BROWSER || 'chrome';
const defaultSauceOptions = {
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY,
//tunnelIdentifier: process.env.TUNNEL_IDENTIFIER || 'reformtunnel',
acceptSslCerts: true,
tags: ['DSS WEB'],
maxDuration: 3000,
};
function merge(intoObject, fromObject) {
return Object.assign({}, intoObject, fromObject);
}
function getBrowserConfig(browserGroup) {
const browserConfig = [];
for (const candidateBrowser in supportedBrowsers[browserGroup]) {
if (candidateBrowser) {
const candidateCapabilities = supportedBrowsers[browserGroup][candidateBrowser];
candidateCapabilities['sauce:options'] = merge(defaultSauceOptions, candidateCapabilities['sauce:options']);
browserConfig.push({
browser: candidateCapabilities.browserName,
capabilities: candidateCapabilities,
});
} else {
console.error('ERROR: supportedBrowsers.js is empty or incorrectly defined');
}
}
return browserConfig;
}
const setupConfig = {
tests: './src/test/e2e/tests/*_test.js',
teardown: testUserConfig.teardown,
output: `${process.cwd()}/${testConfig.TestOutputDir}`,
helpers: {
WebDriver: {
url: testConfig.baseUrl,
keepCookies: true,
browser,
smartWait,
waitForTimeout,
cssSelectorsEnabled: 'true',
host: 'ondemand.eu-central-1.saucelabs.com',
port: 80,
region: 'eu',
capabilities: {},
},
SauceLabsReportingHelper: {
require: './src/test/e2e/helpers/SauceLabsReportingHelper.js',
},
HooksHelper: {
require: './src/test/e2e/helpers/hooks_helper.js',
},
BrowserHelpers: {
require: './src/test/e2e/helpers/browser_helper.js',
},
DumpBrowserLogsHelper: {
require: './src/test/e2e/helpers/dump_browser_logs_helper.js',
},
StepListener: {
require: './src/test/e2e/helpers/stepListener.js',
},
Mochawesome: {
uniqueScreenshotNames: true,
},
},
plugins: {
autoLogin: testUserConfig.AutoLogin,
retryFailedStep: {
enabled: true,
retries: 2,
},
autoDelay: {
enabled: true,
delayAfter: 1000,
},
screenshotOnFail: {
enabled: true,
fullPageScreenshots: true,
},
},
include: {
config: './src/test/e2e/config.js',
I: './src/test/e2e/actors/main.js',
landingPage: './src/test/e2e/pages/LandingPage.js',
loginPage: './src/test/e2e/pages/login.page.js',
subjectDetailsPage: './src/test/e2e/pages/SubjectDetails.page.js',
subjectContactDetailsPage: './src/test/e2e/pages/SubjectContactDetails.page.js',
representationPage: './src/test/e2e/pages/Representation.page.js',
representationQualifiedPage: './src/test/e2e/pages/RepresentationQualified.page.js',
representativeDetailsPage: './src/test/e2e/pages/RepresentativeDetails.page.js',
uploadAppealForm: './src/test/e2e/pages/UploadAppealForm.page.js',
uploadSupportingDocuments: './src/test/e2e/pages/UploadSupportingDocuments.page.js',
uploadOtherInformation: './src/test/e2e/pages/UploadOtherInformation.page.js',
checkYourAnswersPage: './src/test/e2e/pages/CheckYourAnswers.page.js',
applicationSubmittedPage: './src/test/e2e/pages/applicationSubmitted.page.js',
},
mocha: {
reporterOptions: {
'codeceptjs-cli-reporter': {
stdout: '-',
options: { steps: true },
},
'mocha-junit-reporter': {
stdout: '-',
options: { mochaFile: `${testConfig.TestOutputDir}/result.xml` },
},
mochawesome: {
stdout: testConfig.TestOutputDir + '/console.log',
options: {
reportDir: testConfig.TestOutputDir,
reportName: 'index',
reportTitle: 'Crossbrowser results',
inlineAssets: true,
},
},
},
},
multiple: {
microsoft: {
browsers: getBrowserConfig('microsoft'),
},
chrome: {
browsers: getBrowserConfig('chrome'),
},
firefox: {
browsers: getBrowserConfig('firefox'),
},
},
name: 'Sptribs FrontEnd Cross-Browser Tests',
};
exports.config = setupConfig;