Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ selenium-screenshot-*.png
/selenium/
cypress/videos/
cypress/screenshots
cypress/downloads/

# Local environment setup
.env
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ 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).

### [2.52.0](https://github.com/eea/eea-website-frontend/compare/2.51.1-beta.1...2.52.0) - 18 November 2025

#### :rocket: Dependency updates

- Release @eeacms/volto-plotlycharts@13.3.5 [valentinab25 - [`879a252`](https://github.com/eea/eea-website-frontend/commit/879a252658bf83bcacec2936c22e7191aa28121f)]
- Release @eeacms/volto-plotlycharts@13.3.4 [EEA Jenkins - [`fc3b700`](https://github.com/eea/eea-website-frontend/commit/fc3b7002b0755ec24021b3d65992682c9b5f87ce)]

### [2.51.1-beta.1](https://github.com/eea/eea-website-frontend/compare/2.51.0...2.51.1-beta.1) - 13 November 2025

#### :hammer_and_wrench: Others

- Release 2.51.1-beta.1 - refs #293749 [Alin Voinea - [`c58b935`](https://github.com/eea/eea-website-frontend/commit/c58b93566c30027bb3c6ce684597b10159d10f49)]
- tests: Enable tests to run on critical site paths on staging after running the upgrade step - refs #278807 [Teodor Voicu - [`a35c806`](https://github.com/eea/eea-website-frontend/commit/a35c8069e50994d7b2dbf3d7f380ea2b9562c439)]
### [2.51.0](https://github.com/eea/eea-website-frontend/compare/2.50.0...2.51.0) - 6 November 2025

#### :rocket: Dependency updates
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ pull: ## Run git pull on all src/addons
test: ## Run Jest tests for Volto add-on
RAZZLE_JEST_CONFIG=$(filter-out $@,$(MAKECMDGOALS))/jest-addon.config.js yarn test $(filter-out $@,$(MAKECMDGOALS))

.PHONY: cypress
cypress: ## Run Cypress acceptance tests (uses baseUrl from cypress.config.js)
yarn cypress:run

.PHONY: cypress-open
cypress-open: ## Open Cypress interactive test runner
yarn cypress:open

.PHONY: cypress-staging
cypress-staging: ## Run Cypress tests against staging
CYPRESS_BASE_URL=https://staging.eea.europa.eu/en yarn cypress:run

.PHONY: cypress-production
cypress-production: ## Run Cypress tests against production
CYPRESS_BASE_URL=https://www.eea.europa.eu/en yarn cypress:run

.PHONY: cypress-local
cypress-local: ## Run Cypress tests against localhost:3000
CYPRESS_BASE_URL=http://localhost:3000 yarn cypress:run

.PHONY: help
help: ## Show this help.
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
Expand Down
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,51 @@ Trainings on how to create your own website using Plone 6 is available as part o

See [Plone 6 backend for EEA Main website](https://github.com/eea/eea-website-backend/tree/master/develop)

## Testing

### Acceptance tests

The project uses [Cypress](https://www.cypress.io/) for acceptance testing. The tests are located in `cypress/e2e/` directory.

#### Running tests

You can run Cypress tests using either yarn scripts or Makefile commands:

**Using Makefile (recommended):**

```bash
make cypress # Run tests against default environment (staging)
make cypress-open # Open Cypress interactive UI
make cypress-staging # Run tests against staging
make cypress-production # Run tests against production
make cypress-local # Run tests against localhost:3000
```

**Using yarn:**

```bash
yarn cypress:run # Run tests in headless mode
yarn cypress:open # Open Cypress interactive UI
```

**Running against a custom URL:**

You can override the base URL by setting the `CYPRESS_BASE_URL` environment variable:

```bash
CYPRESS_BASE_URL=https://demo-www.eea.europa.eu/en yarn cypress:run
```

or using the `--config` flag:

```bash
yarn cypress:run --config baseUrl=https://demo-www.eea.europa.eu/en
```

#### Test configuration

The Cypress configuration is located in `cypress.config.js`. By default, tests run against the staging environment (`https://staging.eea.europa.eu/en`).

## Release

### Automatic release using Jenkins
Expand Down
27 changes: 27 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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
require('@cypress/code-coverage/task')(on, config);
require('cypress-fail-fast/plugin')(on, config);
return config;
},
baseUrl: 'https://staging.eea.europa.eu/en',
},
});
22 changes: 0 additions & 22 deletions cypress.json

This file was deleted.

124 changes: 124 additions & 0 deletions cypress/e2e/acceptance.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
describe('EEA website acceptance tests', () => {
beforeEach(() => {
cy.visit('/');
Cypress.on('uncaught:exception', (err, runnable) => {
// Prevent Cypress from failing on uncaught exceptions
// This is useful for testing third-party integrations or legacy code
// that may throw non-critical errors
// Log the error for debugging purposes
console.error('Uncaught exception:', err.message);
// Return false to prevent the test from failing
return false;
});
});

it('Check subsites dropdown', () => {
cy.get('#theme-sites').click();
// Verify that the dropdown is visible
cy.get('#theme-sites.ui.active.visible.dropdown').should('be.visible');

// Verify that all expected options are present
const expectedOptions = ['European Environment Agency website', 'WISE marine - Marine information system for Europe', 'WISE freshwater - Freshwater information system for Europe', 'BISE - Biodiversity information system for Europe', 'FISE - Forest information system for Europe', 'European Climate and health observatory', 'ClimateADAPT', 'European Industrial Emissions Portal', 'Climate and energy in the EU', 'Copernicus Land Monitoring Service', 'Copernicus InSitu'];

expectedOptions.forEach((option) => {
cy.contains(option).should('exist'); // Verify each option exists
});
});

it('Check if the hero image is loaded', () => {
cy.get('.hero-block-image').then(($div) => {
// Get the background image URL from the inline style
const backgroundImage = $div.css('background-image');

// Extract the URL part from `background-image`
const imageUrl = backgroundImage.replace(/^url\(["']?/, '').replace(/["']?\)$/, '');

// Send a request to the extracted image URL
cy.request(imageUrl).then((response) => {
// Check if the image status is 200 (OK)
expect(response.status).to.eq(200);
});
});
});

it('Check if all main navigation buttons exist', () => {
const expectedButtons = ['Topics', 'Analysis and data', 'Countries', 'Newsroom', 'About us'];

expectedButtons.forEach((buttonText) => {
cy.contains('nav', buttonText).should('exist');
});
});

it('Check if Topics page title and content load', () => {
cy.contains('a', 'Topics').click();
cy.contains('a', 'Topics overview').click();
cy.url().should('include', '/en/topics');
cy.get('img').should('have.length.greaterThan', 0);
cy.scrollTo(0, 1000);

cy.contains('a', 'Agriculture and food system').click({ force: true });
cy.url().should('include', '/en/topics/in-depth/agriculture-and-food');
cy.get('img').should('have.length.greaterThan', 0);
});

it('Test first query result in Publications', () => {
cy.visit('/');
cy.contains('a', 'Analysis and data').click();
cy.contains('a', 'Publications').click({ force: true });
cy.scrollTo(0, 1000);
cy.get('.listing-item .listing-header').first().find('a').invoke('removeAttr', 'target').click();
cy.get('img').should('have.length.greaterThan', 0);
});

it('Test first query result in Datahub', () => {
cy.visit('/');
cy.contains('a', 'Analysis and data').click();
cy.contains('a', 'Datahub').click({ force: true });
cy.get('.listing-item .listing-header').first().find('a').invoke('removeAttr', 'target').click();
cy.contains('h2', 'Datasets').should('be.visible');
cy.get('.ui.accordion')
.first()
.should('exist')
.then(($accordion) => {
cy.wrap($accordion).click({ force: true });
cy.contains('h5', 'Download:').should('be.visible');
});
});

it('Test first query result in Maps and Charts', () => {
cy.visit('/');
cy.contains('a', 'Analysis and data').click();
cy.contains('a', 'Maps and charts').click({ force: true });
cy.get('a.centered.fluid.image').first().invoke('removeAttr', 'target').click();
cy.get('img').should('have.length.greaterThan', 0);
// const tabs = ['Downloads', 'Data sources', 'Metadata', 'More info'];
// tabs.forEach((tab) => {
// cy.contains('div', tab).should('be.visible');
// });
});

it('Test first query result in Indicators', () => {
cy.visit('/');
cy.contains('a', 'Analysis and data').click();
cy.contains('a', 'Indicators').click({ force: true });
cy.scrollTo(0, 1000);
cy.get('.listing-item').should('be.visible').first().find('a').invoke('removeAttr', 'target').click({ force: true });
cy.get('svg').should('exist');
});

it('Test first query result in Country fact sheets', () => {
cy.visit('/');
cy.contains('a', 'Analysis and data').click();
cy.contains('a', 'Country fact sheets').click({ force: true });
cy.scrollTo(0, 1000);
cy.get('.listing-header').should('be.visible').first().find('a').click({ force: true });
});

it('Test first query result in Countries', () => {
cy.visit('/');
cy.contains('a', 'Countries').click();
cy.contains('a', 'Austria').click({ force: true });
cy.scrollTo(0, 1000);
cy.get('.listing-header').should('be.visible').first().find('a').invoke('removeAttr', 'target').click({ force: true });
});
});
Empty file added cypress/support/e2e.js
Empty file.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "eea-website-frontend",
"description": "EEA Main Website frontend (Plone 6)",
"license": "MIT",
"version": "2.51.0",
"version": "2.52.0",
"scripts": {
"start": "razzle start",
"postinstall": "make omelette && make patches",
Expand Down Expand Up @@ -187,7 +187,7 @@
"@eeacms/volto-eea-website-policy": "2.6.0",
"@eeacms/volto-eea-website-theme": "3.14.0",
"@eeacms/volto-globalsearch": "2.1.2",
"@eeacms/volto-plotlycharts": "13.3.3",
"@eeacms/volto-plotlycharts": "13.3.4",
"@eeacms/volto-redmine-helpdesk": "1.0.0",
"@eeacms/volto-searchlib": "2.1.10",
"@eeacms/volto-tableau": "8.1.5",
Expand Down Expand Up @@ -237,7 +237,7 @@
"@eeacms/volto-embed-static-content": "0.5.1",
"@eeacms/volto-flourish": "0.1.6",
"@eeacms/volto-globalsearch": "2.1.2",
"@eeacms/volto-plotlycharts": "13.3.3",
"@eeacms/volto-plotlycharts": "13.3.5",
"@eeacms/volto-redmine-helpdesk": "1.0.0",
"@eeacms/volto-searchlib": "2.1.10",
"@eeacms/volto-tableau": "8.1.5",
Expand All @@ -248,6 +248,7 @@
"volto-subsites": "4.0.0"
},
"devDependencies": {
"@cypress/code-coverage": "^3.10.0",
"@plone/scripts": "^3.3.2",
"@storybook/addon-actions": "^6.3.0",
"@storybook/addon-controls": "6.3.0",
Expand All @@ -261,6 +262,8 @@
"brotli-webpack-plugin": "1.1.0",
"bundlewatch": "0.3.3",
"compression-webpack-plugin": "10.0.0",
"cypress": "13.1.0",
"cypress-fail-fast": "^5.0.1",
"eslint-plugin-prettier": "3.1.3",
"jest-junit": "8.0.0",
"mrs-developer": "*",
Expand Down
Loading
Loading