diff --git a/e2e/video-modal.spec.ts b/e2e/video-modal.spec.ts index d4e97368230..6cd9736e12d 100644 --- a/e2e/video-modal.spec.ts +++ b/e2e/video-modal.spec.ts @@ -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();