Skip to content

Commit 3f02d58

Browse files
author
Sergey Shoomakov
committed
e2e readme, dependencies
1 parent 5058fed commit 3f02d58

File tree

7 files changed

+8
-329
lines changed

7 files changed

+8
-329
lines changed

template/tests/e2e/cypress.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@
2525
"viewportHeight": 900,
2626
"supportFile": "cypress/support/index.ts",
2727
"videoUploadOnPasses": false,
28-
"port": 9222,
29-
"projectId": "enzdsy"
28+
"port": 9222
3029
}
Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
/* eslint-disable global-require */
22
const cucumber = require('cypress-cucumber-preprocessor').default;
33
const browserify = require('@cypress/browserify-preprocessor');
4-
// const retriesPlugin = require('cypress-plugin-retries/lib/plugin');
54
const { initPlugin } = require('cypress-plugin-snapshots/plugin');
6-
const reporter = require('cucumber-html-reporter');
7-
const puppeteer = require('puppeteer');
85
const { getConfig } = require('./snapshots');
9-
const appPkgJson = require('../../../../package.json');
106

117

128
module.exports = (on, config) => {
@@ -16,79 +12,7 @@ module.exports = (on, config) => {
1612

1713
on('file:preprocessor', cucumber(options));
1814

19-
// retriesPlugin(on);
20-
//
21-
// on('before:browser:launch', (browser = {}, launchOptions) => {
22-
// // `args` is an array of all the arguments that will
23-
// // be passed to browsers when it launches
24-
// console.log(launchOptions.args); // print all current args
25-
//
26-
// if (browser.family === 'chrome' && browser.name !== 'electron') {
27-
// // auto open devtools
28-
// launchOptions.args.push([
29-
// '--disable-dev-shm-usage',
30-
// '--disable-site-isolation-trials',
31-
// `--remote-debugging-port=${config.port}`,
32-
// ]
33-
// );
34-
//
35-
// // whatever you return here becomes the launchOptions
36-
// return launchOptions;
37-
// }
38-
//
39-
// if (browser.family === 'firefox') {
40-
// // auto open devtools
41-
// launchOptions.args.push('-devtools');
42-
//
43-
// return launchOptions;
44-
// }
45-
// });
46-
47-
on('task', {
48-
connectPuppeteer: args => async () => {
49-
debugger;
50-
const browser = await puppeteer.connect({
51-
browserURL: `http://localhost:${config.port}`,
52-
});
53-
const page = await browser.newPage();
54-
55-
await page.goto(config.baseUrl);
56-
57-
console.log('-----------------------connectPuppeteer-----------------------------');
58-
console.log(page);
59-
return null;
60-
},
61-
reporter(args = null) {
62-
const options = {
63-
theme: 'bootstrap',
64-
ignoreBadJsonFile: true,
65-
jsonDir: 'cypress/cucumber-json',
66-
output: `${config.screenshotsFolder}/cucumber_report.html`,
67-
reportSuiteAsScenarios: true,
68-
scenarioTimestamp: true,
69-
launchReport: true,
70-
metadata: {
71-
'App Version': appPkgJson.version,
72-
'Test Environment': process.env.STAGE,
73-
baseUrl: config.baseUrl,
74-
Browser: process.env.OS,
75-
Parallel: "Scenarios",
76-
Executed: "Remote",
77-
}
78-
};
79-
reporter.generate(options);
80-
81-
return null;
82-
}
83-
});
84-
85-
// on('task', {
86-
// failed: require('cypress-failed-log/src/failed')(),
87-
// });
88-
8915
initPlugin(on, getConfig(config));
9016

91-
console.log('-------------------------------------------');
92-
console.log(config);
9317
return config;
9418
};

template/tests/e2e/cypress/plugins/snapshots.js

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
/// <reference types="Cypress" />
2-
/// <reference types="cypress-pipe" />
3-
4-
after(() => {
5-
cy.task('reporter', 'test run');
6-
});
1+
/// <reference types="cypress" />

0 commit comments

Comments
 (0)