-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(e2e-defaults): improve e2e test usage convention and default redi…
…rect url - Change message type e2e test to use better testing conventions - improve defaults for sdk configuration for redirectUrl to prevent hash and query param pollution - Fix a11y report that aria-invalid is not compatible with radio inputs
- Loading branch information
Showing
8 changed files
with
102 additions
and
102 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
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
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,55 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { asyncEvents } from '../../utilities/async-events.js'; | ||
|
||
test('Modal widget with different messages type', async ({ page }) => { | ||
const { clickButton, navigate } = asyncEvents(page); | ||
|
||
// Navigate to page without Widget instantiation | ||
await navigate('widget'); | ||
|
||
const loginLink = page.getByRole('link', { name: 'Login via Modal Widget' }); | ||
|
||
await expect(loginLink).toBeVisible(); | ||
|
||
await navigate('widget/modal?journey=TEST_TextOutputCallback'); | ||
|
||
await expect(page.getByRole('dialog')).toBeHidden(); | ||
|
||
await clickButton('Open Login Modal', '/authenticate'); | ||
|
||
await expect(page.getByRole('dialog')).toBeVisible(); | ||
|
||
// Try failed logins first. | ||
await page.getByLabel('Username').fill('notauser'); | ||
await page.getByLabel('Password').fill('notapassword'); | ||
|
||
await clickButton('Next', '/authenticate'); | ||
|
||
await expect( | ||
page.getByText('Your username or password is incorrect. Please try again.'), | ||
).toBeVisible(); | ||
|
||
// Fail login one more time. | ||
await page.getByLabel('Username').fill('notauser'); | ||
await page.getByLabel('Password').fill('notapassword'); | ||
|
||
await clickButton('Next', '/authenticate'); | ||
|
||
await expect(page.getByText('You have exceeded login attempts.')).toBeVisible(); | ||
|
||
// Refresh the page and start over. | ||
await page.reload(); | ||
|
||
// Reopen modal | ||
await clickButton('Open Login Modal', '/authenticate'); | ||
// Dialog should be visible | ||
await expect(page.getByRole('dialog')).toBeVisible(); | ||
|
||
// Login with correct username password | ||
await page.getByLabel('Username').fill('demouser'); | ||
await page.getByLabel('Password').fill('j56eKtae*1'); | ||
|
||
await clickButton('Next', '/authenticate'); | ||
|
||
await expect(page.getByText('Success! Welcome back.')).toBeVisible(); | ||
}); |
Oops, something went wrong.