hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat(cypress): generate test reports

Open pixincreate opened this issue 1 year ago • 1 comments

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 reportName is passed explicitly as a variable:
      • <connector_name>_report_<hyperswitch_version>.html
      • <connector_name>_report_<hyperswitch_version>.json
    • If reportName is not passed explicitly as a variable:
      • <connector_name>_report.html
      • <connector_name>_report.json

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: image

After generation of report is completed: image

Above mentioned commands merge these reports into one:

Side panel Main window
image image

Embedded Screenshots:

image

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 avatar Aug 07 '24 18:08 pixincreate

@pixincreate Can you add the version name in the test report ?

likhinbopanna avatar Aug 09 '24 08:08 likhinbopanna

Addition of x-request-id to reports will be taken as a separate PR.

pixincreate avatar Aug 12 '24 10:08 pixincreate