-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.ts
53 lines (49 loc) · 1.22 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
import { PrismaClient } from "@prisma/client";
import { defineConfig } from "cypress";
import dotenv from "dotenv";
dotenv.config();
export default defineConfig({
e2e: {
retries: {
runMode: 1,
openMode: 0,
},
supportFile: "cypress/support/e2e.ts",
baseUrl: "http://localhost:3000",
chromeWebSecurity: false,
watchForFileChanges: false,
env: {
AUTH0_ISSUER: process.env.AUTH0_ISSUER,
},
setupNodeEvents(on, config) {
// to avoid some UI libraries (MUI) detect the mobile mode because the lack of pointer
on("before:browser:launch", (browser, launchOptions) => {
if (browser.family === "chromium" && browser.name !== "electron") {
launchOptions.args.push("--blink-settings=primaryPointerType=4");
return launchOptions;
}
});
tasks(on);
return config;
},
},
component: {
retries: {
runMode: 1,
openMode: 0,
},
watchForFileChanges: false,
devServer: {
framework: "next",
bundler: "webpack",
},
},
});
const prisma = new PrismaClient();
function tasks(on: Cypress.PluginEvents) {
on("task", {
"db:clearTasks"() {
return prisma.task.deleteMany();
},
});
}