The JHipster team always tries to generate code that performs well.
For the backend code you can decide to use Gatling to generate perfomance tests.
Most of the times Matt Raible is doing a lighthouse test for each release manually,
but there is no automated regression testing for a generated application.
When choosing Cypress as end-2-end testing framework one could use cypress-audit to automate the manual lighthouse test.
This will be beneficial to the JHipster development to identify regressions and for JHipster users as they can test the frontend perfomance more easily.
Furthermore cypress-audit supports accessibility testing via Pa11y.
This post describes how to integrate cypress-audit into a JHipster application to execute lighthouse and pa11y testing via GitHub actions.
Create audit specification
After the setup is complete you need to audit the JHipster main page.
Exexute the tests
Start the application in production mode to have the frontend minified and optimized.
Afterwards run the end-2-end tests:
docker-compose -f src/main/docker/postgresql.yml up -d
npm run e2e
This will execute the defined audits and fail if any of the defined thresholds is not met.
The well-known lighthouse html report is created under build/cypress/lhreport.html and can be used see a detailed performance analysis even when all thresholds are met.
Execute on CI
JHipster helps you create a working GitHub actions configuration.
Execute jhipster ci-cd and select GitHub Actions.
This will create a GitHub Action which executes backend, frontend and end-2-end tests.
Cypress audit enabled regression testing and continous frontend performance testing for JHipster applications using the already created cypress test setup.
If you want to try it yourself you find the source code on GitHub.