-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
49 lines (47 loc) · 1.4 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
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import { createEsbuildPlugin } from "@badeball/cypress-cucumber-preprocessor/esbuild";
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { devServer } from "@cypress/vite-dev-server";
import { viteCommonjs } from "@originjs/vite-plugin-commonjs";
import react from "@vitejs/plugin-react";
import { defineConfig } from "cypress";
export default defineConfig({
video: false,
screenshotOnRunFailure: true,
watchForFileChanges: true,
chromeWebSecurity: false,
retries: {
runMode: 2,
openMode: 0,
},
projectId: "6ipboc",
e2e: {
specPattern: "**/*.feature",
baseUrl: "http://localhost:3000",
async setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
// Make sure to return the config object as it might have been modified by the plugin.
return config;
},
},
component: {
devServer(devServerConfig) {
return devServer({
...devServerConfig,
framework: "react",
viteConfig: {
plugins: [react(), viteCommonjs()],
},
});
},
},
});