feat(cypress): generate test reports
Type of Change
- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [x] CI/CD
Description
This PR adds configs and commands to generate test reports. Reports are generated automatically after the test is run.
File format will be:
- Screenshots:
[<connector_name>] <screenshot_name> (failed).png - Reports:
- If
reportNameis passed explicitly as a variable:<connector_name>_report_<hyperswitch_version>.html<connector_name>_report_<hyperswitch_version>.json
- If
reportNameis not passed explicitly as a variable:<connector_name>_report.html<connector_name>_report.json
- If
Additional Changes
- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables
Motivation and Context
This is a P0 requirement that notifies people of tests that are failing with reports. At present, we only get to know that the specific test is failed, but no one that I know is bothered to care about just because it is still immature.
With this change, we should see test reports being generated and served right to us after the tests are run.
How did you test it?
Once the test run, below is format in which the reports get generated:
When the tests are running:
After generation of report is completed:
Above mentioned commands merge these reports into one:
| Side panel | Main window |
|---|---|
Embedded Screenshots:
In order for Embedded Screenshots to work https://github.com/juspay/hyperswitch/pull/5563/files#diff-5c94114f761905519a09ff1393545cfed7d2c7399079736b6c3c34cc64f03cd6 was removed with commit 67c014e (#5563)
Checklist
- [x] I formatted the code
prettier . --write - [ ] I addressed lints thrown by
cargo clippy - [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
@pixincreate Can you add the version name in the test report ?
Addition of x-request-id to reports will be taken as a separate PR.