forked from safe-global/safe-react-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.config.js
53 lines (46 loc) · 1.38 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
49
50
51
52
53
import { defineConfig } from 'cypress'
const axios = require('axios')
const { sendSlackMessage } = require('./cypress/lib/slack')
require('dotenv').config()
export default defineConfig({
projectId: 'okn21k',
chromeWebSecurity: false,
modifyObstructiveCode: false,
video: true,
retries: {
runMode: 2,
openMode: 2,
},
env: {
SAFE_APPS_BASE_URL: process.env.CYPRESS_SAFE_APPS_BASE_URL,
CHAIN_ID: process.env.CYPRESS_CHAIN_ID,
NETWORK_PREFIX: process.env.CYPRESS_NETWORK_PREFIX,
TESTING_SAFE_ADDRESS: process.env.CYPRESS_TESTING_SAFE_ADDRESS,
DRAIN_SAFE_URL: process.env.CYPRESS_DRAIN_SAFE_URL,
TX_BUILDER_URL: process.env.CYPRESS_TX_BUILDER_URL,
},
e2e: {
baseUrl: process.env.CYPRESS_WEB_BASE_URL,
async setupNodeEvents(on, config) {
on('after:run', sendSlackMessage)
on('task', {
log(message) {
console.log(message)
return null
},
})
let safeAppsList
try {
safeAppsList = await axios.get(
`${process.env.CYPRESS_CLIENT_GATEWAY_BASE_URL}/v1/chains/${
process.env.CYPRESS_CHAIN_ID
}/safe-apps?client_url=${encodeURIComponent(process.env.CYPRESS_WEB_BASE_URL)}`,
)
} catch (e) {
console.log('Unable to fetch the default list: ', e)
}
config.env.SAFE_APPS_LIST = safeAppsList.data
return config
},
},
})