Skip to content

Commit

Permalink
Merge pull request #4 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
GhitaB authored Jan 10, 2023
2 parents 090cd0a + 9713c11 commit 9ffbac7
Show file tree
Hide file tree
Showing 37 changed files with 4,454 additions and 248 deletions.
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [1.1.0](https://github.com/eea/cca-frontend/compare/1.0.0-alpha.2...1.1.0) - 10 January 2023

#### :rocket: Dependency updates


#### :hammer_and_wrench: Others

- Retry tests [Ghiță Bizău - [`6277ded`](https://github.com/eea/cca-frontend/commit/6277ded4f383027559d3b6fb3949f88b298a660e)]
- Refs #158294 - Temporarily disable faulty cypress. [GhitaB - [`0545119`](https://github.com/eea/cca-frontend/commit/054511915a811bd64cfe3134be9b4eeff330d053)]
- Refs #158294 - Remove block columns test. [GhitaB - [`4e5e4cc`](https://github.com/eea/cca-frontend/commit/4e5e4cc6552f6e60c386838da99128fb8e4f1c08)]
- Refs #158294 - Remove block basics test. [GhitaB - [`fa00c54`](https://github.com/eea/cca-frontend/commit/fa00c544ee5eecc9e04d2bea8360fd2c91b43036)]
- Update package version in resolutions [kreafox - [`dd63f69`](https://github.com/eea/cca-frontend/commit/dd63f6967f257506ee6750b43066c50e96a400a1)]
- Refs #158294 - Upgrade dependencies. [GhitaB - [`1ea88e2`](https://github.com/eea/cca-frontend/commit/1ea88e275a3852645ef0448cac875009c31f41bc)]
- Add tests from demo-kitkat [valentinab25 - [`5fd6861`](https://github.com/eea/cca-frontend/commit/5fd686115047743eff21c29b6dfbff86ad4f7510)]
### [1.0.0-alpha.2](https://github.com/eea/cca-frontend/compare/1.0.0-alpha.1...1.0.0-alpha.2) - 19 December 2022

#### :rocket: Dependency updates


#### :hammer_and_wrench: Others

### [1.0.0-alpha.1](https://github.com/eea/cca-frontend/compare/0.1.1...1.0.0-alpha.1) - 13 December 2022

### [0.1.1](https://github.com/eea/cca-frontend/compare/0.1.0...0.1.1) - 13 December 2022

### 0.1.0 - 13 December 2022

#### :rocket: Dependency updates


#### :hammer_and_wrench: Others

- Added volto-cca-policy to package.json dependencies [laszlocseh - [`cb422a2`](https://github.com/eea/cca-frontend/commit/cb422a26d00e8ca75799fa3115edf5c3ec6a90c8)]
- Use seamless mode [Tiberiu Ichim - [`b7c12b1`](https://github.com/eea/cca-frontend/commit/b7c12b1fed0f222db1bf6aaed8de939563f58d42)]
- Adjustments [Tiberiu Ichim - [`9d3272c`](https://github.com/eea/cca-frontend/commit/9d3272c70ee9c54a32e2497a28c067e7a1dd7f30)]
- Don't need entrypoint override [Tiberiu Ichim - [`8d15a3d`](https://github.com/eea/cca-frontend/commit/8d15a3d95a959d3827bb6497b40ca750e8c5251c)]
- Don't need entrypoint override [Tiberiu Ichim - [`49c92ff`](https://github.com/eea/cca-frontend/commit/49c92ffdfcebe8217405a7e94bf45cfd7f0d1c49)]
- Use laszlo's prepared image [Tiberiu Ichim - [`4da1d46`](https://github.com/eea/cca-frontend/commit/4da1d46d417423b888320fe7c51c76a5c36dd6b2)]
- Move entrypoint to override [Tiberiu Ichim - [`5175502`](https://github.com/eea/cca-frontend/commit/51755025ef0d4205e15c48bb16840ef1852b7bcc)]
- Add override example [Tiberiu Ichim - [`220abba`](https://github.com/eea/cca-frontend/commit/220abba4896398bb6ad57eb44b955bad609b3d6f)]
- Add submodule [Tiberiu Ichim - [`6331347`](https://github.com/eea/cca-frontend/commit/63313471a1ffad2b12c580a1c6710adcfe3df700)]
- Add memcached [Tiberiu Ichim - [`57f9e72`](https://github.com/eea/cca-frontend/commit/57f9e729ab26b14167b50092b4dbdb0f3e2e5843)]
- Improve docker-compose.yml; bring in theme.js [Tiberiu Ichim - [`2749c30`](https://github.com/eea/cca-frontend/commit/2749c300bcfe5e7101cb373e8d15f6bfda317f15)]
- Set develop [Tiberiu Ichim - [`275e22e`](https://github.com/eea/cca-frontend/commit/275e22e9193f5734a8de43402040212e8ee93dcf)]
- Add volto-eea-website-theme [Tiberiu Ichim - [`c65de81`](https://github.com/eea/cca-frontend/commit/c65de814e6b3c2317e1f6f7f1ec0da5b94dbb00a)]
- Load eea-website-theme [Tiberiu Ichim - [`ae2f0ef`](https://github.com/eea/cca-frontend/commit/ae2f0ef3f8956985d723db5929ea9a70ded63fac)]
- WIP [Tiberiu Ichim - [`da4f9c2`](https://github.com/eea/cca-frontend/commit/da4f9c2f41c11f84a957edc7998f62a3f5473e8d)]
- Fix package name [Tiberiu Ichim - [`ce64abf`](https://github.com/eea/cca-frontend/commit/ce64abfa87acdf469fbca4ec507b755d8e4332d1)]
- Packaging [Tiberiu Ichim - [`67c4453`](https://github.com/eea/cca-frontend/commit/67c4453fe807dd45dc6b976af0dee01273d6db61)]
- Add volto-cca-policy [Tiberiu Ichim - [`dc64f95`](https://github.com/eea/cca-frontend/commit/dc64f95c1a9251e8821ec670d62e6a9990a73d7a)]
- Add files from eea-website-frontend [Tiberiu Ichim - [`4ab479d`](https://github.com/eea/cca-frontend/commit/4ab479d233bb205dcf3667bcf04d1d05d3bcbe2c)]
- Run yo @plone/volto [Tiberiu Ichim - [`d0dba33`](https://github.com/eea/cca-frontend/commit/d0dba337c223d029096de2e590837d9e37719938)]
- Clear repo, bootstrap is junk [Tiberiu Ichim - [`364f401`](https://github.com/eea/cca-frontend/commit/364f4011054ba0c09b0aa11898e9fd216d224753)]
- Initial commit [Tiberiu Ichim - [`f13b58d`](https://github.com/eea/cca-frontend/commit/f13b58d89c3b08814cc18197cb3f5ef42025a67d)]
143 changes: 76 additions & 67 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,76 +15,85 @@ pipeline {

stages {

stage('Integration tests') {
parallel {
stage('Cypress') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
not { branch 'master' }
not { changelog '.*^Automated release [0-9\\.]+$' }
not { buildingTag() }
}
}
steps {
node(label: 'docker') {
script {
try {
sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-eeacms-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
sh '''docker pull eeacms/volto-project-ci; docker run -i --name="$BUILD_TAG-cypress-eeacms" --link $BUILD_TAG-plone-eeacms:plone -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" eeacms/volto-project-ci'''
// stage('Integration tests') {
// parallel {
// stage('Cypress') {
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// not { branch 'master' }
// not { changelog '.*^Automated release [0-9\\.]+$' }
// not { buildingTag() }
// }
// }
// steps {
// node(label: 'docker') {
// script {
// try {
// sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
// sh '''docker pull eeacms/volto-project-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" eeacms/volto-project-ci'''

// sh '''docker pull eeacms/eea-website-backend; docker run --rm -d --name="$BUILD_TAG-plone-eeacms" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/eea-website-backend'''
// sh '''docker pull eeacms/volto-project-ci; docker run -i --name="$BUILD_TAG-cypress-eeacms" --link $BUILD_TAG-plone-eeacms:plone -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" eeacms/volto-project-ci'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results'''
sh '''mkdir -p cypress-reports cypress-results'''
sh '''docker cp $BUILD_TAG-cypress-eeacms:/opt/frontend/my-volto-project/cypress/videos cypress-reports/'''
sh '''docker cp $BUILD_TAG-cypress-eeacms:/opt/frontend/my-volto-project/cypress/reports cypress-results/'''
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#^node_modules/volto-slate/##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
}
finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
}
sh script: "docker stop $BUILD_TAG-plone-eeacms", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-plone-eeacms", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-cypress-eeacms", returnStatus: true
}
}
}
}
}
}
// } finally {
// try {
// sh '''rm -rf cypress-reports cypress-results'''
// sh '''mkdir -p cypress-reports cypress-results'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/videos cypress-reports/'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/reports cypress-results/'''
// coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/coverage cypress-coverage/''', returnStatus: true
// if ( coverage == 0 ) {
// publishHTML (target : [allowMissing: false,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: 'cypress-coverage/coverage/lcov-report',
// reportFiles: 'index.html',
// reportName: 'CypressCoverage',
// reportTitles: 'Integration Tests Code Coverage'])
// }
//
// 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
// }
// finally {
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
// }
// sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
// }
// }
// }
// }
// }
// }


stage("Docker test build") {
when {
allOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'master'
}
}
environment {
IMAGE_NAME = BUILD_TAG.toLowerCase()
}
steps {
node(label: 'docker-host') {
script {
checkout scm
try {
dockerImage = docker.build("${IMAGE_NAME}", "--no-cache .")
} finally {
sh script: "docker rmi ${IMAGE_NAME}", returnStatus: true
}
}
}
}
}
}
}
// stage("Docker test build") {
// when {
// allOf {
// not { changelog '.*^Automated release [0-9\\.]+$' }
// not { environment name: 'CHANGE_ID', value: '' }
// environment name: 'CHANGE_TARGET', value: 'master'
// }
// }
// environment {
// IMAGE_NAME = BUILD_TAG.toLowerCase()
// }
// steps {
// node(label: 'docker-host') {
// script {
// checkout scm
// try {
// dockerImage = docker.build("${IMAGE_NAME}", "--no-cache .")
// } finally {
// sh script: "docker rmi ${IMAGE_NAME}", returnStatus: true
// }
// }
// }
// }
// }
// }
// }


stage('Pull Request') {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,4 @@ See [LICENSE.md](https://github.com/eea/eea-website-backend/blob/master/LICENSE.
## Funding

[European Environment Agency (EU)](http://eea.europa.eu)

52 changes: 52 additions & 0 deletions cypress/e2e/01-block-group.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { slateBeforeEach, slateAfterEach } from '../support/e2e';

describe('Blocks Tests', () => {
beforeEach(slateBeforeEach);
afterEach(slateAfterEach);

it('Add Block: Empty', () => {
// Change page title
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');

cy.get('.documentFirstHeading').contains('My Add-on Page');

cy.getSlate().click();

// Add block
cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Common').click();
cy.get('.content.active.common .button.group')
.contains('Section (Group)')
.click({ force: true });

cy.get('.block-editor-group [contenteditable=true]')
.focus()
.click()
.type('test{enter}');
cy.get('.block-editor-group [contenteditable=true]')
.eq(1)
.focus()
.click()
.type('test2{enter}');
cy.get('.block-editor-group [contenteditable=true]')
.eq(2)
.focus()
.click()
.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();
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');

// then the page view should contain our changes
cy.contains('My Add-on Page');
cy.contains('test2');
});
});
40 changes: 40 additions & 0 deletions cypress/e2e/01-block-slate-metadata-mentions.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { slateBeforeEach, slateAfterEach } from '../support/e2e';

describe('Block Tests: Metadata', () => {
beforeEach(slateBeforeEach);
afterEach(slateAfterEach);

it('As editor I can add metadata mentions', function () {
// Complete chained commands
cy.getSlateEditorAndType('Colorless green ideas sleep furiously.');

// Metadata mention
cy.setSlateSelection('Colorless', 'green');
cy.clickSlateButton('Metadata');

cy.get('.sidebar-container div[id="field-metadata"]')
.type('Publishing Date{enter}');
cy.get('.sidebar-container .form .header button:first-of-type').click();

// Remove link
cy.setSlateSelection('Colorless')
.setSlateSelection('green');
cy.clickSlateButton('Remove metadata');

// Re-add link
cy.setSlateSelection('green', 'sleep');
cy.clickSlateButton('Metadata');

cy.get('.sidebar-container div[id="field-metadata"]')
.type('Summary{enter}');
cy.get('.sidebar-container [id="blockform-fieldset-metadata"] [id="field-description"]')
.type('blue cats sleep');
cy.get('.sidebar-container .form .header button:first-of-type').click();

// Save
cy.toolbarSave();

// then the page view should contain a link
cy.contains('Colorless blue cats sleep furiously.');
});
});
75 changes: 75 additions & 0 deletions cypress/e2e/01-block-tabs.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { slateBeforeEach, slateAfterEach } from '../support/e2e';

describe('Blocks Tests', () => {
beforeEach(slateBeforeEach);
afterEach(slateAfterEach);

it('Add Block: Empty', () => {
// Change page title
cy.clearSlateTitle();
cy.getSlateTitle().type('My Add-on Page');

cy.get('.documentFirstHeading').contains('My Add-on Page');

cy.getSlate().click();

// 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.getSlate().click();

cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Common').click();
cy.get('.content.active.common .button.tabs_block')
.contains('Tabs')
.click({ force: true });

cy.get('.field-wrapper-title input').last().type('Tab 1');
cy.get('.field-wrapper-template #field-template').click();
cy.get('.react-select__menu').contains('Default').click();
cy.get('.field-wrapper-verticalAlign #field-verticalAlign').click();
cy.get('.react-select__menu').contains('Middle').click();

cy.get('.field-wrapper-menuAlign #field-menuAlign').click();
cy.get('.react-select__menu').contains('Left').click();
cy.get('.field-wrapper-menuPosition #field-menuPosition').first().click();
cy.get('.react-select__menu').contains('Top').click();

cy.get('.tabs-block [contenteditable=true]').first().type('Hydrogen');
cy.get('.tabs-block .ui.left.menu .item').last().click();
cy.get('.tabs-block').contains('Tab 2').click();
cy.get('.tabs-block.edit [contenteditable=true]').first().type('Oxygen');

cy.getSlate().click();
cy.get('.ui.basic.icon.button.block-add-button').first().click();
cy.get('.blocks-chooser .title').contains('Common').click();
cy.get('.content.active.common .button.tabs_block')
.contains('Tabs')
.click({ force: true });

cy.get('.field-wrapper-template #field-template').click();
cy.get('.react-select__menu').contains('Carousel horizontal').click();
cy.get('.field-wrapper-verticalAlign #field-verticalAlign').click();
cy.get('.react-select__menu').contains('Bottom').click();
cy.get('.field-wrapper-theme #field-theme').click();
cy.get('.react-select__menu').contains('Dark').click();
cy.get('.tabs-block .ui.menu .item').last().click();
cy.get('.tabs-block .ui.menu .item').eq(1).click();

// Save
cy.get('#toolbar-save').click();
cy.url().should('eq', Cypress.config().baseUrl + '/cypress/my-page');

// then the page view should contain our changes
cy.contains('My Add-on Page');
cy.contains('Hydrogen');

cy.get('.tabs-block p').contains('Tab 2').click();
cy.contains('Oxygen');

cy.get('.slick-arrow').click();
cy.get('.block.image');
});
});
Loading

0 comments on commit 9ffbac7

Please sign in to comment.