mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(playwright): video-modal test (#54085)
This commit is contained in:
@@ -14,6 +14,8 @@ test.describe('Exit Video Modal E2E Test Suite', () => {
|
||||
test('Verifies the Correct Rendering of the Video Modal', async ({
|
||||
page
|
||||
}) => {
|
||||
const dialogs = page.getByRole('dialog');
|
||||
await expect(dialogs).toHaveCount(2);
|
||||
await expect(page.getByTestId('video-modal-title')).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId('video-modal-video-player-iframe')
|
||||
@@ -29,9 +31,14 @@ test.describe('Exit Video Modal E2E Test Suite', () => {
|
||||
test('Closes the Video Modal When the User clicks on exit button', async ({
|
||||
page
|
||||
}) => {
|
||||
const dialogs = page.getByRole('dialog');
|
||||
await expect(dialogs).toHaveCount(2);
|
||||
await page
|
||||
.getByRole('button', { name: translations.buttons.close })
|
||||
.click();
|
||||
for (const dialog of await dialogs.all()) {
|
||||
await expect(dialog).not.toBeVisible();
|
||||
}
|
||||
await expect(
|
||||
page.getByText(translations.buttons['watch-video'])
|
||||
).not.toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user