1 | const path = require('path');
|
2 | require('babel-core/register');
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | const specsPath = 'testsToValidateStepDefinitions';
|
8 | const outputPath = 'uiTestResult';
|
9 | const cukeTractorPath = 'uiTestHelpers';
|
10 |
|
11 | exports.pomConfig = {
|
12 | outputPath,
|
13 | timeoutInSeconds: 3,
|
14 | pagesPath: path.resolve(specsPath, 'pages'),
|
15 | componentsPath: path.resolve(specsPath, 'components'),
|
16 | baseUrl: 'http://localhost:3000',
|
17 | };
|
18 |
|
19 | exports.cucumberHtmlReporterConfig = {};
|
20 |
|
21 | const protractorConfig = {
|
22 | directConnect: true,
|
23 | ignoreUncaughtExceptions: true,
|
24 | framework: 'custom',
|
25 | frameworkPath: require.resolve('protractor-cucumber-framework'),
|
26 | specs: [
|
27 | `${specsPath}/features/**/*.feature`,
|
28 | ],
|
29 | capabilities: {
|
30 |
|
31 | acceptInsecureCerts: false,
|
32 | shardTestFiles: !process.env.cukeTags && !process.env.debug,
|
33 | maxInstances: 4,
|
34 | browserName: 'chrome',
|
35 | chromeOptions: {
|
36 | args: ['--window-size=1100,800']
|
37 | .concat(process.env.disableHeadless ? [] : ['--headless', '--disable-gpu']),
|
38 | },
|
39 | },
|
40 | cucumberOpts: {
|
41 | 'require': [
|
42 |
|
43 | `${cukeTractorPath}/globals.js`,
|
44 | `${cukeTractorPath}/hooks/attachScenarioNameBefore.js`,
|
45 | `${cukeTractorPath}/hooks/attachScreenshotAfter.js`,
|
46 | `${cukeTractorPath}/hooks/deleteAllCookies.js`,
|
47 | `${cukeTractorPath}/hooks/pageObjectModelBefore.js`,
|
48 | `${cukeTractorPath}/hooks/addMethodsBefore.js`,
|
49 | `${cukeTractorPath}/hooks/setDefaultTimeout.js`,
|
50 | `${cukeTractorPath}/stepDefinitions/*.js`,
|
51 | `${specsPath}/stepDefinitions/*.js`,
|
52 |
|
53 | ],
|
54 | 'tags': ['~ignore'].concat(process.env.cukeTags || []),
|
55 | 'format': [
|
56 | 'cucumberFormatter.js',
|
57 | `json:./${outputPath}/report.json`,
|
58 | ],
|
59 | 'profile': false,
|
60 | 'no-source': true,
|
61 | },
|
62 | onPrepare: () => { browser.ignoreSynchronization = true; },
|
63 | };
|
64 |
|
65 | exports.config = protractorConfig;
|