diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c15e1c..947b2d0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.2.8](https://github.com/eea/volto-tabs-block/compare/1.2.7...1.2.8) + +- Correct Cypress tests [`#12`](https://github.com/eea/volto-tabs-block/pull/12) +- Refs #142010 - Optimize Volto-addons gitflow pipelines [`d10c0b3`](https://github.com/eea/volto-tabs-block/commit/d10c0b3d35d25c530d19eebde38dfe5da8fda01b) + #### [1.2.7](https://github.com/eea/volto-tabs-block/compare/1.2.6...1.2.7) +> 27 August 2021 + +- Remove hard dependencies to Volto add-ons to avoid dependencies hell [`#11`](https://github.com/eea/volto-tabs-block/pull/11) - Develop [`#10`](https://github.com/eea/volto-tabs-block/pull/10) - Develop [`#9`](https://github.com/eea/volto-tabs-block/pull/9) - Cypress coverage [`#8`](https://github.com/eea/volto-tabs-block/pull/8) @@ -25,12 +33,9 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Develop [`#9`](https://github.com/eea/volto-tabs-block/pull/9) - Move less import in View instead of Edit [`84aeff0`](https://github.com/eea/volto-tabs-block/commit/84aeff04a980076f54687c546691d37b6e790478) - gitignore tweaks [`f4c993d`](https://github.com/eea/volto-tabs-block/commit/f4c993d004b126f08f16651ab9460546fa9e9cad) -- Add Sonarqube tag using frontend addons list [`865906a`](https://github.com/eea/volto-tabs-block/commit/865906a0deb261d44cc23e26bfd2d1dd0e319640) -- Add Sonarqube tag using frontend addons list [`5383861`](https://github.com/eea/volto-tabs-block/commit/538386100adbc868e693c1c2a5ba13461307ffee) - Style update [`323aaaf`](https://github.com/eea/volto-tabs-block/commit/323aaafcad01d8fdf0e713a1fc254ae9fe319f43) - Fix 'scroll to' feature on carousel [`16c6a08`](https://github.com/eea/volto-tabs-block/commit/16c6a08f6db687542ea38e07a92b265e592f6173) - Better accesibility [`3511611`](https://github.com/eea/volto-tabs-block/commit/351161197270a4807f01d85a7055cbaadae72f8e) -- Updated Jenkins dependencies [`24471fd`](https://github.com/eea/volto-tabs-block/commit/24471fd7c678d04f244b132f13b4c655838f4e94) - Add jest configuration [`c01b021`](https://github.com/eea/volto-tabs-block/commit/c01b0213bcb4b51408b6e3c196b2dcfa086377a9) #### [1.2.4](https://github.com/eea/volto-tabs-block/compare/1.2.3...1.2.4) @@ -38,7 +43,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 27 May 2021 - Cypress coverage [`#8`](https://github.com/eea/volto-tabs-block/pull/8) -- [JENKINS] - Fix stylelint [`2319baa`](https://github.com/eea/volto-tabs-block/commit/2319baa8258828cd3847715779bc21d472bd7677) - Added z-index [`5aa8221`](https://github.com/eea/volto-tabs-block/commit/5aa8221d20c02e34788571d9231e73431c1043fe) #### [1.2.3](https://github.com/eea/volto-tabs-block/compare/1.2.2...1.2.3) @@ -53,7 +57,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 12 May 2021 -- JENKINS: auto-release pipeline [`#5`](https://github.com/eea/volto-tabs-block/pull/5) - Update style for menu title & description [`0683074`](https://github.com/eea/volto-tabs-block/commit/06830749ca9655ba74e07984536020b826da0696) - Updated styles [`104f8ab`](https://github.com/eea/volto-tabs-block/commit/104f8ab3cf60f7e4e54e84d1b523010e97be1f66) - Prettier [`f1dd4bc`](https://github.com/eea/volto-tabs-block/commit/f1dd4bcd3d82c37db00810bdc7a11c7dee4c3276) diff --git a/Jenkinsfile b/Jenkinsfile index 0d322f9e..890f4f42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,13 +4,37 @@ pipeline { environment { GIT_NAME = "volto-tabs-block" NAMESPACE = "@eeacms" - SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu" + SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu" DEPENDENCIES = "@eeacms/volto-block-style" } stages { + stage('Release') { + when { + allOf { + environment name: 'CHANGE_ID', value: '' + branch 'master' + } + } + steps { + node(label: 'docker') { + withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) { + sh '''docker pull eeacms/gitflow''' + sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow''' + } + } + } + } + stage('Code') { + when { + allOf { + environment name: 'CHANGE_ID', value: '' + not { branch 'master' } + not { changelog '.*^Automated release [0-9\\.]+$' } + } + } steps { parallel( @@ -36,6 +60,12 @@ pipeline { } stage('Tests') { + when { + allOf { + environment name: 'CHANGE_ID', value: '' + not { changelog '.*^Automated release [0-9\\.]+$' } + } + } steps { parallel( @@ -75,6 +105,12 @@ pipeline { } stage('Integration tests') { + when { + allOf { + environment name: 'CHANGE_ID', value: '' + not { changelog '.*^Automated release [0-9\\.]+$' } + } + } steps { parallel( @@ -122,11 +158,13 @@ pipeline { } stage('Report to SonarQube') { - // Exclude Pull-Requests when { - allOf { environment name: 'CHANGE_ID', value: '' - } + anyOf { + branch 'master' + branch 'develop' + } + not { changelog '.*^Automated release [0-9\\.]+$' } } steps { node(label: 'swarm') { @@ -156,8 +194,8 @@ pipeline { steps { node(label: 'docker') { script { - if ( env.CHANGE_BRANCH != "develop" && !( env.CHANGE_BRANCH.startsWith("hotfix")) ) { - error "Pipeline aborted due to PR not made from develop or hotfix branch" + if ( env.CHANGE_BRANCH != "develop" ) { + error "Pipeline aborted due to PR not made from develop branch" } withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { sh '''docker pull eeacms/gitflow''' @@ -168,23 +206,6 @@ pipeline { } } - stage('Release') { - when { - allOf { - environment name: 'CHANGE_ID', value: '' - branch 'master' - } - } - steps { - node(label: 'docker') { - withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) { - sh '''docker pull eeacms/gitflow''' - sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow''' - } - } - } - } - } post { diff --git a/cypress/integration/block-basics.js b/cypress/integration/block-basics.js index 454084ce..4daed6db 100644 --- a/cypress/integration/block-basics.js +++ b/cypress/integration/block-basics.js @@ -5,16 +5,17 @@ describe('Blocks Tests', () => { afterEach(tearDownAfterEach); it('Add Block: Empty', () => { + // without this the clear command below does nothing sometimes + cy.wait(500); + // Change page title - cy.get('.documentFirstHeading > .public-DraftStyleDefault-block') - .clear() - .type('My Add-on Page') - .get('.documentFirstHeading span[data-text]') - .contains('My Add-on Page'); - - cy.get('.documentFirstHeading > .public-DraftStyleDefault-block').type( - '{enter}', - ); + cy.get('[contenteditable=true]').first().clear(); + + cy.get('[contenteditable=true]').first().type('My Add-on Page'); + + cy.get('.documentFirstHeading').contains('My Add-on Page'); + + cy.get('[contenteditable=true]').first().type('{enter}'); // Add block cy.get('.ui.basic.icon.button.block-add-button').first().click(); diff --git a/cypress/support/index.js b/cypress/support/index.js index a3fd9352..89aab004 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -44,7 +44,7 @@ export const setupBeforeEach = () => { cy.waitForResourceToLoad('@types'); cy.waitForResourceToLoad('my-page'); cy.navigate('/cypress/my-page/edit'); - cy.get(`.block.title [data-contents]`); + cy.get(`.block.title h1`); }; export const tearDownAfterEach = () => { diff --git a/package.json b/package.json index 07b7404f..e068aa04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-tabs-block", - "version": "1.2.7", + "version": "1.2.8", "description": "volto-tabs-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team",