forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
49 lines (45 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
48
const fetch = require('node-fetch');
const { defineConfig } = require('cypress');
const BASE_URL = 'http://localhost:5678';
module.exports = defineConfig({
projectId: "5hbsdn",
retries: {
openMode: 0,
runMode: 2,
},
defaultCommandTimeout: 10000,
requestTimeout: 12000,
numTestsKeptInMemory: 2,
experimentalMemoryManagement: true,
e2e: {
baseUrl: BASE_URL,
video: true,
screenshotOnRunFailure: true,
experimentalInteractiveRunEvents: true,
experimentalSessionAndOrigin: true,
setupNodeEvents(on, config) {
on('task', {
reset: () => fetch(BASE_URL + '/e2e/db/reset', { method: 'POST' }),
'setup-owner': (payload) => {
try {
return fetch(BASE_URL + '/e2e/db/setup-owner', {
method: 'POST',
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' },
})
} catch (error) {
console.error("setup-owner failed with: ", error)
return null
}
},
'set-feature': ({ feature, enabled }) => {
return fetch(BASE_URL + `/e2e/feature/${feature}`, {
method: 'PATCH',
body: JSON.stringify({ enabled }),
headers: { 'Content-Type': 'application/json' }
})
},
});
},
},
});