forked from Ocelot-Social-Community/Ocelot-Social
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.js
47 lines (40 loc) · 1.19 KB
/
cypress.config.js
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 dotenv = require('dotenv')
const { defineConfig } = require("cypress");
const browserify = require("@badeball/cypress-cucumber-preprocessor/browserify");
const { addCucumberPreprocessorPlugin } = require("@badeball/cypress-cucumber-preprocessor");
// Test persistent(between commands) store
const testStore = {}
async function setupNodeEvents(on, config) {
await addCucumberPreprocessorPlugin(on, config);
on("file:preprocessor", browserify.default(config));
on("task", {
pushValue({ name, value }) {
testStore[name] = value
return true
},
getValue(name) {
console.log("getValue",name,testStore)
return testStore[name]
},
});
return config;
}
// Import backend .env (smart)?
const { parsed } = dotenv.config({ path: '../backend/.env' })
module.exports = defineConfig({
e2e: {
projectId: "qa7fe2",
defaultCommandTimeout: 60000,
pageLoadTimeout:180000,
chromeWebSecurity: false,
baseUrl: "http://localhost:3000",
specPattern: "cypress/e2e/**/*.feature",
supportFile: "cypress/support/e2e.js",
retries: 0,
video: false,
viewportHeight: 720,
viewportWidth: 1290,
setupNodeEvents,
},
env: parsed
});