Skip to content

Commit

Permalink
test: add test for 'about' youtube modal
Browse files Browse the repository at this point in the history
  • Loading branch information
YaelChen committed Dec 29, 2024
1 parent cbd62a7 commit d695a41
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ test.describe('About Page Tests', () => {
test('About YouTube modal plays video', async ({ page }) => {
await page.goto('/about')
const videoFrame = page.frameLocator('iframe[title="YouTube video player"]')
await videoFrame.locator('.ytp-cued-thumbnail-overlay-image').click({ force: true })
await page.waitForTimeout(3000)
const playButtonLabel = await videoFrame.locator('.ytp-play-button').getAttribute('aria-label')
expect(playButtonLabel).toBe('Pause keyboard shortcut k')
const playButton = videoFrame.getByLabel('Play', { exact: true })
await playButton.click()
await playButton.waitFor({ state: 'hidden' })
const video = videoFrame.locator('video')
await video.hover()
await expect(videoFrame.getByLabel('Pause')).toBeVisible()
})
})

0 comments on commit d695a41

Please sign in to comment.