Skip to content

E2E test improvements #1143

Closed
Closed

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

Activity

  1. coopernetes commented on Dec 2, 2025

    @coopernetes
    Contributor

    To add:

    • Database integration testing using in-memory or local (ephemeral) instances of the databases we support such as local Mongodb. As we add more database engines, this will become more and more difficult to manage. Again, I believe a lot of this can be accomplished with a simple refactoring of the various dependent layers between the proxy, service and db layers. It was also written pre-ESM and relied on mutable exports. We should clean this up with some dependency injection or better modularity.
    • Authentication integration testing. Passport has a mock strategy that may be usable if we restructure the authentication layers to pass that in via parameter so that testing becomes simpler.

    There are lot of inter-module calls and imports/exports that make these layers difficult to test. I propose they be refactored to assist with integration & e2e testing.

    E2E testing should always be using a live setup such as what is being proposed via #1165 including real test git repos so we can validate the actual proxying logic instead of relying on excessive mocking.

  2. kriswest commented on Apr 20, 2026

    @kriswest
    Contributor

    Closing to rethink once the refreshed UI is in:

    We're expecting to have to re-vamp the cyprus tests as part of #1507 anyway... and teh new E2E tests are better at a full integration test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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