forked from edewit/keycloak-admin-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.mjs
51 lines (46 loc) · 1.35 KB
/
cypress.config.mjs
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 webpackPreprocessor from "@cypress/webpack-batteries-included-preprocessor";
import { defineConfig } from "cypress";
import { deleteAsync } from "del";
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
export default defineConfig({
projectId: "j4yhox",
screenshotsFolder: "assets/screenshots",
videosFolder: "assets/videos",
chromeWebSecurity: false,
viewportWidth: 1360,
viewportHeight: 768,
defaultCommandTimeout: 30000,
videoCompression: false,
numTestsKeptInMemory: 30,
videoUploadOnPasses: false,
retries: {
runMode: 3,
},
e2e: {
setupNodeEvents(on) {
on(
"file:preprocessor",
webpackPreprocessor({
typescript: require.resolve("typescript"),
})
);
on("after:spec", async (spec, results) => {
if (!results.video) {
return;
}
// Do we have failures for any retry attempts?
const failures = results.tests.some(({ attempts }) =>
attempts.some(({ state }) => state === "failed")
);
// Delete the video if the spec passed and no tests were retried.
if (!failures) {
await deleteAsync(results.video);
}
});
},
baseUrl: "http://localhost:8080",
slowTestThreshold: 30000,
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
},
});