Merge branch 'master' into message-type-admin-frontend

This commit is contained in:
mahula 2023-06-30 10:50:18 +02:00 committed by GitHub
commit c9e4d09c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -55,6 +55,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.wait(300)
cy.get(userEMailSite.emailInbox).should('be.visible')
cy.get(userEMailSite.emailList).then(($emailList) => {
const emailItems = $emailList.find('.email-item')
if (emailItems.length > 0) {
expect(emailItems.filter(`:contains("asswor")`).length).to.equal(0)
}
})
})
})
When(
'the user receives the transaction e-mail about {string} GDD from {string}',
(amount: string, senderName: string) => {