-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
- Developer -Torrust Improvement ExperienceTorrust Improvement ExperienceCode Cleanup / RefactoringTidying and Making NeatTidying and Making Neat
Milestone
Description
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.
josecelano
Metadata
Metadata
Assignees
Labels
- Developer -Torrust Improvement ExperienceTorrust Improvement ExperienceCode Cleanup / RefactoringTidying and Making NeatTidying and Making Neat