From 9e3b20e4c357bfd9f7a04a4c80472db9257b8727 Mon Sep 17 00:00:00 2001 From: nileshgulia1 Date: Wed, 24 Aug 2022 13:03:35 +0530 Subject: [PATCH] latest volto compatibility --- Jenkinsfile | 6 ++--- cypress.config.js | 24 +++++++++++++++++ cypress.json | 17 ------------ .../block-basics.cy.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/block-basics.js => e2e/block-basics.cy.js} (97%) delete mode 100644 cypress/plugins/index.js rename cypress/support/{index.js => e2e.js} (100%) diff --git a/Jenkinsfile b/Jenkinsfile index 3dea7aa..1b10fcf 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 a8894dd..0000000 --- a/cypress.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "baseUrl": "http://localhost:3000", - "viewportWidth": 1280, - "defaultCommandTimeout": 8888, - "reporter": "junit", - "video": true, - "reporterOptions": { - "mochaFile": "cypress/reports/cypress-[hash].xml", - "jenkinsMode": true, - "toConsole": true - }, - "chromeWebSecurity": false, - "retries": { - "runMode": 8, - "openMode": 0 - } -} diff --git a/cypress/integration/block-basics.js b/cypress/e2e/block-basics.cy.js similarity index 97% rename from cypress/integration/block-basics.js rename to cypress/e2e/block-basics.cy.js index 77cc15b..aeeeb3e 100644 --- a/cypress/integration/block-basics.js +++ b/cypress/e2e/block-basics.cy.js @@ -1,4 +1,4 @@ -import { setupBeforeEach, tearDownAfterEach } from '../support'; +import { setupBeforeEach, tearDownAfterEach } from '../support/e2e'; import { changePageTitle, addBlock, selectBlock } from '../helpers'; import { openSidebarTab } from '../helpers'; import 'cypress-file-upload'; 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