aboutsummaryrefslogtreecommitdiffstats
path: root/cypress.config.ts
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-10-20 16:03:19 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-11-29 11:23:05 +0100
commit064fa10ecfe4725398895a21ab8bafd171e2eadd (patch)
tree5f2d8124eb131a65eac207edee560c49ea7835f3 /cypress.config.ts
parentcedae7c6d74e11c8aaa59b09a38db04dbebc818d (diff)
downloadnextcloud-server-064fa10ecfe4725398895a21ab8bafd171e2eadd.tar.gz
nextcloud-server-064fa10ecfe4725398895a21ab8bafd171e2eadd.zip
Extract colour from custom background
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'cypress.config.ts')
-rw-r--r--cypress.config.ts85
1 files changed, 85 insertions, 0 deletions
diff --git a/cypress.config.ts b/cypress.config.ts
new file mode 100644
index 00000000000..b7c6934689a
--- /dev/null
+++ b/cypress.config.ts
@@ -0,0 +1,85 @@
+/* eslint-disable node/no-unpublished-import */
+import { applyChangesToNextcloud, configureNextcloud, preppingNextcloud, startNextcloud, stopNextcloud, waitOnNextcloud } from './cypress/dockerNode'
+import { defineConfig } from 'cypress'
+
+import browserify from '@cypress/browserify-preprocessor'
+
+export default defineConfig({
+ projectId: '37xpdh',
+
+ // 16/9 screen ratio
+ viewportWidth: 1280,
+ viewportHeight: 720,
+
+ // Tries again 2 more times on failure
+ retries: {
+ runMode: 2,
+ // do not retry in `cypress open`
+ openMode: 0,
+ },
+
+ // Needed to trigger `after:run` events with cypress open
+ experimentalInteractiveRunEvents: true,
+
+ // faster video processing
+ videoCompression: false,
+
+ // Visual regression testing
+ env: {
+ failSilently: false,
+ type: 'actual',
+ },
+ screenshotsFolder: 'cypress/snapshots/actual',
+ trashAssetsBeforeRuns: true,
+
+ e2e: {
+ // Enable session management and disable isolation
+ experimentalSessionAndOrigin: true,
+ testIsolation: 'off',
+
+ // We've imported your old cypress plugins here.
+ // You may want to clean this up later by importing these.
+ async setupNodeEvents(on, config) {
+ // Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
+ on('file:preprocessor', browserify({ typescript: require.resolve('typescript') }))
+
+ // 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
+ }
+ })
+
+ // Remove container after run
+ on('after:run', () => {
+ stopNextcloud()
+ })
+
+ // Before the browser launches
+ // starting Nextcloud testing container
+ return startNextcloud(process.env.BRANCH)
+ .then((ip) => {
+ // Setting container's IP as base Url
+ config.baseUrl = `http://${ip}/index.php`
+ return ip
+ })
+ .then(waitOnNextcloud)
+ .then(configureNextcloud)
+ .then(applyChangesToNextcloud)
+ .then(() => {
+ return config
+ })
+ },
+ },
+})