-
Notifications
You must be signed in to change notification settings - Fork 3
/
cypress.config.ts
73 lines (70 loc) · 2.14 KB
/
cypress.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { Config } from '@fullstacksjs/config';
import { defineConfig } from 'cypress';
import viteProcessor from 'cypress-vite';
import { config } from './vite.config';
const envs = new Config({
retries: Config.number({ default: 1 }),
cypress: Config.object({
port: Config.number({ default: 3000 }),
host: Config.string({ default: 'localhost' }),
retries: Config.number({ default: 1 }),
video: Config.boolean({ default: true }),
}),
auth0: Config.object({
audience: Config.string().required(),
domain: Config.string().required(),
clientId: Config.string().required(),
}),
api: Config.object({
endpoint: Config.string().required(),
fileEndpoint: Config.string().required(),
secret: Config.string().required(),
}),
}).parse({
cypress: {
port: process.env.PORT,
host: process.env.HOST,
retries: process.env.CYPRESS_RETRIES,
video: process.env.CYPRESS_RECORD_VIDEO,
},
auth0: {
audience: process.env.APP_AUTH0_AUDIENCE,
domain: process.env.APP_AUTH0_DOMAIN,
clientId: process.env.APP_AUTH0_CLIENT_ID,
},
api: {
endpoint: process.env.APP_API_ENDPOINT,
secret: process.env.APP_HASURA_ADMIN_SECRET,
fileEndpoint: process.env.APP_FILE_STORAGE_API_ENDPOINT,
},
});
export default defineConfig({
e2e: {
retries: envs.get('cypress.retries'),
baseUrl: `https://${envs.get('cypress.host')}:${envs.get('cypress.port')}`,
projectId: '8jt3ix',
video: envs.get('cypress.video'),
defaultCommandTimeout: 10000,
experimentalMemoryManagement: true,
env: {
APP_FILE_STORAGE_API_ENDPOINT: envs.get('api.fileEndpoint'),
APP_AUTH0_AUDIENCE: envs.get('auth0.audience'),
APP_AUTH0_DOMAIN: envs.get('auth0.domain'),
APP_AUTH0_CLIENT_ID: envs.get('auth0.clientId'),
APP_API_ENDPOINT: envs.get(`api.endpoint`),
APP_HASURA_ADMIN_SECRET: envs.get('api.secret'),
},
setupNodeEvents(on) {
on('file:preprocessor', viteProcessor());
},
},
component: {
viewportHeight: 760,
viewportWidth: 1280,
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: config({ https: false }),
},
},
});