add deleted user and not registered user scenarios to e2e password reset feature

This commit is contained in:
mahula 2023-06-26 13:55:45 +02:00
parent 5963ebb6a1
commit ba98797009
2 changed files with 38 additions and 6 deletions

View File

@ -2,13 +2,27 @@ Feature: User Authentication - reset password
As a user
I want to reset my password from the sign in page
# TODO for these pre-conditions utilize seeding or API check, if user exists in test system
# Background:
# Given the following "users" are in the database:
# | email | password | name |
# | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz |
Scenario: Reset password as not registered user
Given the user navigates to page "/login"
And the user navigates to the forgot password page
When the user enters the e-mail address "not@registered.com"
And the user submits the e-mail form
Then the user receives no password reset e-mail
Scenario: Reset password as deleted user
# Given the following "users" are in the database:
# | email | password | name |
# | stephen@hawking.uk | Aa12345_ | Stephen Hawking |
Given the user navigates to page "/login"
And the user navigates to the forgot password page
When the user enters the e-mail address "stephen@hawking.uk"
And the user submits the e-mail form
Then the user receives no password reset e-mail
Scenario: Reset password from signin page successfully
# Given the following "users" are in the database:
# | email | password | name |
# | raeuber@hotzenplotz.de | Aa12345_ | Räuber Hotzenplotz |
Given the user navigates to page "/login"
And the user navigates to the forgot password page
When the user enters the e-mail address "raeuber@hotzenplotz.de"
@ -23,3 +37,6 @@ Feature: User Authentication - reset password
And the user cannot login
But the user submits the credentials "raeuber@hotzenplotz.de" "12345Aa_"
And the user is logged in with username "Räuber Hotzenplotz"

View File

@ -51,6 +51,21 @@ Then('the user receives an e-mail containing the {string} link', (linkName: stri
)
})
Then('the user receives no password reset e-mail', () {
cy.origin(
Cypress.env('mailserverURL'),
{ args: { userEMailSite } },
({ userEMailSite }) => {
cy.visit('/')
cy.get(userEMailSite.emailInbox).should('be.visible')
cy.get(userEMailSite.emailList)
.find('.email-item')
.should('have.length', 0)
}
)
})
When('the user opens the {string} link in the browser', (linkName: string) => {
cy.task('getEmailLink').then((emailLink) => {
cy.visit(emailLink)