-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcypress.config.cjs
More file actions
47 lines (45 loc) · 1.32 KB
/
cypress.config.cjs
File metadata and controls
47 lines (45 loc) · 1.32 KB
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
const { defineConfig } = require("cypress")
const fs = require("fs-extra")
const path = require("path")
module.exports = defineConfig({
projectId: "vb97jp",
// default screen size for testing
viewportWidth: 1000,
viewportHeight: 660,
e2e: {
setupNodeEvents(on, config) {
require("@cypress/code-coverage/task")(on, config)
on("task", {
setUpKartat: ({ config, php = "config-01" }) => {
const kartatPath = path.join(__dirname, "kartat")
const setupPath = path.join(__dirname, "cypress/fixtures", config)
fs.rmSync(kartatPath, { recursive: true, force: true })
fs.mkdirSync(kartatPath)
if (fs.existsSync(setupPath)) {
fs.copySync(setupPath, kartatPath)
}
// php config
const sourceConfig = path.join(__dirname, "cypress/fixtures/php", php + ".php")
const destConfig = path.join(__dirname, "rg2-config.php")
fs.copyFileSync(sourceConfig, destConfig)
return null
}
})
return config
},
env: {
codeCoverage: {
exclude: "cypress/**/*.*"
}
},
component: {
devServer: {
bundler: "vite"
},
setupNodeEvents(on, config) {
require("@cypress/code-coverage/task")(on, config)
return config
}
}
}
})