Skip to content

Extract commonly used test logic to commands

What

This PR extracts a lot of the commonly used logic into Cypress commands.

  • cy.resetState() to reset the instance database and IndexedDB
  • cy.registerUser(username, password, isAdmin) to create a (admin) user
  • cy.login(username, password) to log in a user

Why

This reduces code duplication, especially considering we want to write more tests in the future, which require a lot of the same setup code in the beginning.

Additional info (optional)

Not every instance of logging in users or registering them has been replaced. I only replace them in before/after{Each} hooks because if we specifically test if registering/logging in works, that should not be hidden behind an abstraction.

Tests currently fail after a fixed point because the sign-in limiter kicks in, this is already being discussed in #7986 (closed).

Merge request reports

Loading