-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathcypress.config.mjs
More file actions
89 lines (81 loc) · 2.06 KB
/
cypress.config.mjs
File metadata and controls
89 lines (81 loc) · 2.06 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { defineConfig } from 'cypress'
import vitePreprocessor from 'cypress-vite'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import vue from '@vitejs/plugin-vue2'
export default defineConfig({
projectId: 'ixbf9n',
e2e: {
baseUrl: 'http://nextcloud.local/index.php/',
setupNodeEvents(on, config) {
on('file:preprocessor', vitePreprocessor({
plugins: [vue(), nodePolyfills()],
configFile: false,
}))
// Disable spell checking to prevent rendering differences
on('before:browser:launch', (browser, launchOptions) => {
if (browser.family === 'chromium' && browser.name !== 'electron') {
launchOptions.preferences.default['browser.enable_spellchecking'] = false
return launchOptions
}
if (browser.family === 'firefox') {
launchOptions.preferences['layout.spellcheckDefault'] = 0
return launchOptions
}
if (browser.name === 'electron') {
launchOptions.preferences.spellcheck = false
return launchOptions
}
})
return config
},
},
component: {
devServer: {
framework: 'vue',
bundler: 'vite',
viteConfig: {
resolve: {
alias: {
'vue': 'vue',
},
},
plugins: [vue(), nodePolyfills()],
optimizeDeps: {
exclude: [
'vite-plugin-node-polyfills/shims/buffer',
'vite-plugin-node-polyfills/shims/global',
'vite-plugin-node-polyfills/shims/process'
],
force: true
},
define: {
global: 'globalThis',
},
},
},
setupNodeEvents(on, config) {
on('file:preprocessor', vitePreprocessor({
plugins: [vue(), nodePolyfills()],
configFile: false,
optimizeDeps: {
exclude: [
'vite-plugin-node-polyfills/shims/buffer',
'vite-plugin-node-polyfills/shims/global',
'vite-plugin-node-polyfills/shims/process'
],
force: true
},
define: {
global: 'globalThis',
},
}))
return config
},
viewportWidth: 800,
viewportHeight: 600,
},
})