diff --git a/nala/blocks/marquee-anchors/marquee-anchors.page.js b/nala/blocks/marquee-anchors/marquee-anchors.page.js new file mode 100644 index 0000000000..aa82a5684c --- /dev/null +++ b/nala/blocks/marquee-anchors/marquee-anchors.page.js @@ -0,0 +1,57 @@ +export default class MarqueeAnchors { + constructor(page, nth = 0) { + this.page = page; + + // marquee anchor variants locators + this.marqueeAnchors = page.locator('.marquee-anchors').nth(nth); + this.marqueeAnchorsTransparent = page.locator('.marquee-anchors').nth(nth); + + // marquee details + this.detailM = this.marqueeAnchors.locator('.detail-m'); + this.detailL = this.marqueeAnchors.locator('.detail-l'); + + // marquee headings + this.headingL = this.marqueeAnchors.locator('.heading-l').nth(0); + + // marquee body area + this.bodyM = this.marqueeAnchors.locator('.body-m').nth(0); + + // marquee actions area + this.actionArea = this.marqueeAnchors.locator('.action-area'); + this.outlineButton = this.marqueeAnchors.locator('.con-button.outline'); + this.blueButton = this.marqueeAnchors.locator('.con-button.blue'); + this.supplementalText = this.marqueeAnchors.locator('.supplemental-text'); + this.foregroundImage = this.marqueeAnchors.locator('.supplemental-text img'); + // marquee anchor link + this.anchorHeader = this.marqueeAnchors.locator('.links-header'); + this.anchorFooter = this.marqueeAnchors.locator('.links-footer'); + + this.anchorLinks = this.marqueeAnchors.locator('.anchor-link'); + this.anchorLink = { + howTo: { + link: this.anchorLinks.nth(0), + linkHeader: this.anchorLinks.nth(0).locator('#anchor-how-to'), + linkText: this.anchorLinks.nth(0).locator('#anchor-how-to p').nth(0), + icon: this.anchorLinks.nth(0).locator('img.icon-milo'), + }, + text: { + link: this.anchorLinks.nth(1), + linkHeader: this.anchorLinks.locator('#anchor-text'), + linkText: this.anchorLinks.locator('#anchor-text p').nth(0), + icon: this.anchorLinks.nth(1).locator('img.icon-milo'), + }, + media: { + link: this.anchorLinks.nth(2), + linkHeader: this.anchorLinks.locator('#anchor-media'), + linkText: this.anchorLinks.locator('#anchor-media p').nth(0), + icon: this.anchorLinks.nth(2).locator('img.icon-milo'), + }, + linkToAdobe: { + link: this.anchorLinks.nth(3), + linkHeader: this.anchorLinks.locator('h4#anchor-link-to-adobe'), + linkText: this.anchorLinks.locator('#anchor-link-to-adobe p').nth(0), + icon: this.anchorLinks.nth(3).locator('img.icon-milo'), + }, + }; + } +} diff --git a/nala/blocks/marquee-anchors/marquee-anchors.spec.js b/nala/blocks/marquee-anchors/marquee-anchors.spec.js new file mode 100644 index 0000000000..bf79fb4a3c --- /dev/null +++ b/nala/blocks/marquee-anchors/marquee-anchors.spec.js @@ -0,0 +1,81 @@ +module.exports = { + name: 'Marquee Anchors Block', + features: [ + { + tcid: '0', + name: 'Marquee Anchors', + path: '/drafts/nala/blocks/marquee/marquee-anchors', + data: { + detailText: 'Heading M Bold 24/30', + h2Text: 'Heading XL Bold (36/45) Lorem ipsum (Image Background)', + bodyText: 'Lorem ipsum dolor sit amet,.', + outlineButtonText: 'Lorem ipsum', + blueButtonText: 'Call to action', + anchors: { + linkCount: 4, + headerText: 'Anchors header (optional)', + footerText: 'Anchors footer What we offer (optional)', + howTo: { + h4Text: 'How to', + linkText: 'Link to a section with header “How To”', + href: 'http://how-to-block/', + }, + text: { + h4Text: 'Text', + linkText: 'Link to a section with header “Text”', + href: 'http://text-block/', + }, + media: { + h4Text: 'Media', + linkText: 'Link to a section with header “Media”', + href: 'http://media-block/', + }, + linkToAdobe: { + h4Text: 'Link to Adobe', + linkText: 'Link to a new page', + href: 'https://adobe.com/', + }, + }, + }, + tags: '@marquee @marquee-anchors @smoke @regression @milo', + }, + { + tcid: '1', + name: 'Marquee Anchors (Transparent)', + path: '/drafts/nala/blocks/marquee/marquee-anchors-transparent', + data: { + detailText: 'Heading M Bold 24/30', + h2Text: 'Heading XL Bold (36/45) Lorem ipsum (Image Background)', + bodyText: 'Lorem ipsum dolor sit amet.', + outlineButtonText: 'Lorem ipsum', + blueButtonText: 'Call to action', + anchors: { + linkCount: 4, + headerText: 'Anchors header (optional)', + footerText: 'Anchors footer What we offer (optional)', + howTo: { + h4Text: 'How to', + linkText: 'Link to a section with header “How To”', + href: 'http://how-to-block/', + }, + text: { + h4Text: 'Text', + linkText: 'Link to a section with header “Text”', + href: 'http://text-block/', + }, + media: { + h4Text: 'Media', + linkText: 'Link to a section with header “Media”', + href: 'http://media-block/', + }, + linkToAdobe: { + h4Text: 'Link to Adobe', + linkText: 'Link to a new page', + href: 'https://adobe.com/', + }, + }, + }, + tags: '@marquee @marquee-anchors @smoke @regression @milo', + }, + ], +}; diff --git a/nala/blocks/marquee-anchors/marquee-anchors.test.js b/nala/blocks/marquee-anchors/marquee-anchors.test.js new file mode 100644 index 0000000000..d2c0bdcb55 --- /dev/null +++ b/nala/blocks/marquee-anchors/marquee-anchors.test.js @@ -0,0 +1,140 @@ +import { expect, test } from '@playwright/test'; +import WebUtil from '../../libs/webutil.js'; +import { features } from './marquee-anchors.spec.js'; +import MarqueeAnchors from './marquee-anchors.page.js'; + +let webUtil; +let marquee; + +const miloLibs = process.env.MILO_LIBS || ''; + +test.describe('Milo Marquee Anchors test suite', () => { + test.beforeEach(async ({ page }) => { + webUtil = new WebUtil(page); + marquee = new MarqueeAnchors(page); + }); + + // Test 0 : Marquee anchors + test(`[Test Id - ${features[0].tcid}] ${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); + const { data } = features[0]; + + await test.step('step-1: Go to Marquee anchors block test page', async () => { + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); + }); + + await test.step('step-2: Verify marquee anchors specs', async () => { + await expect(await marquee.marqueeAnchors).toBeVisible(); + + await expect(await marquee.detailM).toContainText(data.detailText); + await expect(await marquee.headingL).toContainText(data.h2Text); + await expect(await marquee.bodyM).toContainText(data.bodyText); + await expect(await marquee.outlineButton).toContainText(data.outlineButtonText); + await expect(await marquee.blueButton).toContainText(data.blueButtonText); + + await expect(await marquee.foregroundImage).toBeVisible(); + + // verify marquee anchors links + await expect(marquee.anchorLinks).toHaveCount(data.anchors.linkCount); + await expect(marquee.anchorHeader).toContainText(data.anchors.headerText); + + await expect(marquee.anchorLink.howTo.link).toContainText(data.anchors.howTo.linkText); + await expect(marquee.anchorLink.howTo.linkHeader).toContainText(data.anchors.howTo.h4Text); + await expect(marquee.anchorLink.howTo.link).toHaveAttribute('href', data.anchors.howTo.href); + await expect(marquee.anchorLink.howTo.icon).toBeVisible(); + + await expect(marquee.anchorLink.text.link).toContainText(data.anchors.text.linkText); + await expect(marquee.anchorLink.text.linkHeader).toContainText(data.anchors.text.h4Text); + await expect(marquee.anchorLink.text.link).toHaveAttribute('href', data.anchors.text.href); + await expect(marquee.anchorLink.text.icon).toBeVisible(); + + await expect(marquee.anchorLink.media.link).toContainText(data.anchors.media.linkText); + await expect(marquee.anchorLink.media.linkHeader).toContainText(data.anchors.media.h4Text); + await expect(marquee.anchorLink.media.link).toHaveAttribute('href', data.anchors.media.href); + await expect(marquee.anchorLink.media.icon).toBeVisible(); + + await expect(marquee.anchorLink.linkToAdobe.link).toContainText(data.anchors.linkToAdobe.linkText); + await expect(marquee.anchorLink.linkToAdobe.linkHeader).toContainText(data.anchors.linkToAdobe.h4Text); + await expect(marquee.anchorLink.linkToAdobe.link).toHaveAttribute('href', data.anchors.linkToAdobe.href); + await expect(marquee.anchorLink.linkToAdobe.icon).toBeVisible(); + + await expect(marquee.anchorFooter).toContainText(data.anchors.footerText); + }); + + await test.step('step-3: Verify analytics attributes', async () => { + await expect(await marquee.marqueeAnchors).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee-anchors', 1)); + + await expect(await marquee.outlineButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); + await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); + + await expect(await marquee.anchorLink.howTo.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.howTo.h4Text} ${data.anchors.howTo.linkText}`, 3, data.anchors.headerText)); + await expect(await marquee.anchorLink.text.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.text.h4Text} ${data.anchors.text.linkText}`, 4, data.anchors.howTo.h4Text)); + await expect(await marquee.anchorLink.media.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.media.h4Text} ${data.anchors.media.linkText}`, 5, data.anchors.text.h4Text)); + await expect(await marquee.anchorLink.linkToAdobe.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.linkToAdobe.h4Text} ${data.anchors.linkToAdobe.linkText}`, 6, data.anchors.media.h4Text)); + }); + }); + + // Test 1 : Marquee anchors (transparent) + test(`[Test Id - ${features[1].tcid}] ${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); + const { data } = features[1]; + + await test.step('step-1: Go to Marquee anchors (Transparent) block test page', async () => { + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); + }); + + await test.step('step-2: Verify marquee anchors (Transparent) specs', async () => { + await expect(await marquee.marqueeAnchorsTransparent).toBeVisible(); + + await expect(await marquee.detailM).toContainText(data.detailText); + await expect(await marquee.headingL).toContainText(data.h2Text); + await expect(await marquee.bodyM).toContainText(data.bodyText); + await expect(await marquee.outlineButton).toContainText(data.outlineButtonText); + await expect(await marquee.blueButton).toContainText(data.blueButtonText); + + await expect(await marquee.foregroundImage).toBeVisible(); + + // verify marquee anchors links + await expect(marquee.anchorLinks).toHaveCount(data.anchors.linkCount); + await expect(marquee.anchorHeader).toContainText(data.anchors.headerText); + + await expect(marquee.anchorLink.howTo.link).toContainText(data.anchors.howTo.linkText); + await expect(marquee.anchorLink.howTo.linkHeader).toContainText(data.anchors.howTo.h4Text); + await expect(marquee.anchorLink.howTo.link).toHaveAttribute('href', data.anchors.howTo.href); + await expect(marquee.anchorLink.howTo.icon).toBeVisible(); + + await expect(marquee.anchorLink.text.link).toContainText(data.anchors.text.linkText); + await expect(marquee.anchorLink.text.linkHeader).toContainText(data.anchors.text.h4Text); + await expect(marquee.anchorLink.text.link).toHaveAttribute('href', data.anchors.text.href); + await expect(marquee.anchorLink.text.icon).toBeVisible(); + + await expect(marquee.anchorLink.media.link).toContainText(data.anchors.media.linkText); + await expect(marquee.anchorLink.media.linkHeader).toContainText(data.anchors.media.h4Text); + await expect(marquee.anchorLink.media.link).toHaveAttribute('href', data.anchors.media.href); + await expect(marquee.anchorLink.media.icon).toBeVisible(); + + await expect(marquee.anchorLink.linkToAdobe.link).toContainText(data.anchors.linkToAdobe.linkText); + await expect(marquee.anchorLink.linkToAdobe.linkHeader).toContainText(data.anchors.linkToAdobe.h4Text); + await expect(marquee.anchorLink.linkToAdobe.link).toHaveAttribute('href', data.anchors.linkToAdobe.href); + await expect(marquee.anchorLink.linkToAdobe.icon).toBeVisible(); + + await expect(marquee.anchorFooter).toContainText(data.anchors.footerText); + + await test.step('step-3: Verify analytics attributes', async () => { + await expect(await marquee.marqueeAnchorsTransparent).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee-anchors', 1)); + + await expect(await marquee.outlineButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); + await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); + + await expect(await marquee.anchorLink.howTo.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.howTo.h4Text} ${data.anchors.howTo.linkText}`, 3, data.anchors.headerText)); + await expect(await marquee.anchorLink.text.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.text.h4Text} ${data.anchors.text.linkText}`, 4, data.anchors.howTo.h4Text)); + await expect(await marquee.anchorLink.media.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.media.h4Text} ${data.anchors.media.linkText}`, 5, data.anchors.text.h4Text)); + await expect(await marquee.anchorLink.linkToAdobe.link).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(`${data.anchors.linkToAdobe.h4Text} ${data.anchors.linkToAdobe.linkText}`, 6, data.anchors.media.h4Text)); + }); + }); + }); +}); diff --git a/nala/blocks/marquee/marquee.page.js b/nala/blocks/marquee/marquee.page.js index 84673f0110..729774c84d 100644 --- a/nala/blocks/marquee/marquee.page.js +++ b/nala/blocks/marquee/marquee.page.js @@ -4,12 +4,16 @@ export default class Marquee { // marquee types locators this.marquee = page.locator('.marquee').nth(nth); this.marqueeLight = page.locator('.marquee.light'); + this.marqueeLightXxlButton = page.locator('.marquee.light.xxl-button'); this.marqueeSmall = page.locator('.marquee.small'); this.marqueeSmallLight = page.locator('.marquee.small.light'); + this.marqueeDark = page.locator('.marquee.dark'); this.marqueeSmallDark = page.locator('.marquee.small.dark'); this.marqueeLarge = page.locator('.marquee.large'); this.marqueeLargeLight = page.locator('.marquee.large.light'); this.marqueeLargeDark = page.locator('.marquee.large.dark'); + this.marqueeLargeStandardDark = page.locator('.marquee.large.standard.dark'); + this.marqueeLargeCompactDark = page.locator('.marquee.large.compact.dark'); this.marqueeQuiet = page.locator('.marquee.quiet'); this.marqueeInline = page.locator('.marquee'); this.marqueeSplitSmall = page.locator('.marquee.split.small'); @@ -26,12 +30,12 @@ export default class Marquee { this.brandImage = this.marquee.locator('.detail-m'); // marquee headings - this.headingXL = this.marquee.locator('.heading-xl'); + this.headingXL = this.marquee.locator('.heading-xl').nth(0); this.headingXXL = this.marquee.locator('.heading-xxl'); // marquee body area this.bodyM = this.marquee.locator('.body-m'); - this.bodyXL = this.marquee.locator('.body-xl'); + this.bodyXL = this.marquee.locator('.body-xl').nth(0); // marquee actions area this.actionArea = this.marquee.locator('.action-area'); @@ -52,7 +56,9 @@ export default class Marquee { this.actionLink1 = this.marquee.locator('a').nth(0); this.actionLink2 = this.marquee.locator('a').nth(1); + this.actionLink3 = this.marquee.locator('a').nth(2); + this.supplementalText = this.marquee.locator('.supplemental-text'); // background images this.background = this.marquee.locator('.background'); this.backgroundImage = this.marquee.locator('div.background img'); @@ -71,6 +77,7 @@ export default class Marquee { // media images this.mediaImage = this.marquee.locator('div.asset img'); + this.foregroundAssetImage = this.marquee.locator('div.asset img'); // marquee attributes this.attributes = { diff --git a/nala/blocks/marquee/marquee.spec.js b/nala/blocks/marquee/marquee.spec.js index 87b18b33ee..f8c84189ff 100644 --- a/nala/blocks/marquee/marquee.spec.js +++ b/nala/blocks/marquee/marquee.spec.js @@ -3,7 +3,7 @@ module.exports = { features: [ { tcid: '0', - name: '@Marquee (light)', + name: 'Marquee (light)', path: '/drafts/nala/blocks/marquee/marquee-light', data: { h2Text: 'Heading XL Marquee standard medium left light', @@ -15,7 +15,19 @@ module.exports = { }, { tcid: '1', - name: '@Marquee (small)', + name: 'Marquee (light xxl-button)', + path: '/drafts/nala/blocks/marquee/marquee-light-xxl-button', + data: { + h2Text: 'Heading XL Marquee standard medium left light XXL button', + bodyText: 'Body M Lorem ipsum dolor sit amet.', + outlineButtonText: 'Lorem ipsum', + blueButtonText: 'Call to action', + }, + tags: '@marquee @m16 @marquee-background @smoke @regression @milo', + }, + { + tcid: '2', + name: 'Marquee (small)', path: '/drafts/nala/blocks/marquee/marquee-small', data: { h2Text: 'Marquee standard small dark', @@ -25,8 +37,8 @@ module.exports = { tags: '@marquee @marquee-small @smoke @regression @milo', }, { - tcid: '2', - name: '@Marquee (small,light)', + tcid: '3', + name: 'Marquee (small,light)', path: '/drafts/nala/blocks/marquee/marquee-small-light', data: { detailText: 'Detail', @@ -38,8 +50,8 @@ module.exports = { tags: '@marquee @marquee-small-light @smoke @regression @milo', }, { - tcid: '3', - name: '@Marquee (large)', + tcid: '4', + name: 'Marquee (large)', path: '/drafts/nala/blocks/marquee/marquee-large', data: { h2Text: 'Marquee Large Dark', @@ -50,8 +62,8 @@ module.exports = { tags: '@marquee @marquee-large @smoke @regression @milo', }, { - tcid: '4', - name: '@Marquee (large,light)', + tcid: '5', + name: 'Marquee (large,light)', path: '/drafts/nala/blocks/marquee/marquee-large-light', data: { h2Text: 'Marquee Large Light', @@ -62,8 +74,32 @@ module.exports = { tags: '@marquee @marquee-large-light @smoke @regression @milo', }, { - tcid: '5', - name: '@Marquee (quiet)', + tcid: '6', + name: 'Marquee (large,standard)', + path: '/drafts/nala/blocks/marquee/marquee-large-standard', + data: { + h2Text: 'Marquee Large Standard', + bodyText: 'Body XL Regular (22/33) Lorem ipsum dolor sit amet.', + outlineButtonText: 'Action', + blueButtonText: 'Action', + supplemenatalText: 'Body XL (22/33) CTA Supplemental text', + }, + tags: '@marquee @marquee-large-standard @smoke @regression @milo', + }, + { + tcid: '7', + name: 'Marquee (large,compact)', + path: '/drafts/nala/blocks/marquee/marquee-large-compact', + data: { + h2Text: 'Marquee Large Compact', + bodyText: 'Body XL Regular (22/33) Lorem ipsum dolor sit amet.', + blueButtonText: 'Action', + }, + tags: '@marquee @marquee-large-standard @smoke @regression @milo', + }, + { + tcid: '8', + name: 'Marquee (quiet)', path: '/drafts/nala/blocks/marquee/marquee-quiet', data: { detailText: 'Detail', @@ -74,8 +110,8 @@ module.exports = { tags: '@marquee @marquee-quiet @smoke @regression @milo', }, { - tcid: '6', - name: '@Marquee (inline)', + tcid: '9', + name: 'Marquee (inline)', path: '/drafts/nala/blocks/marquee/marquee-inline', data: { detailText: 'Detail', @@ -85,8 +121,8 @@ module.exports = { tags: '@marquee @marquee-inline @smoke @regression @milo', }, { - tcid: '7', - name: '@Marquee (split,small)', + tcid: '10', + name: 'Marquee (split,small)', path: '/drafts/nala/blocks/marquee/marquee-split-small', data: { detailText: 'DETAIL M BOLD 12/15 OPTIONAL', @@ -98,8 +134,8 @@ module.exports = { tags: '@marquee @marquee-split-small @smoke @regression @milo', }, { - tcid: '8', - name: '@Marquee (split,large)', + tcid: '11', + name: 'Marquee (split,large)', path: '/drafts/nala/blocks/marquee/marquee-split-large', data: { detailText: 'DETAIL L BOLD 16/20', @@ -111,8 +147,8 @@ module.exports = { tags: '@marquee @marquee-split-large @smoke @regression @milo', }, { - tcid: '9', - name: '@Marquee (split,one-third,large,light)', + tcid: '12', + name: 'Marquee (split,one-third,large,light)', path: '/drafts/nala/blocks/marquee/marquee-split-one-third-large-light', data: { detailText: 'DETAIL L BOLD 16/20', @@ -124,8 +160,8 @@ module.exports = { tags: '@marquee @marquee-split-one-third-large-light @smoke @regression @milo', }, { - tcid: '10', - name: '@Marquee (split,one-third)', + tcid: '13', + name: 'Marquee (split,one-third)', path: '/drafts/nala/blocks/marquee/marquee-split-one-third', data: { detailText: 'DETAIL M BOLD 12/15 OPTIONAL', @@ -137,8 +173,8 @@ module.exports = { tags: '@marquee @marquee-split-one-third @smoke @regression @milo', }, { - tcid: '11', - name: '@Marquee (split,one-third,small,light)', + tcid: '14', + name: 'Marquee (split,one-third,small,light)', path: '/drafts/nala/blocks/marquee/marquee-split-one-third-small-light', data: { detailText: 'DETAIL M BOLD 12/15 OPTIONAL', @@ -149,8 +185,8 @@ module.exports = { tags: '@marquee @marquee-split-one-third-small-light @smoke @regression @milo', }, { - tcid: '12', - name: '@Marquee small (background video playsinline)', + tcid: '15', + name: 'Marquee small (background video playsinline)', path: '/drafts/nala/blocks/marquee/marquee-small-background-video', data: { h2Text: 'Marquee standard small dark', @@ -160,8 +196,8 @@ module.exports = { tags: '@marquee @marquee-video @smoke @regression @milo', }, { - tcid: '13', - name: '@Marquee large (background video playsinline desktop)', + tcid: '16', + name: 'Marquee large (background video playsinline desktop)', path: '/drafts/nala/blocks/marquee/marquee-large-desktop-video-autoplay', data: { h2Text: 'Desktop video only', @@ -172,8 +208,8 @@ module.exports = { tags: '@marquee @marquee-video @smoke @regression @milo', }, { - tcid: '14', - name: '@Marquee large (background video playsinline loop once)', + tcid: '17', + name: 'Marquee large (background video playsinline loop once)', path: '/drafts/nala/blocks/marquee/video-autoplay-loop-once', data: { detailText: 'DETAIL L 16/20', @@ -183,5 +219,20 @@ module.exports = { }, tags: '@marquee @marquee-video @smoke @regression @milo', }, + { + tcid: '18', + name: 'Marquee background image focal point', + path: '/drafts/nala/blocks/marquee/marquee-background-image-focal-point', + data: { + detailText: 'This is my detail', + h2Text: 'Heading XL Marquee standard medium left', + bodyText: 'Body M Lorem ipsum dolor sit amet.', + outlineButtonText: 'Lorem ipsum', + blueButtonText: 'Learn more', + linkText: 'Text link', + + }, + tags: '@marquee @m16 @marquee-background @smoke @regression @milo', + }, ], }; diff --git a/nala/blocks/marquee/marquee.test.js b/nala/blocks/marquee/marquee.test.js index f0b61239a9..c7ca9bdebb 100644 --- a/nala/blocks/marquee/marquee.test.js +++ b/nala/blocks/marquee/marquee.test.js @@ -5,36 +5,17 @@ import MarqueeBlock from './marquee.page.js'; let webUtil; let marquee; -let consoleErrors = []; const miloLibs = process.env.MILO_LIBS || ''; -const knownConsoleErrors = [ - 'Access-Control-Allow-Origin', - 'Failed to load resource: net::ERR_FAILED', - 'adobeid-na1-stg1.services', - 'Attestation check for Topics', - 'Access to fetch at', - 'net::ERR_HTTP2_PROTOCOL_ERROR', -]; test.describe('Milo Marquee Block test suite', () => { test.beforeEach(async ({ page }) => { webUtil = new WebUtil(page); marquee = new MarqueeBlock(page); - - page.on('console', (exception) => { - if (exception.type() === 'error') { - consoleErrors.push(exception.text()); - } - }); - }); - - test.afterEach(async () => { - consoleErrors = []; }); // Test 0 : Marquee (light) - test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + test(`[Test Id - ${features[0].tcid}] ${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; @@ -61,24 +42,46 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.outlineButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); }); - - await test.step('step-4: Verify browser console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 1 : Marquee (small) - test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { + // Test 1 : Marquee (light, xxl-button) + test(`[Test Id - ${features[1].tcid}] ${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; - await test.step('step-1: Go to Marquee (small) block test page', async () => { + await test.step('step-1: Go to Marquee (light, xxl-button) block test page', async () => { await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); + await test.step('step-2: Verify Marquee (light, xxl-button) specs', async () => { + await expect(await marquee.marqueeLightXxlButton).toBeVisible(); + + await expect(await marquee.headingXL).toContainText(data.h2Text); + await expect(await marquee.bodyM).toContainText(data.bodyText); + + await expect(await marquee.outlineButtonL).toContainText(data.outlineButtonText); + await expect(await marquee.blueButtonL).toContainText(data.blueButtonText); + + await expect(await marquee.foregroundAssetImage).toBeVisible(); + + await expect(await marquee.backgroundImage).toBeVisible(); + await expect(await marquee.backgroundImage).toHaveAttribute('loading', 'eager'); + }); + }); + + // Test 2 : Marquee (small) + test(`[Test Id - ${features[2].tcid}] ${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); + const { data } = features[2]; + + await test.step('step-1: Go to Marquee (small) block test page', async () => { + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); + }); + await test.step('step-2: Verify Marquee (small) specs', async () => { await expect(await marquee.marqueeSmall).toBeVisible(); @@ -94,22 +97,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.marqueeSmall).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee', 1)); await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); }); - - await test.step('step-4: Verify browser console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 2 : Marquee (small,light) - test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); - const { data } = features[2]; + // Test 3 : Marquee (small,light) + test(`[Test Id - ${features[3].tcid}] ${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); + const { data } = features[3]; await test.step('step-1: Go to Marquee (small, light ) block test page', async () => { - await page.goto(`${baseURL}${features[2].path}${miloLibs}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (small, light) specs', async () => { @@ -130,22 +128,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.outlineButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); }); - - await test.step('step-4: Verify browser console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 3 : Marquee (large) - test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); - const { data } = features[3]; + // Test 4 : Marquee (large) + test(`[Test Id - ${features[4].tcid}] ${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); + const { data } = features[4]; await test.step('step-1: Go to Marquee (large ) block test page', async () => { - await page.goto(`${baseURL}${features[3].path}${miloLibs}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large) specs', async () => { @@ -165,22 +158,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.outlineButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); await expect(await marquee.blueButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); }); - - await test.step('step-4: Verify browser console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 4 : Marquee (large,light) - test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); - const { data } = features[4]; + // Test 5 : Marquee (large,light) + test(`[Test Id - ${features[5].tcid}] ${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); + const { data } = features[5]; await test.step('step-1: Go to Marquee (large, light ) block test page', async () => { - await page.goto(`${baseURL}${features[4].path}${miloLibs}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large, light) specs', async () => { @@ -200,22 +188,68 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.outlineButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); await expect(await marquee.blueButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); }); + }); + + // Test 6 : Marquee (large standard) + test(`[Test Id - ${features[6].tcid}] ${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); + const { data } = features[6]; + + await test.step('step-1: Go to Marquee (large standard) block test page', async () => { + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Marquee (large standard) specs', async () => { + await expect(await marquee.marqueeLargeStandardDark).toBeVisible(); + + await expect(await marquee.headingXXL).toContainText(data.h2Text); + await expect(await marquee.bodyXL).toContainText(data.bodyText); + + await expect(await marquee.outlineButtonXL).toContainText(data.outlineButtonText); + await expect(await marquee.blueButtonXL).toContainText(data.blueButtonText); + await expect(await marquee.supplementalText).toContainText(data.supplemenatalText); - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); + await expect(await marquee.foregroundAssetImage).toBeVisible(); + await expect(await marquee.backgroundImage).toBeVisible(); + await expect(await marquee.backgroundImage).toHaveAttribute('loading', 'eager'); }); }); - // Test 5 : Marquee (quiet) - test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); - const { data } = features[5]; + // Test 7 : Marquee (large compact) + test(`[Test Id - ${features[7].tcid}] ${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); + const { data } = features[7]; + + await test.step('step-1: Go to Marquee (large compact) block test page', async () => { + await page.goto(`${baseURL}${features[7].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Marquee (large compact) specs', async () => { + await expect(await marquee.marqueeLargeCompactDark).toBeVisible(); + + await expect(await marquee.headingXXL).toContainText(data.h2Text); + await expect(await marquee.bodyXL).toContainText(data.bodyText); + + await expect(await marquee.blueButtonXL).toContainText(data.blueButtonText); + + await expect(await marquee.foregroundAssetImage).toBeVisible(); + await expect(await marquee.backgroundImage).toBeVisible(); + await expect(await marquee.backgroundImage).toHaveAttribute('loading', 'eager'); + }); + }); + // Test 8 : Marquee (quiet) + test(`[Test Id - ${features[8].tcid}] ${features[8].name},${features[8].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[8].path}${miloLibs}`); + const { data } = features[8]; await test.step('step-1: Go to Marquee (quiet ) block test page', async () => { - await page.goto(`${baseURL}${features[5].path}${miloLibs}`); + await page.goto(`${baseURL}${features[8].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[8].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (quiet) specs', async () => { @@ -233,22 +267,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.marqueeQuiet).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee', 1)); await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 6 : Marquee (inline) - test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); - const { data } = features[6]; + // Test 9 : Marquee (inline) + test(`[Test Id - ${features[9].tcid}] ${features[9].name},${features[9].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[9].path}${miloLibs}`); + const { data } = features[9]; await test.step('step-1: Go to Marquee (inline ) block test page', async () => { - await page.goto(`${baseURL}${features[6].path}${miloLibs}`); + await page.goto(`${baseURL}${features[9].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[9].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (inline) specs', async () => { @@ -264,22 +293,17 @@ test.describe('Milo Marquee Block test suite', () => { await test.step('step-3: Verify analytic attributes', async () => { await expect(await marquee.marqueeInline).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee', 1)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 7 : Marquee (split,small) - test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); - const { data } = features[7]; + // Test 10: Marquee (split,small) + test(`[Test Id - ${features[10].tcid}] ${features[10].name},${features[10].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[10].path}${miloLibs}`); + const { data } = features[10]; await test.step('step-1: Go to Marquee (split, small ) block test page', async () => { - await page.goto(`${baseURL}${features[7].path}${miloLibs}`); + await page.goto(`${baseURL}${features[10].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[10].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, small) specs', async () => { @@ -299,22 +323,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.outlineButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.outlineButtonText, 1, data.h2Text)); await expect(await marquee.blueButton).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 2, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 8 : Marquee (split,large) - test(`${features[8].name},${features[8].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[8].path}${miloLibs}`); - const { data } = features[8]; + // Test 11 : Marquee (split,large) + test(`[Test Id - ${features[11].tcid}] ${features[11].name},${features[11].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[11].path}${miloLibs}`); + const { data } = features[11]; await test.step('step-1: Go to Marquee (split, large ) block test page', async () => { - await page.goto(`${baseURL}${features[8].path}${miloLibs}`); + await page.goto(`${baseURL}${features[11].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[8].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[11].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, large) specs ', async () => { @@ -338,22 +357,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.blueButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); await expect(await marquee.actionLink2).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.linkText, 2, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 9 : Marquee (split,one-third,large,light) - test(`${features[9].name},${features[9].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[9].path}${miloLibs}`); - const { data } = features[9]; + // Test 12 : Marquee (split,one-third,large,light) + test(`[Test Id - ${features[12].tcid}] ${features[12].name},${features[12].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[12].path}${miloLibs}`); + const { data } = features[12]; await test.step('step-1: Go to Marquee (split, one-third, large, light ) block test page', async () => { - await page.goto(`${baseURL}${features[9].path}${miloLibs}`); + await page.goto(`${baseURL}${features[12].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[9].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[12].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, one-third, large, light) specs', async () => { @@ -377,22 +391,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.blueButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); await expect(await marquee.actionLink2).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.linkText, 2, data.h2Text)); }); - - await test.step('step-3: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 10 : Marquee (split,one-third) - test(`${features[10].name},${features[10].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[10].path}${miloLibs}`); - const { data } = features[10]; + // Test 13 : Marquee (split,one-third) + test(`[Test Id - ${features[13].tcid}] ${features[13].name},${features[13].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[13].path}${miloLibs}`); + const { data } = features[13]; - await test.step('step-1: Go to Marquee (split, one-third ) block test page', async () => { - await page.goto(`${baseURL}${features[10].path}${miloLibs}`); + await test.step('step-1: Go to Marquee (split, one-third) block test page', async () => { + await page.goto(`${baseURL}${features[13].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[10].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[13].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, one-third) specs', async () => { @@ -416,22 +425,17 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.blueButtonL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); await expect(await marquee.actionLink2).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.linkText, 2, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 11 : Marquee (split,one-third,small,light) - test(`${features[11].name},${features[11].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[11].path}${miloLibs}`); - const { data } = features[11]; + // Test 14 : Marquee (split,one-third,small,light) + test(`[Test Id - ${features[14].tcid}] ${features[14].name},${features[14].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[14].path}${miloLibs}`); + const { data } = features[14]; await test.step('step-1: Go to Marquee (split,one-third,small,light ) block test page', async () => { - await page.goto(`${baseURL}${features[11].path}${miloLibs}`); + await page.goto(`${baseURL}${features[14].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[11].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[14].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split,one-third,small,light) specs', async () => { @@ -450,24 +454,19 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.marqueeSplitOneThirdSmallLight).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee', 1)); await expect(await marquee.blueButtonL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 12 : Marquee small (background video playsinline) - test(`${features[12].name},${features[12].tags}`, async ({ page, baseURL, browserName }) => { + // Test 15 : Marquee small (background video playsinline) + test(`[Test Id - ${features[15].tcid}] ${features[15].name},${features[15].tags}`, async ({ page, baseURL, browserName }) => { test.slow(); test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers'); - console.info(`[Test Page]: ${baseURL}${features[12].path}${miloLibs}`); - const { data } = features[12]; + console.info(`[Test Page]: ${baseURL}${features[15].path}${miloLibs}`); + const { data } = features[15]; await test.step('step-1: Go to Marquee (small) block test page', async () => { - await page.goto(`${baseURL}${features[12].path}${miloLibs}`); + await page.goto(`${baseURL}${features[15].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[12].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[15].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (small) background video playsinline specs', async () => { @@ -485,24 +484,19 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.marqueeSmallDark).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee', 1)); await expect(await marquee.blueButtonL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 13 : Marquee large (background video playsinline desktop) - test(`${features[13].name},${features[13].tags}`, async ({ page, baseURL, browserName }) => { + // Test 16: Marquee large (background video playsinline desktop) + test(`[Test Id - ${features[16].tcid}] ${features[16].name},${features[16].tags}`, async ({ page, baseURL, browserName }) => { test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers'); test.slow(); - console.info(`[Test Page]: ${baseURL}${features[13].path}${miloLibs}`); - const { data } = features[13]; + console.info(`[Test Page]: ${baseURL}${features[16].path}${miloLibs}`); + const { data } = features[16]; await test.step('step-1: Go to Marquee (large, light ) block test page', async () => { - await page.goto(`${baseURL}${features[13].path}${miloLibs}`); + await page.goto(`${baseURL}${features[16].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[13].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[16].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large, light) desktop background specs', async () => { @@ -525,26 +519,21 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.blueButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); await expect(await marquee.actionLink2).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.linkText, 2, data.h2Text)); }); - - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); - }); }); - // Test 14 : Marquee large (background video playsinline loop once) - test(`${features[14].name},${features[14].tags}`, async ({ page, baseURL }) => { + // Test 17 : Marquee large (background video playsinline loop once) + test(`[Test Id - ${features[17].tcid}] ${features[17].name},${features[17].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[14].path}${miloLibs}`); - const { data } = features[14]; + console.info(`[Test Page]: ${baseURL}${features[17].path}${miloLibs}`); + const { data } = features[17]; await test.step('step-1: Go to Marquee (large, dark ) block test page', async () => { - await page.goto(`${baseURL}${features[14].path}${miloLibs}`); + await page.goto(`${baseURL}${features[17].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[14].path}${miloLibs}`); + await expect(page).toHaveURL(`${baseURL}${features[17].path}${miloLibs}`); }); - await test.step('step-2: Verify Marquee (large, dark) background specs', async () => { + await test.step('step-2: Verify Marquee (large, dark) (background video playsinline loop once) specs', async () => { await expect(await marquee.marqueeLargeDark).toBeVisible(); await expect(await marquee.headingXXL).toContainText(data.h2Text); @@ -563,10 +552,35 @@ test.describe('Milo Marquee Block test suite', () => { await expect(await marquee.marqueeLargeDark).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('marquee', 2)); await expect(await marquee.blueButtonXL).toHaveAttribute('daa-ll', await webUtil.getLinkDaall(data.blueButtonText, 1, data.h2Text)); }); + }); + + // Test 18 : Marquee background image focal point + test(`[Test Id - ${features[18].tcid}] ${features[18].name},${features[18].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[18].path}${miloLibs}`); + const { data } = features[18]; + + await test.step('step-1: Go to Marquee ( background image focal point ) block test page', async () => { + await page.goto(`${baseURL}${features[18].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[18].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Marquee (background image focal point) specs', async () => { + await expect(await marquee.marqueeDark).toBeVisible(); + + await expect(await marquee.detailM).toContainText(data.detailText); + await expect(await marquee.headingXL).toContainText(data.h2Text); + await expect(await marquee.bodyM).toContainText(data.bodyText); + + await expect(await marquee.outlineButtonL).toContainText(data.outlineButtonText); + await expect(await marquee.blueButtonL).toContainText(data.blueButtonText); + await expect(await marquee.actionLink3).toContainText(data.linkText); - await test.step('step-4: Verify and log if any console errors', async () => { - consoleErrors.length > knownConsoleErrors.length && console.log('[Console error]:', consoleErrors); - expect.soft(consoleErrors.length).toBeLessThanOrEqual(knownConsoleErrors.length); + await expect(await marquee.iconImage).toBeVisible(); + await expect(await marquee.foregroundAssetImage).toBeVisible(); + + await expect(await marquee.backgroundImage).toBeVisible(); + await expect(await marquee.backgroundImage).toHaveAttribute('style', 'object-position: right bottom;'); }); }); });