Skip to content
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

Cypress + Axe testing #35

Closed
rluders opened this issue Apr 18, 2022 · 6 comments · Fixed by #85
Closed

Cypress + Axe testing #35

rluders opened this issue Apr 18, 2022 · 6 comments · Fixed by #85
Labels
testing Improve project test coverage
Projects

Comments

@rluders
Copy link
Collaborator

rluders commented Apr 18, 2022

Is your feature request related to a problem? Please describe.
I believe that is important for us to have some automated tests. Since we do have the docs pages it should not be complicated to test the behaviors of the components. The test must cover usability and accessibility.

Describe the solution you'd like

  • Install Cypress
  • Install Axe
  • Create at least ONE example test

Describe alternatives you've considered
I don't know any alternative.

Additional context
The Sumé LMS frontend already has those tests on it, maybe it would be easy to just bring them to this repository. Also, there is this guide, that can be useful.

@rluders rluders added the testing Improve project test coverage label Apr 18, 2022
@bacali95 bacali95 added this to To do in Development Apr 19, 2022
@tulup-conner
Copy link
Collaborator

tulup-conner commented May 4, 2022

I think Cypress would be fantastic. The Jest DX is inferior, but tests will take longer. Would the plan be to migrate all tests to Cypress? I'm trying to imagine how you would distinguish unit tests from end-to-end in a library like this.

I have day to day experience with Cypress and trying to write unit tests in Jest is making me wish we could just move to Cypress now.

@rluders
Copy link
Collaborator Author

rluders commented May 4, 2022

No, we will not migrate any unit test to Cypress. Both have different proposals.

The plan is to use Cypress + Axe to test the components by interacting with Storybook and the Documentation. By doing it we can also check a11y aspects.

PS: Yeah, I know that we could use Cypress to unit test, but... just no.

@tulup-conner
Copy link
Collaborator

tulup-conner commented May 4, 2022

Ok, what would an example Cypress test actually look like then? I'm a bit confused by that explanation. Would you repeat the behavioral tests of the unit tests, just on the Storybook pages?

Edit: I just want to be able to start writing these so some examples would be nice so I don't go in an undesirable direction with them

@rluders
Copy link
Collaborator Author

rluders commented May 4, 2022

Let me give you one scenario:

Test carousel documentation page

  • Open the documentation page
  • Navigate to the carousel page
  • Check if all examples are correctly being rendered
  • Check if you can interact with the examples

The idea is to mostly test the components' examples by interacting with them through documentation and storybook, to also assure that our examples are working as expected.

Does it make sense?

This is a very, very, very basic scenario since I'm not QE :)

@tulup-conner
Copy link
Collaborator

Yeah that makes perfect sense, you mean to use these purely to test the Storybook/docs pages themselves. I'm silly

@rluders
Copy link
Collaborator Author

rluders commented May 4, 2022

'Cause, by doing it, we are also testing our components and it's the desired behavior. Right? :)

@rluders rluders moved this from To do to In progress in Development May 5, 2022
Development automation moved this from In progress to Done May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Improve project test coverage
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants