Skip to content

E2E test improvements #1143

@jescalada

Description

@jescalada

Is your feature request related to a problem? Please describe.
We could improve our Cypress tests in various ways, including:

Describe the solution you'd like

Aliasing long component IDs

Some of the latest tests added are comprehensive, but a bit hard to read and brittle in the sense that changes on the components themselves may require lots of changes to fix the tests. An initial solution to this would be aliases on the component IDs, so that we only need to change the Cypress check in one place:

cy.get('[data-testid="repo-list-view"]').as('repoList');
cy.get('@repoList').find('[data-testid="add-repo-button"]');  

Database seed/cleanup functions

We could have cy.seedDb(), cy.cleanUp() functions to make sure all E2E tests have the required data before running (via API calls). A good idea is to seed with data that we know won't be present normally and then delete it after the E2E tests.

A suggestion by @andypols which comes in handy here:

[...] I just needed a user to test with, so I used the existing mechanism (#1022). Personally, I prefer having a dedicated testing service that can create and delete test users, repos, etc., so you can use something like cy.ensureUserExists(email, isAdmin, ...) for setup. That way, it's behaviorally separate from the app itself and doesn't depend on anything needing to be run first.

Removing dependencies with regular unit tests

See #978 for context.

Describe alternatives you've considered
None

Additional context
Related #978

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions