UNPKG

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