diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 726aca86c..1a9891a7a 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -246,13 +246,9 @@ Then( ) Given('my user account has the following login credentials:', table => { - loginCredentials = { - ...loginCredentials, - ...table.hashes()[0] - } - cy.factory().create('User', { - ...loginCredentials - }) + loginCredentials = table.hashes()[0] + cy.debug() + cy.factory().create('User', loginCredentials) }) When('I fill the password form with:', table => { @@ -270,14 +266,23 @@ When('submit the form', () => { }) Then('I cannot login anymore with password {string}', password => { - cy.login({ - ...loginCredentials, - ...{password} - }) - cy.get('.iziToast-wrapper').should('contain', "Incorrect email or password") + cy.reload() + const { email } = loginCredentials + cy.visit(`/login`) + cy.get('input[name=email]') + .trigger('focus') + .type(email) + cy.get('input[name=password]') + .trigger('focus') + .type(password) + cy.get('button[name=submit]') + .as('submitButton') + .click() + cy.get('.iziToast-wrapper').should('contain', 'Incorrect email address or password.') }) Then('I can login successfully with password {string}', password => { + cy.reload() cy.login({ ...loginCredentials, ...{password} diff --git a/cypress/integration/settings/ChangePassword.feature b/cypress/integration/settings/ChangePassword.feature index 936bbed74..44e4e5483 100644 --- a/cypress/integration/settings/ChangePassword.feature +++ b/cypress/integration/settings/ChangePassword.feature @@ -10,22 +10,22 @@ Feature: Change password Background: Given my user account has the following login credentials: - | email | passsword | - | user@example.org | 1234 | + | email | password | + | user@example.org | exposed | And I am logged in Scenario: Change my password Given I am on the "settings" page And I click on "Security" When I fill the password form with: - | Your old password | 1234 | - | Your new passsword | 12345 | - | Confirm new password | 12345 | + | Your old password | exposed | + | Your new passsword | secure | + | Confirm new password | secure | And submit the form And I see a success message: """ - Password updated successfully + Password successfully changed! """ And I log out through the menu in the top right corner - Then I cannot login anymore with password "1234" - But I can login successfully with password "12345" + Then I cannot login anymore with password "exposed" + But I can login successfully with password "secure"