Skip to content

Commit 66b59aa

Browse files
committed
chore(e2e): Upgrade cypress
1 parent 3531178 commit 66b59aa

File tree

23 files changed

+12827
-24276
lines changed

23 files changed

+12827
-24276
lines changed

.cypress-cucumber-preprocessorrc.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"e2e": {
3+
"stepDefinitions": "test/e2e/specs/**/*.{js,mjs,ts,tsx}",
4+
"messages": {
5+
"enabled": true,
6+
"output": "test/e2e/cucumber-messages.ndjson"
7+
},
8+
"json": {
9+
"enabled": true,
10+
"output": "test/e2e/cucumber-report.json"
11+
}
12+
}
13+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ example/demo.js.map
1010
example-e2e/app.js
1111
example-e2e/app.js.map
1212
test/unit/coverage
13-
test/e2e/cucumber-json
13+
test/e2e/cucumber-messages.ndjson
14+
test/e2e/cucumber-report.json
15+
test/e2e/screenshots/
1416
yarn-debug.log*
1517
yarn-error.log*
1618
.idea

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.18.0
1+
18.16.0

cypress.config.js

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
const { defineConfig } = require('cypress')
2-
const cucumber = require('cypress-cucumber-preprocessor').default
2+
const createBundler = require('@bahmutov/cypress-esbuild-preprocessor')
3+
const preprocessor = require('@badeball/cypress-cucumber-preprocessor')
4+
const createEsbuildPlugin = require('@badeball/cypress-cucumber-preprocessor/esbuild')
5+
6+
async function setupNodeEvents(on, config) {
7+
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
8+
await preprocessor.addCucumberPreprocessorPlugin(on, config)
9+
10+
on(
11+
'file:preprocessor',
12+
createBundler({
13+
plugins: [createEsbuildPlugin.default(config)],
14+
}),
15+
)
16+
17+
// Make sure to return the config object as it might have been modified by the plugin.
18+
return config
19+
}
320

421
module.exports = defineConfig({
522
defaultCommandTimeout: 1000,
623
e2e: {
7-
setupNodeEvents(on, config) {
8-
on('file:preprocessor', cucumber())
9-
10-
return {
11-
...config,
12-
fixturesFolder: 'test/e2e/fixtures',
13-
screenshotsFolder: 'test/e2e/screenshots',
14-
specPattern: 'test/e2e/specs/**/*.{feature,features}',
15-
supportFile: 'test/e2e/support/index.js',
16-
video: false,
17-
videosFolder: 'test/e2e/videos',
18-
}
19-
},
2024
baseUrl: 'http://localhost:8080',
25+
experimentalRunAllSpecs: true,
26+
fixturesFolder: false,
27+
screenshotsFolder: 'test/e2e/screenshots',
28+
setupNodeEvents,
2129
specPattern: 'test/e2e/specs/**/*.{feature,features}',
2230
supportFile: 'test/e2e/support/index.js',
31+
video: false,
32+
viewportWidth: 400,
2333
},
2434
})

0 commit comments

Comments
 (0)