-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shane Osbourne
committed
Sep 9, 2024
1 parent
43db011
commit 0af7c82
Showing
23 changed files
with
1,032 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { test } from '@playwright/test' | ||
import { DuckplayerOverlays } from './page-objects/duckplayer-overlays.js' | ||
|
||
test.describe('Video Player overlays', () => { | ||
test('Selecting \'watch here\' on mobile', async ({ page }, workerInfo) => { | ||
const overlays = DuckplayerOverlays.create(page, workerInfo) | ||
|
||
// Given overlays feature is enabled | ||
await overlays.withRemoteConfig() | ||
|
||
// And my setting is 'always ask' | ||
await overlays.userSettingIs('always ask') | ||
await overlays.gotoPlayerPage() | ||
|
||
// watch here = overlays removed | ||
await overlays.mobile.choosesWatchHere() | ||
await overlays.mobile.overlayIsRemoved() | ||
await overlays.pixels.sendsPixels([ | ||
{ pixelName: 'overlay', params: {} }, | ||
{ pixelName: 'play.do_not_use', params: { remember: '0' } } | ||
]) | ||
}) | ||
test('Selecting \'watch here\' on mobile + remember', async ({ page }, workerInfo) => { | ||
const overlays = DuckplayerOverlays.create(page, workerInfo) | ||
|
||
// Given overlays feature is enabled | ||
await overlays.withRemoteConfig() | ||
|
||
// And my setting is 'always ask' | ||
await overlays.userSettingIs('always ask') | ||
await overlays.gotoPlayerPage() | ||
|
||
// watch here = overlays removed | ||
await overlays.mobile.selectsRemember() | ||
await overlays.mobile.choosesWatchHere() | ||
await overlays.mobile.overlayIsRemoved() | ||
await overlays.pixels.sendsPixels([ | ||
{ pixelName: 'overlay', params: {} }, | ||
{ pixelName: 'play.do_not_use', params: { remember: '1' } } | ||
]) | ||
await overlays.userSettingWasUpdatedTo('disabled') | ||
}) | ||
test('Selecting \'watch in duckplayer\' on mobile', async ({ page }, workerInfo) => { | ||
const overlays = DuckplayerOverlays.create(page, workerInfo) | ||
|
||
// Given overlays feature is enabled | ||
await overlays.withRemoteConfig() | ||
|
||
// And my setting is 'always ask' | ||
await overlays.userSettingIs('always ask') | ||
await overlays.gotoPlayerPage() | ||
|
||
await overlays.mobile.choosesDuckPlayer() | ||
await overlays.pixels.sendsPixels([ | ||
{ pixelName: 'overlay', params: {} }, | ||
{ pixelName: 'play.use', params: { remember: '0' } } | ||
]) | ||
await overlays.userSettingWasUpdatedTo('always ask') | ||
}) | ||
test('Selecting \'watch in duckplayer\' on mobile + remember', async ({ page }, workerInfo) => { | ||
const overlays = DuckplayerOverlays.create(page, workerInfo) | ||
|
||
// Given overlays feature is enabled | ||
await overlays.withRemoteConfig() | ||
|
||
// And my setting is 'always ask' | ||
await overlays.userSettingIs('always ask') | ||
await overlays.gotoPlayerPage() | ||
|
||
await overlays.mobile.selectsRemember() | ||
await overlays.mobile.choosesDuckPlayer() | ||
await overlays.pixels.sendsPixels([ | ||
{ pixelName: 'overlay', params: {} }, | ||
{ pixelName: 'play.use', params: { remember: '1' } } | ||
]) | ||
await overlays.userSettingWasUpdatedTo('enabled') | ||
}) | ||
test('opens info', async ({ page }, workerInfo) => { | ||
const overlays = DuckplayerOverlays.create(page, workerInfo) | ||
|
||
// Given overlays feature is enabled | ||
await overlays.withRemoteConfig() | ||
|
||
// And my setting is 'always ask' | ||
await overlays.userSettingIs('always ask') | ||
await overlays.gotoPlayerPage() | ||
await overlays.mobile.opensInfo() | ||
}) | ||
}) | ||
|
||
/** | ||
* Use this test in `--headed` mode to cycle through every language | ||
*/ | ||
test.describe.skip('Translated Overlays', () => { | ||
const items = ['bg', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'it', 'lt', 'lv', 'nb', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sv', 'tr'] | ||
// const items = ['en'] | ||
for (const locale of items) { | ||
test(`testing UI ${locale}`, async ({ page }, workerInfo) => { | ||
// console.log(workerInfo.project.use.viewport.height) | ||
// console.log(workerInfo.project.use.viewport.width) | ||
const overlays = DuckplayerOverlays.create(page, workerInfo) | ||
await overlays.withRemoteConfig({ locale }) | ||
await overlays.userSettingIs('always ask') | ||
await overlays.gotoPlayerPage() | ||
await page.locator('ddg-video-overlay-mobile').nth(0).waitFor() | ||
await page.locator('.html5-video-player').screenshot({ path: `screens/se-2/${locale}.png` }) | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.