-
Notifications
You must be signed in to change notification settings - Fork 1
/
cypress.config.e2e.ts
51 lines (46 loc) · 1.44 KB
/
cypress.config.e2e.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { defineConfig } from 'cypress'
import createBundler from '@bahmutov/cypress-esbuild-preprocessor'
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor'
import createEsbuildPlugin from '@badeball/cypress-cucumber-preprocessor/esbuild'
import NodeModulesPolyfillPlugin from '@esbuild-plugins/node-modules-polyfill'
async function setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions,
): Promise<Cypress.PluginConfigOptions> {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config)
on(
'file:preprocessor',
createBundler({
plugins: [NodeModulesPolyfillPlugin(), createEsbuildPlugin(config)],
}),
)
on('task', {
log(...args) {
// eslint-disable-next-line
console.log(...args)
return null
},
})
// Make sure to return the config object as it might have been modified by the plugin.
return config
}
export default defineConfig({
chromeWebSecurity: false,
video: true,
fixturesFolder: 'e2e/fixtures',
screenshotsFolder: 'e2e/screenshots',
videosFolder: 'e2e/videos',
reporter: 'cypress-multi-reporters',
reporterOptions: {
configFile: 'reporter-config.json',
},
taskTimeout: 70000,
e2e: {
specPattern: 'e2e/tests/**/*.feature',
setupNodeEvents,
supportFile: false,
},
numTestsKeptInMemory: 0,
retries: 1,
})