-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c714962
commit 4ae2f77
Showing
5 changed files
with
171 additions
and
85 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 |
---|---|---|
|
@@ -2,40 +2,47 @@ import { Registration } from './page-objects'; | |
import { test, expect } from './utils/test'; | ||
|
||
test.describe.parallel('Forgot Password', () => { | ||
let poRegistration: Registration; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
poRegistration = new Registration(page); | ||
|
||
await page.goto('/home'); | ||
await poRegistration.btnForgotPassword.click(); | ||
}); | ||
|
||
test('Email validation', async () => { | ||
await test.step('expect trigger a validation error if no email is provided', async () => { | ||
await poRegistration.btnSendInstructions.click(); | ||
await expect(poRegistration.inputEmail).toBeInvalid(); | ||
let poRegistration: Registration; | ||
|
||
test.describe('Email validation', () => { | ||
test.beforeEach(async ({ page }) => { | ||
poRegistration = new Registration(page); | ||
|
||
await page.goto('/home'); | ||
await poRegistration.btnForgotPassword.click(); | ||
}); | ||
|
||
await test.step('expect trigger a validation if a invalid email is provided (1)', async () => { | ||
await poRegistration.inputEmail.fill('mail@mail'); | ||
await poRegistration.btnSendInstructions.click(); | ||
|
||
await expect(poRegistration.inputEmail).toBeInvalid(); | ||
test('Send email to recover account', async () => { | ||
await test.step('expect trigger a validation error if no email is provided', async () => { | ||
await poRegistration.btnSendInstructions.click(); | ||
await expect(poRegistration.inputEmail).toBeInvalid(); | ||
}); | ||
|
||
await test.step('expect trigger a validation if a invalid email is provided (1)', async () => { | ||
await poRegistration.inputEmail.fill('mail@mail'); | ||
await poRegistration.btnSendInstructions.click(); | ||
|
||
await expect(poRegistration.inputEmail).toBeInvalid(); | ||
}); | ||
|
||
await test.step('expect trigger a validation if a invalid email is provided (2)', async () => { | ||
await poRegistration.inputEmail.fill('mail'); | ||
await poRegistration.btnSendInstructions.click(); | ||
|
||
await expect(poRegistration.inputEmail).toBeInvalid(); | ||
}); | ||
|
||
await test.step('expect to show a success callout if a valid email is provided', async () => { | ||
await poRegistration.inputEmail.fill('[email protected]'); | ||
await poRegistration.btnSendInstructions.click(); | ||
|
||
await expect(poRegistration.forgotPasswordEmailCallout).toBeVisible(); | ||
}); | ||
}); | ||
|
||
await test.step('expect trigger a validation if a invalid email is provided (2)', async () => { | ||
await poRegistration.inputEmail.fill('mail'); | ||
await poRegistration.btnSendInstructions.click(); | ||
|
||
await expect(poRegistration.inputEmail).toBeInvalid(); | ||
}); | ||
|
||
await test.step('expect to show a success toast if a valid email is provided', async () => { | ||
await poRegistration.inputEmail.fill('[email protected]'); | ||
await poRegistration.btnSendInstructions.click(); | ||
|
||
await expect(poRegistration.forgotPasswordEmailCallout).toBeVisible(); | ||
}); | ||
}); | ||
test('should not have any accessibility violations', async ({ makeAxeBuilder }) => { | ||
const results = await makeAxeBuilder().analyze(); | ||
expect(results.violations).toEqual([]); | ||
}) | ||
}) | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Registration } from './page-objects'; | ||
import { setSettingValueById } from './utils/setSettingValueById'; | ||
import { test, expect } from './utils/test'; | ||
|
||
test.describe.parallel('Reset Password', () => { | ||
let poRegistration: Registration; | ||
|
||
test.beforeEach(async ({ api, page }) => { | ||
poRegistration = new Registration(page); | ||
await setSettingValueById(api, 'Accounts_RequirePasswordConfirmation', true); | ||
|
||
await page.goto('/reset-password/someToken'); | ||
}); | ||
|
||
test.afterAll(async ({ api }) => { | ||
await setSettingValueById(api, 'Accounts_RequirePasswordConfirmation', true); | ||
}) | ||
|
||
test('should confirm password be invalid', async () => { | ||
await poRegistration.inputPassword.fill('123456'); | ||
await poRegistration.inputPasswordConfirm.fill('123455'); | ||
await poRegistration.btnReset.click(); | ||
await expect(poRegistration.inputPasswordConfirm).toBeInvalid(); | ||
}); | ||
|
||
test('should confirm password not be visible', async ({ api }) => { | ||
await setSettingValueById(api, 'Accounts_RequirePasswordConfirmation', false); | ||
await expect(poRegistration.inputPasswordConfirm).not.toBeVisible(); | ||
}) | ||
|
||
test('should not have any accessibility violations', async ({ makeAxeBuilder }) => { | ||
const results = await makeAxeBuilder().analyze(); | ||
expect(results.violations).toEqual([]); | ||
}) | ||
}); |
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