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

Investigate Cypress for visual testing in our React package #8145

Closed
joshblack opened this issue Mar 22, 2021 · 1 comment · Fixed by #8282
Closed

Investigate Cypress for visual testing in our React package #8145

joshblack opened this issue Mar 22, 2021 · 1 comment · Fixed by #8282
Assignees
Labels
package: react carbon-components-react

Comments

@joshblack
Copy link
Contributor

Cypress is a tool that has been recommended to us as one that we could use to do visual testing on our components. This issue is for delivering an MVP integration with cypress with ideally one test suite (probably Accordion?) that demonstrates how we could bring this into the project.

This integration should consider the following:

  • How simple is it to author tests?
  • How simple is it for tests to run in CI?
    • Does running cypress dramatically increase CI time?
  • How simple is it to bring in styles for our components?
@joshblack joshblack added the package: react carbon-components-react label Mar 22, 2021
@tay1orjones tay1orjones self-assigned this Mar 24, 2021
@tay1orjones
Copy link
Member

tay1orjones commented Mar 24, 2021

A couple stretch goal items here include

  • @testing-library/cypress could help unify the syntax of jest and cypress tests
  • Evaluation of cypress-real-events for better support of native events including .type(tab), space, esc for testing keyboard navigation
  • Visual regression testing w/ Percy through Cypress.
  • e2e testing guidance in docs/style.md
Rough draft
ComponentName-test.e2e.js
  • These tests are ran with Cypress, which is a bit different in syntax and
    mental model than Jest/JSDOM tests. It's recommended to become familiar with
    the core concepts by reading the
    Cypress introduction documentation.
  • Trigger Events with via cy.real\*();
  • Take snapshots with Percy
    • Percy snapshots should be used sparingly (3-4 per component)
    • Percy snapshots should always be taken after an assertion that a
      element/componen should be visible. This ensures the DOM has settled and the
      element has fully loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: react carbon-components-react
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants