forked from ustaxcourt/ef-cms
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish forgot password conversion to gherkin
- Loading branch information
Showing
5 changed files
with
144 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@deleteAllCypressTestAccountsAfter | ||
# @deleteAllCypressTestAccountsAfter | ||
Feature: DAWSON, Client App - Forgot Password | ||
Background: Clear Current Session | ||
Given a clean session | ||
|
@@ -14,10 +14,44 @@ Feature: DAWSON, Client App - Forgot Password | |
And I enter "[email protected]" on forgot password page | ||
Then I should see an alert that a confirmation email was resent | ||
|
||
Scenario: Request a password reset and don't update their password and log in with old password | ||
Scenario: Request a password reset, don't update their password, and log in with old password | ||
Given I create a new petitioner account for "[email protected]" | ||
And I verify my account for "[email protected]" | ||
When I visit forgot password page | ||
And I enter "[email protected]" on forgot password page | ||
And I log into DAWSON as "cypress_test_account+confirmed" | ||
Then I should see the petitioner dashboard | ||
|
||
Scenario: Request a password reset, update password, and log in with new password | ||
Given I create a new petitioner account for "[email protected]" | ||
And I verify my account for "[email protected]" | ||
When I visit forgot password page | ||
And I enter "[email protected]" on forgot password page | ||
Then I should see an alert that a password reset code has been sent | ||
When I enter the default forgot password code with a new password of "brandNewPassword1204$^" | ||
Then I should see the petitioner dashboard | ||
Given I logout of DAWSON | ||
When I log into DAWSON as "cypress_test_account+confirmed" with "brandNewPassword1204$^" | ||
Then I should see the petitioner dashboard | ||
|
||
Scenario: Attempt a password reset, enter incorrect (or expired) code, and request another code | ||
Given I create a new petitioner account for "[email protected]" | ||
And I verify my account for "[email protected]" | ||
When I visit forgot password page | ||
And I enter "[email protected]" on forgot password page | ||
Then I should see an alert that a password reset code has been sent | ||
When I enter an incorrect password code with a new password of "brandNewPassword1204$^" | ||
Then I should see an alert that I have entered an invalid password reset code | ||
Given I request a new forgot password code | ||
When I enter "[email protected]" on forgot password page | ||
Then I should see an alert that a password reset code has been sent | ||
|
||
Scenario: Attempt to reset a password after given e-access to DAWSON with an unconfirmed account | ||
Given I create and serve a paper petition + grant e-access for practitioner as "[email protected]" | ||
Then I should see an alert that my changes to the petition have been saved | ||
Given I logout of DAWSON | ||
When I visit forgot password page | ||
And I enter "[email protected]" on forgot password page | ||
Then I should see an alert that a confirmation email was resent | ||
|
||
|
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
45 changes: 45 additions & 0 deletions
45
cypress/cypress-integration/support/stepDefinitions/createPetition.ts
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint-disable quotes */ | ||
import { Then, When } from '@badeball/cypress-cucumber-preprocessor'; | ||
import { createAndServePaperPetition } from '../../../helpers/create-and-serve-paper-petition'; | ||
|
||
When( | ||
`I create and serve a paper petition + grant e-access for practitioner as {string}`, | ||
(email: string) => { | ||
createAndServePaperPetition().then(({ docketNumber }) => { | ||
cy.login('admissionsclerk1'); | ||
cy.get('[data-testid="messages-banner"]'); | ||
cy.get('[data-testid="docket-number-search-input"]').type(docketNumber); | ||
cy.get('[data-testid="search-docket-number"]').click(); | ||
cy.get('[data-testid="tab-case-information"]').click(); | ||
cy.get('[data-testid="tab-parties"]').click(); | ||
cy.get('[data-testid="edit-petitioner-button"]').click(); | ||
cy.get('[data-testid="internal-edit-petitioner-email-input"]').type( | ||
email, | ||
); | ||
cy.get('[data-testid="internal-confirm-petitioner-email-input"]').type( | ||
email, | ||
); | ||
cy.get( | ||
'[data-testid="submit-edit-petitioner-information-button"]', | ||
).click(); | ||
cy.get('[data-testid="modal-button-confirm"]').click(); | ||
|
||
// cy.visit('/login'); | ||
// cy.get('[data-testid="forgot-password-button"]').click(); | ||
// cy.get('[data-testid="email-input"]').clear(); | ||
// cy.get('[data-testid="email-input"]').type(practitionerEmail); | ||
// cy.get('[data-testid="send-password-reset-button"]').click(); | ||
// cy.get('[data-testid="warning-alert"]').should( | ||
// 'contain', | ||
// 'We’ve sent you an email', | ||
// ); | ||
}); | ||
}, | ||
); | ||
|
||
Then( | ||
'I should see an alert that my changes to the petition have been saved', | ||
() => { | ||
cy.get('[data-testid="success-alert"]').contains('Changes saved'); | ||
}, | ||
); |