diff --git a/CHANGELOG.md b/CHANGELOG.md index 39e04b5..1720a22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,15 @@ 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). +#### [4.3.4](https://github.com/eea/volto-group-block/compare/4.3.3...4.3.4) + +- add cy tests [`#16`](https://github.com/eea/volto-group-block/pull/16) + #### [4.3.3](https://github.com/eea/volto-group-block/compare/4.3.2...4.3.3) -- Add SonarQube badges [`bd17cc7`](https://github.com/eea/volto-group-block/commit/bd17cc7542d94a1338f4d47e167704cdd082e452) +> 18 December 2021 + +- Add SonarQube badges [`#15`](https://github.com/eea/volto-group-block/pull/15) #### [4.3.2](https://github.com/eea/volto-group-block/compare/4.3.1...4.3.2) diff --git a/Jenkinsfile b/Jenkinsfile index c8bc05d..f030b43 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -124,7 +124,7 @@ pipeline { node(label: 'docker') { script { try { - sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg''' + sh '''docker pull plone; docker run -d --rm --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg''' sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" plone/volto-addon-ci cypress''' } finally { try { @@ -142,7 +142,8 @@ pipeline { reportName: 'CypressCoverage', reportTitles: 'Integration Tests Code Coverage']) } - archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true + sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done''' + archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true } finally { diff --git a/cypress/integration/block-basics.js b/cypress/integration/block-basics.js index 4daed6d..026bb03 100644 --- a/cypress/integration/block-basics.js +++ b/cypress/integration/block-basics.js @@ -19,8 +19,19 @@ describe('Blocks Tests', () => { // Add block cy.get('.ui.basic.icon.button.block-add-button').first().click(); - cy.get('.blocks-chooser .title').contains('Media').click(); - cy.get('.content.active.media .button.image').contains('Image').click(); + cy.get('.blocks-chooser .title').contains('Common').click(); + cy.get('.content.active.common .button.group').contains('Group').click(); + + cy.get('.block.text.selected').type("test"); + cy.get('.block.text.selected').type("{enter}"); + cy.get('.block.text.selected').type("test2"); + cy.get('.block.text.selected').type("{enter}"); + cy.get('.block.text.selected').type("test3"); + + cy.get('.block-toolbar svg').first() + .trigger('mousedown', { button: 0}) + .trigger('mousemove', 10, -40, { force: true}) + .trigger('mouseup', 10, -40, {force:true}); // Save cy.get('#toolbar-save').click(); @@ -28,6 +39,6 @@ describe('Blocks Tests', () => { // then the page view should contain our changes cy.contains('My Add-on Page'); - cy.get('.block.image'); + cy.contains('test2'); }); }); diff --git a/package.json b/package.json index 64eef9e..8c245f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-group-block", - "version": "4.3.3", + "version": "4.3.4", "description": "volto-group-block: Volto block to be used to group other blocks", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team",