Skip to content

New: Introduce Cypress for end to end testing of gitlab-ui components

New Pattern Proposal: Introduce Cypress for end to end testing of gitlab-ui components

Currently, we only have unit tests and snapshots in gitlab-ui to test components. Some of them (GlTabs, GlPath, GlFilteredSearch...) cannot be thoroughly tested by relying only on unit tests.

I'd recommend using Cypress, as it's very easy to set up and add tests to. The initial effort would be minimal as we could progressively add end to end tests for new components, and add tests for existing components where we see value for them: https://www.cypress.io/

Cypress also automates taking screenshots and recording videos.

Advantages of new pattern

  1. Test more thoroughly complex components requiring combining multiple smaller components
  2. Increase test coverage and making them more robust

Disadvantages of new pattern

  1. Additional code to write, review and maintain

What is the impact on our existing codebase?

None as this would just be additional code.

POC / test branch

gitlab-org/gitlab-ui!2083 (merged)

Edited by Florie Guibert