feat: add password reset feature test (issue #10)

- Add password-reset.feature with 4 scenarios
- Add step definition for password reset page assertion
- Tests access page, valid email request, invalid email, and empty field
This commit is contained in:
2026-04-25 21:14:04 -07:00
parent 39d3250114
commit 58857af5ca
2 changed files with 39 additions and 0 deletions
@@ -0,0 +1,32 @@
Feature: Password Reset
As a user who forgot my password
I want to reset my password
So that I can regain access to my account
@happy-path @authentication @issue-10
Scenario: User can access password reset page
Given I am on the login page
When I click the "Forgot password?" link
Then I should be on the password reset page
And I should see "Reset Password"
@happy-path @authentication @issue-10 @wip
Scenario: User requests password reset with valid email
Given I am on the password reset page
When I fill in "email" with "existing-user@example.com"
And I click the "Send Reset Link" button
Then I should see "Password reset link sent"
And I should see "Check your email"
@negative-test @authentication @issue-10 @wip
Scenario: User requests password reset with invalid email
Given I am on the password reset page
When I fill in "email" with "nonexistent@example.com"
And I click the "Send Reset Link" button
Then I should see an error message
@negative-test @authentication @issue-10 @wip
Scenario: User submits empty email field
Given I am on the password reset page
When I click the "Send Reset Link" button
Then I should see "email is required" error
@@ -223,6 +223,13 @@ Then('I should be on the home page', async function () {
expect(currentUrl).toContain('/'); expect(currentUrl).toContain('/');
}); });
Then('I should be on the password reset page', async function () {
const currentUrl = world.page.url();
console.log(`🌍 Checking current URL: ${currentUrl}`);
expect(currentUrl).toContain('/auth/password-reset');
});
Then('I should be redirected to {string}', async function (path: string) { Then('I should be redirected to {string}', async function (path: string) {
await world.page.waitForLoadState('networkidle'); await world.page.waitForLoadState('networkidle');
const currentUrl = world.page.url(); const currentUrl = world.page.url();