forked from solidcouch/solidcouch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
52 lines (49 loc) · 1.74 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
import { defineConfig } from 'cypress'
import vitePreprocessor from 'cypress-vite'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const viteConfigPath = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
'./vite.cypress.config.ts',
)
// eslint-disable-next-line import/no-default-export
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:4173',
defaultCommandTimeout: 15000,
// set mobile viewport as default, because we make mobile-first interface
// this is screen size of iPhone 11, apparently a popular phone
viewportWidth: 375,
viewportHeight: 812,
setupNodeEvents(on) {
// https://github.com/cypress-io/cypress/issues/14600#issuecomment-1614013583
on('before:browser:launch', (browser, launchOptions) => {
if (browser.family === 'firefox') {
// launchOptions.preferences is a map of preference names to values
// login is not working in firefox when testing_localhost_is_secure_when_hijacked is false
launchOptions.preferences[
'network.proxy.testing_localhost_is_secure_when_hijacked'
] = true
}
return launchOptions
})
on('task', {
log(message) {
// eslint-disable-next-line no-console
console.log(message)
return null
},
})
on('file:preprocessor', vitePreprocessor(viteConfigPath))
},
},
env: {
CSS_URL: 'http://localhost:4000',
COMMUNITY: 'http://localhost:4000/test-community/community#us',
OTHER_COMMUNITY: 'http://localhost:4000/other-community/community#us',
EMAIL_NOTIFICATIONS_IDENTITY:
'http://localhost:4000/mailbot/profile/card#me',
},
screenshotOnRunFailure: false,
video: false,
})