Qiskit / qiskit.org

The Qiskit official website
https://qiskit.org
Apache License 2.0
101 stars 108 forks source link

Add component test to components and pages #3383

Closed paaragon closed 9 months ago

paaragon commented 1 year ago

Feature description

Why

With unit test we can make sure that a particular logic works correctly but we may miss other higher level features.

To do that, we can use E2E test but component test can make the development easier and test each component separatedly.

Tools

We can use Cypress as it is a dedicated library with a very widespread use.

Additional context

No response

techtolentino commented 1 year ago

Just noting that we've used Cypress in Platypus, and it was pretty good...

We could see what @abdonrd @yoshiemuranaka recommend, based on any UI/component testing they do in their project.

yoshiemuranaka commented 1 year ago

We are using playwright for e2e testing. I wish we documented the reason we decided playwright over cypress, but cannot find anything recorded. I think it was because it is also what Nuxt uses under the hood

jackoconnordev commented 1 year ago

I did a bit of reading comparing Cypress and Playwright today. The website is fully static (right?) so the tests don't need any complicated session managment so I imagine both libraries can easily handle the use case.

Playwright allows tests to be run in parallel out of the box, whereas for Cypress tests to be run in parallel requires paid access to their Cypress Cloud. (https://www.cypress.io/cloud/#smart_orchestration). In theory every end to end test could be run in parallel because it's a static site so it could it be nice to have access to this feature to save time.

Having said this the platypus Cypress tests seem to take about 8 mins to for a single run which for automation is fine (although maybe annoying locally?). I like the interactive experience that comes with Cypress but I haven't used playwright though so maybe it's similar with being able to watch each step of tests happen in real time.

y4izus commented 9 months ago

Since we are not adding more features to this project, we can close this issue