forked from canvaspixels/courgette
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcourgette-conf.js
85 lines (76 loc) · 2.71 KB
/
courgette-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
const path = require('path');
require('babel-core/register');
// This config file is used to validate the pre-defined
// reusable generic step definitions in this repo
const specsPath = 'testsToValidateStepDefinitions';
const outputPath = 'uiTestResult';
const courgettePath = 'uiTestHelpers';
exports.pomConfig = {
outputPath,
timeoutInSeconds: process.env.courgetteTimeout || 10,
pagesPath: path.resolve(specsPath, 'pages'),
componentsPath: path.resolve(specsPath, 'components'),
stepsPath: path.resolve(specsPath, 'stepDefinitions'),
baseUrl: 'http://localhost:3000',
};
exports.cucumberHtmlReporterConfig = {};
const capabilities = {
chrome: {
browserName: 'chrome',
chromeOptions: {
args: ['--window-size=1100,800']
.concat(process.env.disableHeadless ? [] : ['--headless', '--disable-gpu']),
},
},
firefox: {
'browserName': 'firefox',
'moz:firefoxOptions': {
args: [].concat(process.env.disableHeadless ? [] : ['-headless']),
prefs: {
'general.useragent.override': 'Automated tests',
},
},
},
};
const browserCapability = capabilities[process.env.browser || 'chrome'];
const tags = process.env.tags ? process.env.tags.replace(',', ' or ') : '';
const protractorConfig = {
directConnect: true,
ignoreUncaughtExceptions: true,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
`${specsPath}/features/**/*.feature`,
],
capabilities: {
// change acceptInsecureCerts to true if you are testing on https and using self-signed certs
'shardTestFiles': !tags && !process.env.linearise && !process.env.showStepDefinitionUsage,
'maxInstances': 4,
...browserCapability,
},
cucumberOpts: {
'require': [
// `${specsPath}/helpers/globals.js`,
`${courgettePath}/globals.js`,
`${courgettePath}/hooks/attachScenarioNameBefore.js`,
`${courgettePath}/hooks/attachScreenshotAfter.js`,
`${courgettePath}/hooks/deleteAllCookies.js`,
`${courgettePath}/hooks/loadSteps.js`,
`${courgettePath}/hooks/pageObjectModelBefore.js`,
`${courgettePath}/hooks/addMethodsBefore.js`,
`${courgettePath}/hooks/setDefaultTimeout.js`,
`${courgettePath}/stepDefinitions/*.js`,
`${specsPath}/stepDefinitions/*.js`,
// `${specsPath}/helpers/hooks.js`,
],
'tags': ['~@ignore'].concat(tags || []),
'format': [
'cucumberFormatter.js',
`json:./${outputPath}/report.json`,
].concat(process.env.showStepDefinitionUsage ? 'node_modules/cucumber/lib/formatter/usage_formatter.js' : []),
'profile': false,
'no-source': true,
},
onPrepare: () => { browser.ignoreSynchronization = true; },
};
exports.config = protractorConfig;