-
Notifications
You must be signed in to change notification settings - Fork 389
test [M3-9256]: display cypress test results in html report #11795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test [M3-9256]: display cypress test results in html report #11795
Conversation
|
Coverage Report: ✅ |
mjac0bs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this @dmcintyr-akamai. Will let Joe comment on anything specific to the Cypress set up.
Confirmed the HTML report was output in the specified spot when I ran:
pnpm cy:e2e -s "cypress/e2e/core/kubernetes/lke-create.spec.ts"
| ✅ | Purposely triggered a failure to see what it'd look like |
|---|---|
![]() |
![]() |
I'm not sure that cy:e2e as the command is the most intuitive name to know that it generates the HTML report. Some brief documentation of this in our developer docs End-to-End tests section may help?
…akamai/manager into M3-9256_cypress-html-reporting
|
reverting back to draft so i can insert code for demo |
jdamore-linode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done David! I know this is still in draft, happy to take a look if you make any other changes but this looks great
…akamai/manager into M3-9256_cypress-html-reporting
Cloud Manager UI test results🔺 1 failing test on test run #52 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: pnpm cy:run -s "cypress/e2e/core/account/account-logout.spec.ts" |
|||||||||||||||||


Description 📝
Display the cypress test results in an html document. Added cypress-mochawesome-reporter plugin to enable this. The report looks nice and organized:

This task uncovered an existing, known issue w/ cypress where cypress does not allow multiple plugins to listen for the "before:run" and "after:run" hooks, the last plugin to register for the listeners wins. So i added another package as a workaround (cypress-on-fix) which allows an array of listeners for the same event.
Additionally, cypress has a limitation where only a single reporter is allowed, so i used the 'cypress-multi-reporters' package as a workaround to enable multiple reporters. If I don't add this package, then the html reporter would replace the junit reporter.
Adding the additional reporter involved touching the "component" report as well, so it was easier to refactor this. I also removed the configure-test-suite.ts plugin bc it was no longer being used.
Changes 🔄
When running the "cypress:e2e" command, it creates an html report that displays the test results. This content is not added to source control.
Reproduction steps
The junit reporter requires the CY_TEST_JUNIT_REPORT environmental variable to set set to a truthy value:
CY_TEST_JUNIT_REPORT='1'
The html reporter requires the CY_TEST_HTML_REPORT environmental variable to set set to a truthy value:
CY_TEST_HTML_REPORT='1'
For the html report to be enabled in the Jenkins CI pipeline, the CY_TEST_HTML_REPORT will need to be set in the jenkins-ui-library repo (in vars/testManager.groovy and perhaps other groovy files).
To run the e2e report:
pnpm run cy:e2e
To run the component report:
pnpm run cy:component:run
Both commands will result in the html report being created at packages/manager/cypress/reports/html/index.html. The junit report will be at packages/manager/cypress/results/test-results-.xml.
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅