UNPKG

2.1 kBJavaScriptView Raw
1const path = require('path');
2require('babel-core/register');
3
4// This config file is used to validate the pre-defined
5// reusable generic step definitions in this repo
6
7const specsPath = 'testsToValidateStepDefinitions';
8const outputPath = 'uiTestResult';
9const cukeTractorPath = 'uiTestHelpers';
10
11exports.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
19exports.cucumberHtmlReporterConfig = {};
20
21const 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 // change acceptInsecureCerts to true if you are testing on https and using self-signed certs
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 // `${specsPath}/helpers/globals.js`,
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 // `${specsPath}/helpers/hooks.js`,
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
65exports.config = protractorConfig;