-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
60 lines (52 loc) · 1.79 KB
/
cypress.config.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
52
53
54
55
56
57
58
59
60
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'
// const addCucumberPreprocessorPlugin =
// require('@badeball/cypress-cucumber-preprocessor').addCucumberPreprocessorPlugin
// const createEsbuildPlugin = require('@bahmutov/cypress-esbuild-preprocessor').createEsbuildPlugin
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)
const bundler = createBundler({
// @ts-ignore
plugins: [createEsbuildPlugin(config)],
})
on('file:preprocessor', bundler)
// Make sure to return the config object as it might have been modified by the plugin.
return config
}
export default defineConfig({
component: {
specPattern: 'app/**/*.cy.{ts,tsx}',
devServer: {
framework: 'next',
bundler: 'webpack',
},
},
e2e: {
experimentalStudio: true,
setupNodeEvents,
specPattern: ['cypress/**/*.feature'],
// specPattern: "cypress/e2e/**/*.cy.ts",
// setupNodeEvents(on, config) {
// // implement node event listeners here
// },
baseUrl: 'https://apps.staging.stackbox.xyz/',
supportFile: false,
// @ts-ignore
nonGlobalStepDefinitions: false,
stepDefinitions: 'cypress/**/*.ts',
},
})
// import { defineConfig } from "cypress";
// export default defineConfig({
// e2e: {
// setupNodeEvents(on, config) {
// // implement node event listeners here
// },
// },
// });