diff --git a/tests/bugReport.spec.ts b/tests/bugReport.spec.ts index 387fae9f..5b5fc927 100644 --- a/tests/bugReport.spec.ts +++ b/tests/bugReport.spec.ts @@ -1,9 +1,18 @@ -import { test } from '@playwright/test' +import { test, expect } from '@playwright/test' -test('An instruction video for Report a bug', async ({ page }) => { +test('the YouTube modal in "report a bug" is visible and have the correct src', async ({ + page, +}) => { await page.goto('/') await page.getByLabel('bug').locator('svg').click() await page.getByLabel('לפתוח סרטון על העמוד הזה').locator('svg').click() + const iframeElement = await page.waitForSelector('iframe') + expect(iframeElement.isVisible()) + const videoSrc = page.locator('iframe') + await expect(videoSrc).toHaveAttribute( + 'src', + 'https://www.youtube-nocookie.com/embed?v=F6sD9Bz4Xj0&list=PL6Rh06rT7uiX1AQE-lm55hy-seL3idx3T&index=11', + ) await page.locator('iframe').contentFrame().getByLabel('Play', { exact: true }).click() await page.locator('iframe').contentFrame().getByLabel('Pause keyboard shortcut k').click() await page.getByLabel('Close', { exact: true }).click()