Skip to content

Commit

Permalink
screenshots for the duckplayer overlay (#1030)
Browse files Browse the repository at this point in the history
* screenshots for the duckplayer overlay

* linting

---------

Co-authored-by: Shane Osbourne <sosbourne@duckduckgo.com>
  • Loading branch information
shakyShane and Shane Osbourne authored Sep 9, 2024
1 parent 47c30d7 commit e29d271
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
16 changes: 15 additions & 1 deletion integration-test/playwright/duckplayer-mobile.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from '@playwright/test'
import { expect, test } from '@playwright/test'
import { DuckplayerOverlays } from './page-objects/duckplayer-overlays.js'

test.describe('Video Player overlays', () => {
Expand Down Expand Up @@ -107,3 +107,17 @@ test.describe.skip('Translated Overlays', () => {
})
}
})

/**
* Use `npm run playwright-screenshots` to run this test only.
*/
test.describe('Overlay screenshot @screenshots', () => {
test('testing Overlay UI \'en\'', async ({ page }, workerInfo) => {
const overlays = DuckplayerOverlays.create(page, workerInfo)
await overlays.withRemoteConfig({ locale: 'en' })
await overlays.userSettingIs('always ask')
await overlays.gotoPlayerPage()
await page.locator('ddg-video-overlay-mobile').nth(0).waitFor()
await expect(page.locator('.html5-video-player')).toHaveScreenshot('overlay.png', { maxDiffPixels: 20 })
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"posttest-int-x": "npm run test-int-x --workspaces --if-present",
"serve": "http-server -c-1 --port 3220 integration-test/test-pages",
"serve-special-pages": "http-server -c-1 --port 3221 build/integration/pages",
"playwright": "playwright test",
"playwright": "playwright test --grep-invert '@screenshots'",
"playwright-screenshots": "playwright test --grep '@screenshots'",
"playwright-headed": "playwright test --headed",
"preplaywright": "npm run build-windows && npm run build-apple && npm run build-android",
"preplaywright-headed": "npm run build-windows && npm run build-apple && npm run build-android",
Expand Down

0 comments on commit e29d271

Please sign in to comment.