-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include the possibility to test the sending or receiving of emails via mailhog. Additionally, the test for a user import with the password reset enabled has been extended with the mail feature. In addition, a cleanup step for the mails was also added.
- Loading branch information
Showing
8 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
displayname,external,mail,pwdreset,surname,username,givenname | ||
Test Muster,TRUE,[email protected],TRUE,Tester,testUser,Tester | ||
Test Muster,TRUE,[email protected],TRUE,Tester,testUser,Tester |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import '@bahmutov/cy-api' | ||
import {Then} from "@badeball/cypress-cucumber-preprocessor"; | ||
import env from "@cloudogu/dogu-integration-test-library/lib/environment_variables"; | ||
import 'cypress-mailhog'; | ||
|
||
Then("the newly created user is asked to change his password", function () { | ||
cy.get('div[data-testid="login-reset-pw-msg"]').should('be.visible') | ||
|
@@ -437,3 +438,15 @@ Then("the user {string} has his mail updated to {string} and his display name to | |
cy.get('@row').find("td:nth-of-type(2)").contains(displayName) | ||
cy.get('@row').find("td:nth-of-type(3)").contains(mail) | ||
}) | ||
|
||
Then("the user {string} receives an email with his user details", function (username: string) { | ||
cy.mhGetMailsBySender("[email protected]").should('exist') | ||
cy.mhGetMailsBySender("[email protected]").mhFirst().mhGetBody().then((body) => { | ||
expect(body).contains("Benutzername: " + username) | ||
expect(body).contains("Passwort") | ||
}) | ||
}) | ||
|
||
Then("the user is prompted to change the password", function () { | ||
cy.log("Change password!") | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,3 +249,29 @@ When("deletes the entry for the user import", function () { | |
} | ||
}) | ||
}) | ||
|
||
When("the user {string} tries to log in with his generated password", function (username: string) { | ||
cy.mhGetMailsBySender("[email protected]").mhFirst().mhGetBody().then((body) => { | ||
let strings: string[] | ||
strings = body.split(" ") | ||
let password = strings[8] | ||
|
||
cy.clearCookies() | ||
|
||
cy.visit("/" + env.GetDoguName(), {failOnStatusCode: false}) | ||
cy.clickWarpMenuCheckboxIfPossible() | ||
|
||
cy.get('input[data-testid="login-username-input-field"]').type(username) | ||
cy.get('input[data-testid="login-password-input-field"]').type(password) | ||
}) | ||
}) | ||
|
||
When("the user sets the new password to {string}", function (password: string) { | ||
cy.get('input[data-testid="password-input"]').type(password) | ||
cy.get('input[data-testid="confirmedPassword-input"]').type(password) | ||
cy.get('button').find('span').contains("Submit").click() | ||
}) | ||
|
||
When("the user {string} with password {string} logs in", function (username: string, password: string) { | ||
cy.login(username, password, env.GetMaxRetryCount()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters