-
Notifications
You must be signed in to change notification settings - Fork 4
/
synpress.config.ts
53 lines (47 loc) · 1.47 KB
/
synpress.config.ts
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';
import synpressPlugins from '@synthetixio/synpress/plugins';
import { safeAddDefaultLocalNetwork } from './src/utils/network';
const ethRpcUrl = process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL;
const arbRpcUrl = process.env.NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL;
if (!ethRpcUrl) {
throw new Error('process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL is not set');
}
if (!arbRpcUrl) {
throw new Error('process.env.NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL is not set');
}
export default defineConfig({
userAgent: 'synpress',
retries: 2,
screenshotsFolder: 'cypress/screenshots',
videosFolder: 'cypress/videos',
video: false,
screenshotOnRunFailure: true,
chromeWebSecurity: true,
modifyObstructiveCode: false,
scrollBehavior: false,
viewportWidth: 1366,
viewportHeight: 850,
env: {
coverage: false,
},
defaultCommandTimeout: 30000,
pageLoadTimeout: 30000,
requestTimeout: 30000,
e2e: {
async setupNodeEvents(on, config) {
safeAddDefaultLocalNetwork();
// Set Cypress variables
config.env.ETH_RPC_URL = ethRpcUrl;
config.env.ARB_RPC_URL = arbRpcUrl;
config.env.INFURA_KEY = process.env.NEXT_PUBLIC_INFURA_KEY;
synpressPlugins(on, config);
return config;
},
baseUrl: 'http://localhost:3000',
specPattern: [
// order of running the tests...
'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}', // rest of the tests...
],
supportFile: 'tests/support/support.ts',
},
});