From a0091cfed3862105ac912e756ff4fac2db21fdc3 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Wed, 19 Oct 2022 17:00:06 +0300 Subject: [PATCH] Upgrade to cypress@10 --- Jenkinsfile | 6 ++--- cypress.config.js | 24 ++++++++++++++++++ cypress.json | 17 ------------- cypress/{integration => e2e}/block-basics.js | 2 +- cypress/plugins/index.js | 26 -------------------- cypress/support/{index.js => e2e.js} | 0 6 files changed, 28 insertions(+), 47 deletions(-) create mode 100644 cypress.config.js delete mode 100644 cypress.json rename cypress/{integration => e2e}/block-basics.js (93%) delete mode 100644 cypress/plugins/index.js rename cypress/support/{index.js => e2e.js} (100%) diff --git a/Jenkinsfile b/Jenkinsfile index 282be19..48c34d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,19 +41,19 @@ pipeline { "ES lint": { node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint''' + sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e VOLTO=$VOLTO -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint''' } }, "Style lint": { node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint''' + sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e VOLTO=$VOLTO -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint''' } }, "Prettier": { node(label: 'docker') { - sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier''' + sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e VOLTO=$VOLTO -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier''' } } ) diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 0000000..b8c1c23 --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,24 @@ +const { defineConfig } = require('cypress'); + +module.exports = defineConfig({ + viewportWidth: 1280, + defaultCommandTimeout: 8888, + chromeWebSecurity: false, + reporter: 'junit', + video: true, + retries: { + runMode: 8, + openMode: 0, + }, + reporterOptions: { + mochaFile: 'cypress/reports/cypress-[hash].xml', + jenkinsMode: true, + toConsole: true, + }, + e2e: { + setupNodeEvents(on, config) { + // e2e testing node events setup code + }, + baseUrl: 'http://localhost:3000', + }, +}); diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 736dedd..0000000 --- a/cypress.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "baseUrl": "http://localhost:3000", - "viewportWidth": 1280, - "defaultCommandTimeout": 8888, - "chromeWebSecurity": false, - "reporter": "junit", - "video": true, - "retries": { - "runMode": 8, - "openMode": 0 - }, - "reporterOptions": { - "mochaFile": "cypress/reports/cypress-[hash].xml", - "jenkinsMode": true, - "toConsole": true - } -} diff --git a/cypress/integration/block-basics.js b/cypress/e2e/block-basics.js similarity index 93% rename from cypress/integration/block-basics.js rename to cypress/e2e/block-basics.js index 4daed6d..568aadc 100644 --- a/cypress/integration/block-basics.js +++ b/cypress/e2e/block-basics.js @@ -1,4 +1,4 @@ -import { setupBeforeEach, tearDownAfterEach } from '../support'; +import { setupBeforeEach, tearDownAfterEach } from '../support/e2e'; describe('Blocks Tests', () => { beforeEach(setupBeforeEach); diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js deleted file mode 100644 index 27a31a5..0000000 --- a/cypress/plugins/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/// -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -/** - * @type {Cypress.PluginConfig} - */ -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config - /* coverage-start - require('@cypress/code-coverage/task')(on, config) - on('file:preprocessor', require('@cypress/code-coverage/use-babelrc')) - return config - coverage-end */ -}; diff --git a/cypress/support/index.js b/cypress/support/e2e.js similarity index 100% rename from cypress/support/index.js rename to cypress/support/e2e.js