Skip to content

Cypress E2E tests need some refactoring #493

@mario-nt

Description

@mario-nt

Some of the E2E tests have the same code for the registration and login of users:

let registration_form: RegistrationForm;

  before(() => {
    registration_form = random_user_registration_data();
    cy.register_as_admin_and_login(registration_form);
  });

  after(() => {
    cy.delete_user_from_database(registration_form.username);
  });

We should refactor that code so we follow Cypress's best practices. The code in the after() hook, which should be executed before any tests, because if a test fails, the after() hook will never be executed.

Also all the logic regarding the signup and login of the users could be moved to a Cypress task or to a beforeAll() hook to name a couple of options.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions