diff --git a/integration-test/playwright/duckplayer-mobile.spec.js b/integration-test/playwright/duckplayer-mobile.spec.js index 707694d5b..8ab5d002d 100644 --- a/integration-test/playwright/duckplayer-mobile.spec.js +++ b/integration-test/playwright/duckplayer-mobile.spec.js @@ -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', () => { @@ -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 }) + }) +}) diff --git a/integration-test/playwright/duckplayer-mobile.spec.js-snapshots/overlay-android-darwin.png b/integration-test/playwright/duckplayer-mobile.spec.js-snapshots/overlay-android-darwin.png new file mode 100644 index 000000000..a21a65471 Binary files /dev/null and b/integration-test/playwright/duckplayer-mobile.spec.js-snapshots/overlay-android-darwin.png differ diff --git a/integration-test/playwright/duckplayer-mobile.spec.js-snapshots/overlay-ios-darwin.png b/integration-test/playwright/duckplayer-mobile.spec.js-snapshots/overlay-ios-darwin.png new file mode 100644 index 000000000..fd477a0be Binary files /dev/null and b/integration-test/playwright/duckplayer-mobile.spec.js-snapshots/overlay-ios-darwin.png differ diff --git a/package.json b/package.json index 29f53fd06..b4eea4c81 100644 --- a/package.json +++ b/package.json @@ -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",