-
Notifications
You must be signed in to change notification settings - Fork 13
/
cypress.config.ts
40 lines (38 loc) · 1.02 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
import { defineConfig } from "cypress";
import { logMessage } from "@lib/logger";
import terminalReport from "cypress-terminal-report/src/installLogsPrinter";
import dbTearDown from "./__utils__/dbTearDown";
import dbSeed from "./prisma/seeds/seed";
export default defineConfig({
video: false,
defaultCommandTimeout: 10000,
e2e: {
baseUrl: "http://localhost:3000",
setupNodeEvents(on) {
on("before:run", async () => {
logMessage.info("Tearing down database");
await dbTearDown();
logMessage.info("Seeding database");
await dbSeed("test");
});
if (process.env.CYPRESS_DEBUG) {
logMessage.info("Enabling terminal report for Debugging");
terminalReport(on);
}
},
},
component: {
devServer: {
framework: "next",
bundler: "webpack",
},
},
retries: {
// Configure retry attempts for `cypress run`
// Default is 0
runMode: 3,
// Configure retry attempts for `cypress open`
// Default is 0
openMode: 0,
},
});