From 6f305d572847e0a3faaddd032279ca114a8cad2a Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Fri, 6 Sep 2024 08:35:33 -0700 Subject: [PATCH 1/6] update video tests --- tests/milo/video.block.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/milo/video.block.test.js b/tests/milo/video.block.test.js index 13d99a08..a25e365d 100644 --- a/tests/milo/video.block.test.js +++ b/tests/milo/video.block.test.js @@ -156,13 +156,13 @@ test.describe('Milo Video Block test suite', () => { await test.step('step-2: Verify video block content/specs', async () => { await expect(await video.miloVideo).toBeVisible(); - await expect(await video.iframe).toBeVisible(); - await expect(await video.youtubePlayButton).toBeVisible(); - await expect(await video.youtubePlayButton).toHaveAttribute('title', 'Play'); + await expect(await video.liteYoutube).toBeVisible(); + await expect(await video.ltyPlaybtn).toBeVisible(); + // await expect(await video.ltyPlaybtn).toHaveAttribute('title', 'Play'); - await expect(await video.iframe).toHaveAttribute('title', data.iframeTitle); - await expect(await video.iframe).toHaveAttribute('src', data.source); - expect(await webUtil.verifyAttributes_(video.iframe, video.attributes['iframe-youtube'])).toBeTruthy(); + // await expect(await video.liteYoutube).toHaveAttribute('title', data.iframeTitle); + // await expect(await video.liteYoutube).toHaveAttribute('src', data.source); + // expect(await webUtil.verifyAttributes_(video.liteYoutube, video.attributes['lite-youtube'])).toBeTruthy(); }); }); From 67987f6b07141957a15cf5c6df80d53cce8517a9 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Fri, 6 Sep 2024 08:38:05 -0700 Subject: [PATCH 2/6] update video tests --- tests/milo/video.block.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/milo/video.block.test.js b/tests/milo/video.block.test.js index a25e365d..b852ce4f 100644 --- a/tests/milo/video.block.test.js +++ b/tests/milo/video.block.test.js @@ -146,7 +146,7 @@ test.describe('Milo Video Block test suite', () => { test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { test.slow(); console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); - const { data } = features[6]; + // const { data } = features[6]; await test.step('step-1: Go to video block test page', async () => { await page.goto(`${baseURL}${features[6].path}${miloLibs}`); From 87b352b25df453b082bcc787e4400b3bff1069e7 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Fri, 6 Sep 2024 09:21:33 -0700 Subject: [PATCH 3/6] update video tests --- selectors/milo/video.block.page.js | 152 +++++++++++++++-------------- tests/milo/video.block.test.js | 6 +- 2 files changed, 80 insertions(+), 78 deletions(-) diff --git a/selectors/milo/video.block.page.js b/selectors/milo/video.block.page.js index 9fb2dde2..cd336d5b 100644 --- a/selectors/milo/video.block.page.js +++ b/selectors/milo/video.block.page.js @@ -1,75 +1,77 @@ -export default class Video { - constructor(page, nth=0) { - this.page = page; - - // video locators - this.section = this.page.locator('.section').nth(nth); - this.content = this.page.locator('.content').nth(nth); - this.fragment = this.page.locator('.fragment') - this.video = this.page.locator('.content video'); - this.videoSource = this.video.locator('source'); - this.miloVideo = this.page.locator('.milo-video'); - this.iframe = this.page.locator('iframe').first(); - this.mpcPlayerTitle = this.page.frameLocator('iframe').first().locator('.mpc-player__title'); - this.mpcPlayButton = this.page.frameLocator('iframe').first().locator('.mpc-player button[aria-label="Play"]'); - this.mpcMutedButton = this.page.frameLocator('iframe').first().locator('.mpc-player button[aria-label="Mute"]'); - this.mpcMutedLabel = this.page.frameLocator('iframe').first().locator('.mpc-player button[aria-label="Mute"] span'); - this.youtubePlayButton = this.page.frameLocator('iframe').first().locator('button[aria-label="Play"]'); - this.modalVideo = this.fragment.locator('video') - this.modalVideoSource = this.modalVideo.locator('source'); - this.consonantCardsGrid = this.page.locator('.consonant-CardsGrid'); - this.consonantCards = this.consonantCardsGrid.locator('.card.consonant-Card'); - this.video = this.page.locator('.content video'); - this.videoSource = this.video.locator('source'); - - // video block attributes - this.attributes = { - 'video.default': { - 'playsinline': '', - 'controls': '', - }, - 'video.source': { - 'type': 'video/mp4', - 'src': /.*.mp4/, - }, - 'video.autoplay': { - 'playsinline': '', - 'autoplay': '', - 'loop': '', - 'muted': '' - }, - 'video.autoplay.once': { - 'playsinline': '', - 'autoplay': '', - 'muted': '' - }, - 'video.hover.play': { - 'playsinline': '', - 'autoplay': '', - 'muted': '', - 'data-hoverplay': '', - 'data-mouseevent': 'true' - }, - 'iframe-mpc': { - 'class': 'adobetv', - 'scrolling': 'no', - 'allowfullscreen': '', - 'loading': 'lazy', - }, - 'iframe-youtube': { - 'class': 'youtube', - 'scrolling': 'no', - 'allowfullscreen': '', - 'allow': 'encrypted-media; accelerometer; gyroscope; picture-in-picture', - }, - 'analytics': { - 'section.daa-lh': { - 'daa-lh': /s[1-9]/, - }, - 'content.daa-lh': { - 'daa-lh': /b[1-9]|content|default|default/, - }, - }, - }; - } -} +export default class Video { + constructor(page, nth = 0) { + this.page = page; + + // video locators + this.section = this.page.locator('.section').nth(nth); + this.content = this.page.locator('.content').nth(nth); + this.fragment = this.page.locator('.fragment'); + this.video = this.page.locator('.content video'); + this.videoSource = this.video.locator('source'); + this.miloVideo = this.page.locator('.milo-video'); + this.iframe = this.page.locator('iframe').first(); + this.mpcPlayerTitle = this.page.frameLocator('iframe').first().locator('.mpc-player__title'); + this.mpcPlayButton = this.page.frameLocator('iframe').first().locator('.mpc-player button[aria-label="Play"]'); + this.mpcMutedButton = this.page.frameLocator('iframe').first().locator('.mpc-player button[aria-label="Mute"]'); + this.mpcMutedLabel = this.page.frameLocator('iframe').first().locator('.mpc-player button[aria-label="Mute"] span'); + this.youtubePlayButton = this.page.frameLocator('iframe').first().locator('button[aria-label="Play"]'); + this.liteYoutube = this.page.locator('lite-youtube'); + this.ltyPlaybtn = this.liteYoutube.locator('.lty-playbtn'); + this.modalVideo = this.fragment.locator('video'); + this.modalVideoSource = this.modalVideo.locator('source'); + this.consonantCardsGrid = this.page.locator('.consonant-CardsGrid'); + this.consonantCards = this.consonantCardsGrid.locator('.card.consonant-Card'); + this.video = this.page.locator('.content video'); + this.videoSource = this.video.locator('source'); + + // video block attributes + this.attributes = { + 'video.default': { + 'playsinline': '', + 'controls': '', + }, + 'video.source': { + 'type': 'video/mp4', + 'src': /.*.mp4/, + }, + 'video.autoplay': { + 'playsinline': '', + 'autoplay': '', + 'loop': '', + 'muted': '' + }, + 'video.autoplay.once': { + 'playsinline': '', + 'autoplay': '', + 'muted': '' + }, + 'video.hover.play': { + 'playsinline': '', + 'autoplay': '', + 'muted': '', + 'data-hoverplay': '', + 'data-mouseevent': 'true' + }, + 'iframe-mpc': { + 'class': 'adobetv', + 'scrolling': 'no', + 'allowfullscreen': '', + 'loading': 'lazy', + }, + 'iframe-youtube': { + 'class': 'youtube', + 'scrolling': 'no', + 'allowfullscreen': '', + 'allow': 'encrypted-media; accelerometer; gyroscope; picture-in-picture', + }, + 'analytics': { + 'section.daa-lh': { + 'daa-lh': /s[1-9]/, + }, + 'content.daa-lh': { + 'daa-lh': /b[1-9]|content|default|default/, + }, + }, + }; + } +} diff --git a/tests/milo/video.block.test.js b/tests/milo/video.block.test.js index b852ce4f..562e0e03 100644 --- a/tests/milo/video.block.test.js +++ b/tests/milo/video.block.test.js @@ -155,9 +155,9 @@ test.describe('Milo Video Block test suite', () => { }); await test.step('step-2: Verify video block content/specs', async () => { - await expect(await video.miloVideo).toBeVisible(); - await expect(await video.liteYoutube).toBeVisible(); - await expect(await video.ltyPlaybtn).toBeVisible(); + await expect(video.miloVideo).toBeVisible(); + await expect(video.liteYoutube).toBeVisible(); + await expect(video.ltyPlaybtn).toBeVisible(); // await expect(await video.ltyPlaybtn).toHaveAttribute('title', 'Play'); // await expect(await video.liteYoutube).toHaveAttribute('title', data.iframeTitle); From 66bf69b75c57064f15a342319ceccc097a2a5dfb Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Fri, 6 Sep 2024 09:29:53 -0700 Subject: [PATCH 4/6] fix elint errors --- selectors/milo/video.block.page.js | 46 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/selectors/milo/video.block.page.js b/selectors/milo/video.block.page.js index cd336d5b..50294fed 100644 --- a/selectors/milo/video.block.page.js +++ b/selectors/milo/video.block.page.js @@ -27,46 +27,46 @@ export default class Video { // video block attributes this.attributes = { 'video.default': { - 'playsinline': '', - 'controls': '', + playsinline: '', + controls: '', }, 'video.source': { - 'type': 'video/mp4', - 'src': /.*.mp4/, + type: 'video/mp4', + src: /.*.mp4/, }, 'video.autoplay': { - 'playsinline': '', - 'autoplay': '', - 'loop': '', - 'muted': '' + playsinline: '', + autoplay: '', + loop: '', + muted: '' }, 'video.autoplay.once': { - 'playsinline': '', - 'autoplay': '', - 'muted': '' + playsinline: '', + autoplay: '', + muted: '' }, 'video.hover.play': { - 'playsinline': '', - 'autoplay': '', - 'muted': '', + playsinline: '', + autoplay: '', + muted: '', 'data-hoverplay': '', 'data-mouseevent': 'true' }, 'iframe-mpc': { - 'class': 'adobetv', - 'scrolling': 'no', - 'allowfullscreen': '', - 'loading': 'lazy', + class: 'adobetv', + scrolling: 'no', + allowfullscreen: '', + loading: 'lazy', }, 'iframe-youtube': { - 'class': 'youtube', - 'scrolling': 'no', - 'allowfullscreen': '', - 'allow': 'encrypted-media; accelerometer; gyroscope; picture-in-picture', + class: 'youtube', + scrolling: 'no', + allowfullscreen: '', + allow: 'encrypted-media; accelerometer; gyroscope; picture-in-picture', }, 'analytics': { 'section.daa-lh': { - 'daa-lh': /s[1-9]/, + 'daa-lh': /s[1-9]/, }, 'content.daa-lh': { 'daa-lh': /b[1-9]|content|default|default/, From 085f3048527d3fd8e48601cc335044361784c07e Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Fri, 6 Sep 2024 09:32:27 -0700 Subject: [PATCH 5/6] fix elint errors --- selectors/milo/video.block.page.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selectors/milo/video.block.page.js b/selectors/milo/video.block.page.js index 50294fed..e8fd4e99 100644 --- a/selectors/milo/video.block.page.js +++ b/selectors/milo/video.block.page.js @@ -38,19 +38,19 @@ export default class Video { playsinline: '', autoplay: '', loop: '', - muted: '' + muted: '', }, 'video.autoplay.once': { playsinline: '', autoplay: '', - muted: '' + muted: '', }, 'video.hover.play': { playsinline: '', autoplay: '', muted: '', 'data-hoverplay': '', - 'data-mouseevent': 'true' + 'data-mouseevent': 'true', }, 'iframe-mpc': { class: 'adobetv', From a41d21f0d3d799e4eb9715e53c13cb53e46d2d2a Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Fri, 6 Sep 2024 09:36:21 -0700 Subject: [PATCH 6/6] fix elint errors --- selectors/milo/video.block.page.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/selectors/milo/video.block.page.js b/selectors/milo/video.block.page.js index e8fd4e99..466de5d4 100644 --- a/selectors/milo/video.block.page.js +++ b/selectors/milo/video.block.page.js @@ -2,10 +2,11 @@ export default class Video { constructor(page, nth = 0) { this.page = page; - // video locators + // Video locators this.section = this.page.locator('.section').nth(nth); this.content = this.page.locator('.content').nth(nth); this.fragment = this.page.locator('.fragment'); + // Remove duplicate 'video' and 'videoSource' declarations this.video = this.page.locator('.content video'); this.videoSource = this.video.locator('source'); this.miloVideo = this.page.locator('.milo-video'); @@ -21,10 +22,8 @@ export default class Video { this.modalVideoSource = this.modalVideo.locator('source'); this.consonantCardsGrid = this.page.locator('.consonant-CardsGrid'); this.consonantCards = this.consonantCardsGrid.locator('.card.consonant-Card'); - this.video = this.page.locator('.content video'); - this.videoSource = this.video.locator('source'); - // video block attributes + // Video block attributes this.attributes = { 'video.default': { playsinline: '', @@ -42,12 +41,12 @@ export default class Video { }, 'video.autoplay.once': { playsinline: '', - autoplay: '', + autoplay: '', muted: '', }, 'video.hover.play': { playsinline: '', - autoplay: '', + autoplay: '', muted: '', 'data-hoverplay': '', 'data-mouseevent': 'true', @@ -63,15 +62,15 @@ export default class Video { scrolling: 'no', allowfullscreen: '', allow: 'encrypted-media; accelerometer; gyroscope; picture-in-picture', - }, - 'analytics': { + }, + analytics: { 'section.daa-lh': { - 'daa-lh': /s[1-9]/, + 'daa-lh': /s[1-9]/, }, 'content.daa-lh': { 'daa-lh': /b[1-9]|content|default|default/, - }, - }, + }, + }, }; } }