Skip to content

Commit ffec77b

Browse files
Enhance Forgot Password flow and UI feedback
- Added a step to present the reset password request sent screen in the feature file. - Adjusted the sequence of actions in the test runner for better flow. - Implemented a new method to verify the reset password request sent screen. - Introduced an HTML element for displaying user messages in the UI.
1 parent 24f53f6 commit ffec77b

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

SecurityService.OpenIdConnect.IntegrationTests/ForgotPassword/ForgotPassword.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Scenario: Forgot Password
3939
When I enter my username 'estateuser@testestate1.co.uk'
4040
And I enter my email address 'estateuser@testestate1.co.uk'
4141
And I click on the Reset Password button
42+
Then I am presented with the reset password request sent screen
4243
Then I get an email with a forgot password link
4344
When I navigate to the forgot password link
4445
Then I am presented with the reset password screen

SecurityService.OpenIdConnect.IntegrationTests/ForgotPassword/ForgotPassword.feature.cs

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SecurityService.OpenIdConnect.IntegrationTests/ForgotPassword/ForgotPasswordSteps.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ public async Task ThenIAmPresentedWithTheResetPasswordScreen()
112112
resetPasswordButton.ShouldNotBeNull();
113113
}
114114

115+
[Then("I am presented with the reset password request sent screen")]
116+
public async Task ThenIAmPresentedWithTheResetPasswordRequestSentScreen()
117+
{
118+
IWebElement resetPasswordLabel = this.WebDriver.FindElement(By.Id("forgotPasswordMessage"));
119+
await Retry.For(async () => {
120+
resetPasswordLabel.ShouldNotBeNull();
121+
});
122+
}
123+
124+
115125
[When(@"I enter my new password '([^']*)'")]
116126
public void WhenIEnterMyNewPassword(string newpassword)
117127
{

SecurityService.UserInterface/Pages/Account/ForgotPassword/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</div>
3535
}
3636
else {
37-
<p>@Model.View.UserMessage</p>
37+
<p id="forgotPasswordMessage">@Model.View.UserMessage</p>
3838
}
3939
</div>
4040
</div>

0 commit comments

Comments
 (0)