From f6de663a9656d158d94f78ed95cd3fa7e2195a4d Mon Sep 17 00:00:00 2001 From: cod23684 Date: Wed, 20 Nov 2024 19:43:52 +0100 Subject: [PATCH 1/9] MWPW-160755 - add tests for CCD cards --- nala/features/masccd/masccd.page.js | 19 ++ nala/features/masccd/masccd.spec.js | 141 +++++++++++++++ nala/features/masccd/masccd.test.js | 258 ++++++++++++++++++++++++++++ 3 files changed, 418 insertions(+) create mode 100644 nala/features/masccd/masccd.page.js create mode 100644 nala/features/masccd/masccd.spec.js create mode 100644 nala/features/masccd/masccd.test.js diff --git a/nala/features/masccd/masccd.page.js b/nala/features/masccd/masccd.page.js new file mode 100644 index 0000000000..1a038b2d07 --- /dev/null +++ b/nala/features/masccd/masccd.page.js @@ -0,0 +1,19 @@ +export default class MasCCDPage { + constructor(page) { + this.page = page; + + this.price = page.locator('span[data-template="price"]'); + this.priceStrikethrough = page.locator('span[data-template="strikethrough"]'); + this.merchCard = page.locator('merch-card'); + this.suggestedCard = page.locator('merch-card[variant="ccd-suggested"]'); + this.suggestedCardTitle = this.page.locator('h3[slot="heading-xs"]'); + this.suggestedCardIcon = page.locator('merch-icon'); + this.suggestedCardEyebrow = page.locator('h4[slot="detail-s"]'); + this.suggestedCardDescription = page.locator('div[slot="body-xs"] p').first(); + this.suggestedCardLegalLink = page.locator('div[slot="body-xs"] p > a'); + this.suggestedCardPrice = page.locator('p[slot="price"]'); + this.suggestedCardCTA = page.locator('div[slot="cta"] a[is="checkout-link"]'); + this.sliceCard = page.locator('merch-card[variant="ccd-slice"]'); + this.sliceCardWide = page.locator('merch-card[variant="ccd-slice"][size="wide"]'); + } +} diff --git a/nala/features/masccd/masccd.spec.js b/nala/features/masccd/masccd.spec.js new file mode 100644 index 0000000000..554abf3181 --- /dev/null +++ b/nala/features/masccd/masccd.spec.js @@ -0,0 +1,141 @@ +/* eslint-disable max-len */ + +module.exports = { + FeatureName: 'Merch CCD Card Feature', + features: [ + { + tcid: '0', + name: '@MAS-CCD-suggested-eyebrow', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '0a2ac7c9-1965-488e-beca-856849305313', + title: 'Get the Photoshop plan', + eyebrow: 'INDIVIDUALS', + description: 'The full version of Photoshop plus Adobe Express Premium plan.', + price: 'US$22.99/mo', + cta: 'Buy now', + offerid: '30404A88D89A328584307175B8B27616', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '1', + name: '@MAS-CCD-suggested-strikethrough', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '549f6981-f5c8-4512-b41c-313d60f375b2', + title: 'Creative Cloud All Apps Plan', + eyebrow: 'STUDENTS AND TEACHERS', + description: 'Save over 65% on Photoshop and more than 20 apps for the first year. Plus get the first month on us when purchase by Sep 2', + price: 'US$19.99/mo', + strikethroughPrice: 'US$59.99/mo', + cta: 'Buy now', + offerid: '951DCCB08194F40B9C79951675547DF5', + linkText: 'See terms', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '2', + name: '@MAS-CCD-suggested-noeyebrow-priceunit', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '8b198434-f32d-4a77-8be0-cd6b9f7155b1', + title: 'Save 40% on Photoshop for teams and businesses', + description: 'The full version of Photoshop, Adobe Express Premium plan, plus exclusive business features', + price: 'US$37.99/mo', + cta: 'Buy now', + offerid: 'D5349E66BACCC8C1B3C1EA63348ED949', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '3', + name: '@MAS-CCD-suggested-thin', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: 'cdfae8c5-4129-43bc-a283-9ce46d07e21f', + title: 'Creative Cloud All Apps Plan', + eyebrow: 'INDIVIDUALS', + description: 'The full version of Photoshop plus Adobe Express Premium plan and more than 20 apps', + price: 'US$59.99/mo', + cta: 'Buy now', + offerid: '632B3ADD940A7FBB7864AA5AD19B8D28', + background: 'media_1d63dab9ee1edbf371d6f0548516c9e12b3ea3ff4.png', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '4', + name: '@MAS-CCD-suggested-seeterms-thin', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '33c8f437-3c39-48cc-8afd-938a13af5732', + title: 'Save over 65% on your plan', + eyebrow: 'STUDENTS AND TEACHERS', + description: 'Save over 65% on Photoshop and more than 20 apps for the first year. Plus get the first month on us until Sep 2', + price: 'US$19.99/mo', + cta: 'Buy now', + offerid: '951DCCB08194F40B9C79951675547DF5', + linkText: 'See terms', + background: 'media_1d63dab9ee1edbf371d6f0548516c9e12b3ea3ff4.png', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '5', + name: '@MAS-CCD-suggested-noeyebrow-priceunit-thin', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '45783ec8-ed85-4595-a445-3f018ac4ad9d', + title: 'Creative Cloud All Apps for teams', + description: 'The full version of Photoshop plus Adobe Express Premium plan, more than 20 apps for design, video, and exclusive business features', + price: 'US$89.99/mo', + cta: 'Buy now', + offerid: '257E1D82082387D152029F93C1030624', + background: 'media_1d63dab9ee1edbf371d6f0548516c9e12b3ea3ff4.png', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '6', + name: '@MAS-CCD-suggested-seeterms-wide', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '6217fb6d-e793-4235-af70-6f82401fc5de', + title: 'Save over 65% on your plan', + eyebrow: 'STUDENTS AND TEACHERS', + description: 'Save on Photoshop and more for the first year. Get the first month free when you purchase by Sep 2', + price: 'US$19.99/mo', + cta: 'Buy now', + offerid: '951DCCB08194F40B9C79951675547DF5', + linkText: 'See terms', + background: 'media_196e39eda2ba7ce0343ec138f3e3e41e5adcb787f.png', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + { + tcid: '7', + name: '@MAS-CCD-suggested-noeyebrow-priceunit-wide', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: 'd23182d8-fc92-483d-bcfe-d1fe3d3ce737', + title: 'Creative Cloud All Apps for teams', + description: 'The full version of Photoshop plus more than 20 apps for design, video, and exclusive business features.', + price: 'US$89.99/mo', + cta: 'Buy now', + offerid: '257E1D82082387D152029F93C1030624', + background: 'media_196e39eda2ba7ce0343ec138f3e3e41e5adcb787f.png', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @suggested-card @smoke @regression @milo', + }, + ], +}; diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js new file mode 100644 index 0000000000..8b929d9808 --- /dev/null +++ b/nala/features/masccd/masccd.test.js @@ -0,0 +1,258 @@ +import { expect, test } from '@playwright/test'; +import { features } from './masccd.spec.js'; +import MerchCCD from './masccd.page.js'; + +let CCD; + +const miloLibs = process.env.MILO_LIBS || ''; + +test.describe('CCD Merchcard feature test suite', () => { + test.beforeEach(async ({ page, browserName }) => { + CCD = new MerchCCD(page); + if (browserName === 'chromium') { + await page.setExtraHTTPHeaders({ 'sec-ch-ua': '"Chromium";v="123", "Not:A-Brand";v="8"' }); + } + }); + + // @MAS-CCD-suggested-eyebrow : CCD suggested card with eyebrow, no legal link + test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[0].path}${miloLibs}`; + const { data } = features[0]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /content\/dam/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-strikethrough : CCD suggested card with eyebrow, legal link and strikethrough price + test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[1].path}${miloLibs}`; + const { data } = features[1]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /content\/dam/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardLegalLink)).toContainText(data.linkText); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.strikethroughPrice); + const priceStyle = await card.locator(CCD.priceStrikethrough).evaluate( + (e) => window.getComputedStyle(e).getPropertyValue('text-decoration'), + ); + expect(await priceStyle).toContain('line-through'); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-noeyebrow-priceunit : CCD suggested card with no eyebrow, no legal link and price with unit text + test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[2].path}${miloLibs}`; + const { data } = features[2]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /content\/dam/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + expect(await card.locator(CCD.suggestedCardPrice).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-thin : CCD suggested card with eyebrow, no legal link and thin-strip background + test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[3].path}${miloLibs}`; + const { data } = features[3]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-seeterms-thin : CCD suggested card with eyebrow, legal link and thin-strip background + test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[4].path}${miloLibs}`; + const { data } = features[4]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardLegalLink)).toContainText(data.linkText); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText('Starting at'); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-noeyebrow-priceunit-thin : CCD suggested card with no eyebrow, no legal link and thin-strip background + test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[5].path}${miloLibs}`; + const { data } = features[5]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + expect(await card.locator(CCD.suggestedCardPrice).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-seeterms-wide : CCD suggested card with eyebrow, legal link and wide-strip background + test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[6].path}${miloLibs}`; + const { data } = features[6]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardLegalLink)).toContainText(data.linkText); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); + + // @MAS-CCD-suggested-noeyebrow-priceunit-wide : + // CCD suggested card with no eyebrow, no legal link, price with unit text and wide-strip background + test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[7].path}${miloLibs}`; + const { data } = features[7]; + const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[7].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content/specs', async () => { + await expect(card).toBeVisible(); + await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); + await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); + await expect(card.locator(CCD.suggestedCardEyebrow)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); + await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); + expect(await card.locator(CCD.suggestedCardPrice).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); + await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + }); + }); +}); From db4bf746a0fb7d5860f286ef856c75069b6d642b Mon Sep 17 00:00:00 2001 From: cod23684 Date: Fri, 22 Nov 2024 22:18:10 +0100 Subject: [PATCH 2/9] refactor and prepare dark mode checks --- nala/features/masccd/masccd.page.js | 147 +++++++++ nala/features/masccd/masccd.spec.js | 35 +- nala/features/masccd/masccd.test.js | 489 +++++++++++++++++++++------- 3 files changed, 538 insertions(+), 133 deletions(-) diff --git a/nala/features/masccd/masccd.page.js b/nala/features/masccd/masccd.page.js index 1a038b2d07..6739d6a737 100644 --- a/nala/features/masccd/masccd.page.js +++ b/nala/features/masccd/masccd.page.js @@ -15,5 +15,152 @@ export default class MasCCDPage { this.suggestedCardCTA = page.locator('div[slot="cta"] a[is="checkout-link"]'); this.sliceCard = page.locator('merch-card[variant="ccd-slice"]'); this.sliceCardWide = page.locator('merch-card[variant="ccd-slice"][size="wide"]'); + + // ASIDE PROPS: + this.suggestedCssProp = { + light: { + 'background-color': 'rgb(248, 248, 248)', + 'border-bottom-color': 'rgb(230, 230, 230)', + 'border-left-color': 'rgb(230, 230, 230)', + 'border-right-color': 'rgb(230, 230, 230)', + 'border-top-color': 'rgb(230, 230, 230)', + }, + dark: { + 'background-color': 'rgb(34, 34, 34)', + 'border-bottom-color': 'rgb(70, 70, 70)', + 'border-left-color': 'rgb(70, 70, 70)', + 'border-right-color': 'rgb(70, 70, 70)', + 'border-top-color': 'rgb(70, 70, 70)', + }, + icon: { + width: '40px', + height: '40px', + }, + title: { + light: { + color: 'rgb(34, 34, 34)', + 'font-size': '16px', + 'font-weight': '700', + }, + dark: { + color: 'rgb(248, 248, 248)', + 'font-size': '16px', + 'font-weight': '700', + }, + }, + eyebrow: { + light: { + color: 'rgb(109, 109, 109)', + 'font-size': '11px', + 'font-weight': '700', + }, + dark: { + color: 'rgb(248, 248, 248)', + 'font-size': '11px', + 'font-weight': '700', + }, + }, + description: { + light: { + color: 'rgb(70, 70, 70)', + 'font-size': '14px', + 'font-weight': '400', + }, + dark: { + color: 'rgb(248, 248, 248)', + 'font-size': '14px', + 'font-weight': '400', + }, + }, + legalLink: { + color: 'rgb(20, 122, 243)', + 'font-size': '12px', + 'font-weight': '400', + }, + price: { + light: { + color: 'rgb(34, 34, 34)', + 'font-size': '14px', + 'font-weight': '400', + }, + dark: { + color: 'rgb(248, 248, 248)', + 'font-size': '14px', + 'font-weight': '400', + }, + }, + strikethroughPrice: { + light: { + color: 'rgb(109, 109, 109)', + 'font-size': '14px', + 'font-weight': '400', + 'text-decoration-line': 'line-through', + 'text-decoration-color': 'rgb(109, 109, 109)', + }, + dark: { + color: 'rgb(109, 109, 109)', + 'font-size': '14px', + 'font-weight': '400', + 'text-decoration-line': 'line-through', + 'text-decoration-color': 'rgb(109, 109, 109)', + }, + }, + cta: { + light: { + color: 'rgb(70, 70, 70)', + 'font-size': '14px', + 'font-weight': '700', + }, + dark: { + color: 'rgb(230, 230, 230)', + 'font-size': '14px', + 'font-weight': '700', + }, + }, + }; + } + + async getSuggestedCard(id) { + return this.suggestedCard.filter({ has: this.page.locator(`aem-fragment[fragment="${id}"]`) }); + } + + async getSuggestedCardTitle(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardTitle); + } + + async getSuggestedCardIcon(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardIcon); + } + + async getSuggestedCardEyebrow(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardEyebrow); + } + + async getSuggestedCardDescription(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardDescription); + } + + async getSuggestedCardLegalLink(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardLegalLink); + } + + async getSuggestedCardPrice(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardPrice); + } + + async getSuggestedCardPriceStrikethrough(id) { + const card = await this.getSuggestedCardPrice(id); + return card.locator(this.priceStrikethrough); + } + + async getSuggestedCardCTA(id) { + const card = await this.getSuggestedCard(id); + return card.locator(this.suggestedCardCTA); } } diff --git a/nala/features/masccd/masccd.spec.js b/nala/features/masccd/masccd.spec.js index 554abf3181..a6f8b3eca7 100644 --- a/nala/features/masccd/masccd.spec.js +++ b/nala/features/masccd/masccd.spec.js @@ -15,9 +15,10 @@ module.exports = { price: 'US$22.99/mo', cta: 'Buy now', offerid: '30404A88D89A328584307175B8B27616', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '1', @@ -33,9 +34,11 @@ module.exports = { cta: 'Buy now', offerid: '951DCCB08194F40B9C79951675547DF5', linkText: 'See terms', + linkUrl: '', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '2', @@ -48,9 +51,10 @@ module.exports = { price: 'US$37.99/mo', cta: 'Buy now', offerid: 'D5349E66BACCC8C1B3C1EA63348ED949', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '3', @@ -65,13 +69,14 @@ module.exports = { cta: 'Buy now', offerid: '632B3ADD940A7FBB7864AA5AD19B8D28', background: 'media_1d63dab9ee1edbf371d6f0548516c9e12b3ea3ff4.png', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '4', - name: '@MAS-CCD-suggested-seeterms-thin', + name: '@MAS-CCD-suggested-thin-seeterms', path: '/libs/features/mas/docs/ccd.html', data: { id: '33c8f437-3c39-48cc-8afd-938a13af5732', @@ -82,14 +87,16 @@ module.exports = { cta: 'Buy now', offerid: '951DCCB08194F40B9C79951675547DF5', linkText: 'See terms', + linkUrl: '', + iconUrl: '', background: 'media_1d63dab9ee1edbf371d6f0548516c9e12b3ea3ff4.png', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '5', - name: '@MAS-CCD-suggested-noeyebrow-priceunit-thin', + name: '@MAS-CCD-suggested-thin-noeyebrow-priceunit', path: '/libs/features/mas/docs/ccd.html', data: { id: '45783ec8-ed85-4595-a445-3f018ac4ad9d', @@ -99,13 +106,14 @@ module.exports = { cta: 'Buy now', offerid: '257E1D82082387D152029F93C1030624', background: 'media_1d63dab9ee1edbf371d6f0548516c9e12b3ea3ff4.png', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '6', - name: '@MAS-CCD-suggested-seeterms-wide', + name: '@MAS-CCD-suggested-wide-seeterms', path: '/libs/features/mas/docs/ccd.html', data: { id: '6217fb6d-e793-4235-af70-6f82401fc5de', @@ -116,14 +124,16 @@ module.exports = { cta: 'Buy now', offerid: '951DCCB08194F40B9C79951675547DF5', linkText: 'See terms', + linkUrl: '', background: 'media_196e39eda2ba7ce0343ec138f3e3e41e5adcb787f.png', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, { tcid: '7', - name: '@MAS-CCD-suggested-noeyebrow-priceunit-wide', + name: '@MAS-CCD-suggested-wide-noeyebrow-priceunit', path: '/libs/features/mas/docs/ccd.html', data: { id: 'd23182d8-fc92-483d-bcfe-d1fe3d3ce737', @@ -133,9 +143,10 @@ module.exports = { cta: 'Buy now', offerid: '257E1D82082387D152029F93C1030624', background: 'media_196e39eda2ba7ce0343ec138f3e3e41e5adcb787f.png', + iconUrl: '', }, browserParams: '?theme=dark', - tags: '@mas-ccd @suggested-card @smoke @regression @milo', + tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, ], }; diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index 8b929d9808..5a33f698b6 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -1,14 +1,17 @@ import { expect, test } from '@playwright/test'; import { features } from './masccd.spec.js'; import MerchCCD from './masccd.page.js'; +import WebUtil from '../../libs/webutil.js'; let CCD; +let webUtil; const miloLibs = process.env.MILO_LIBS || ''; test.describe('CCD Merchcard feature test suite', () => { test.beforeEach(async ({ page, browserName }) => { CCD = new MerchCCD(page); + webUtil = new WebUtil(page); if (browserName === 'chromium') { await page.setExtraHTTPHeaders({ 'sec-ch-ua': '"Chromium";v="123", "Not:A-Brand";v="8"' }); } @@ -18,7 +21,6 @@ test.describe('CCD Merchcard feature test suite', () => { test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[0].path}${miloLibs}`; const { data } = features[0]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -27,18 +29,50 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(page).toHaveURL(`${baseURL}${features[0].path}`); }); - await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /content\/dam/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -46,7 +80,6 @@ test.describe('CCD Merchcard feature test suite', () => { test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[1].path}${miloLibs}`; const { data } = features[1]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -55,24 +88,56 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(page).toHaveURL(`${baseURL}${features[1].path}`); }); - await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /content\/dam/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardLegalLink)).toContainText(data.linkText); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.strikethroughPrice); - const priceStyle = await card.locator(CCD.priceStrikethrough).evaluate( - (e) => window.getComputedStyle(e).getPropertyValue('text-decoration'), - ); - expect(await priceStyle).toContain('line-through'); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).toContainText(data.linkText); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.strikethroughPrice); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPriceStrikethrough(data.id), CCD.suggestedCssProp.strikethroughPrice.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[1].path}${features[1].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${features[1].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPriceStrikethrough(data.id), CCD.suggestedCssProp.strikethroughPrice.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -80,7 +145,6 @@ test.describe('CCD Merchcard feature test suite', () => { test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[2].path}${miloLibs}`; const { data } = features[2]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -89,27 +153,56 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(page).toHaveURL(`${baseURL}${features[2].path}`); }); - await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /content\/dam/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - expect(await card.locator(CCD.suggestedCardPrice).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + expect(await (await CCD.getSuggestedCardPrice(data.id)).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[2].path}${features[2].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${features[2].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); - // @MAS-CCD-suggested-thin : CCD suggested card with eyebrow, no legal link and thin-strip background + // @MAS-CCD-thin-suggested : CCD suggested card with eyebrow, no legal link and thin-strip background test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[3].path}${miloLibs}`; const { data } = features[3]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -119,26 +212,57 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); - // @MAS-CCD-suggested-seeterms-thin : CCD suggested card with eyebrow, legal link and thin-strip background + // @MAS-CCD-suggested-thin-seeterms : CCD suggested card with eyebrow, legal link and thin-strip background test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[4].path}${miloLibs}`; const { data } = features[4]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -148,28 +272,61 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardLegalLink)).toContainText(data.linkText); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText('Starting at'); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).toContainText(data.linkText); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText('Starting at'); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[4].path}${features[4].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${features[4].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); - // @MAS-CCD-suggested-noeyebrow-priceunit-thin : CCD suggested card with no eyebrow, no legal link and thin-strip background + // @MAS-CCD-suggested-thin-noeyebrow-priceunit : CCD suggested card with no eyebrow, no legal link and thin-strip background test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[5].path}${miloLibs}`; const { data } = features[5]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -179,27 +336,55 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - expect(await card.locator(CCD.suggestedCardPrice).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + expect(await (await CCD.getSuggestedCardPrice(data.id)).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[5].path}${features[5].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${features[5].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); - // @MAS-CCD-suggested-seeterms-wide : CCD suggested card with eyebrow, legal link and wide-strip background + // @MAS-CCD-suggested-wide-seeterms : CCD suggested card with eyebrow, legal link and wide-strip background test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[6].path}${miloLibs}`; const { data } = features[6]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -209,28 +394,61 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).toContainText(data.eyebrow); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardLegalLink)).toContainText(data.linkText); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).toContainText(data.linkText); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[6].path}${features[6].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${features[6].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); - // @MAS-CCD-suggested-noeyebrow-priceunit-wide : + // @MAS-CCD-suggested-wide-noeyebrow-priceunit : // CCD suggested card with no eyebrow, no legal link, price with unit text and wide-strip background test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[7].path}${miloLibs}`; const { data } = features[7]; - const card = CCD.suggestedCard.filter({ has: page.locator(`aem-fragment[fragment="${data.id}"]`) }); console.info('[Test Page]: ', testPage); await test.step('step-1: Go to CCD Merch Card feature test page', async () => { @@ -240,19 +458,48 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(card).toBeVisible(); - await expect(card).toHaveAttribute('background-image', new RegExp(data.background)); - await expect(card.locator(CCD.suggestedCardIcon)).toHaveAttribute('src', /assets\/img/); - await expect(card.locator(CCD.suggestedCardTitle)).toContainText(data.title); - await expect(card.locator(CCD.suggestedCardEyebrow)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardDescription)).toContainText(data.description); - await expect(card.locator(CCD.suggestedCardLegalLink)).not.toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardPrice)).toContainText(data.price); - expect(await card.locator(CCD.suggestedCardPrice).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(card.locator(CCD.suggestedCardCTA)).toBeVisible(); - await expect(card.locator(CCD.suggestedCardCTA)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - expect(await card.locator(CCD.suggestedCardCTA).innerText()).toContain(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); + await expect(await CCD.getSuggestedCardEyebrow(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); + await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); + expect(await (await CCD.getSuggestedCardPrice(data.id)).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); + await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[7].path}${features[7].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${features[7].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); }); From fe0c5db2baf6b55cd170b4c844892fbd021792a1 Mon Sep 17 00:00:00 2001 From: cod23684 Date: Mon, 25 Nov 2024 16:30:31 +0100 Subject: [PATCH 3/9] add tests for slice cards --- nala/features/masccd/masccd.page.js | 287 +++++-- nala/features/masccd/masccd.spec.js | 196 +++++ nala/features/masccd/masccd.test.js | 1168 +++++++++++++++++++++------ 3 files changed, 1350 insertions(+), 301 deletions(-) diff --git a/nala/features/masccd/masccd.page.js b/nala/features/masccd/masccd.page.js index 6739d6a737..12228444c3 100644 --- a/nala/features/masccd/masccd.page.js +++ b/nala/features/masccd/masccd.page.js @@ -4,19 +4,27 @@ export default class MasCCDPage { this.price = page.locator('span[data-template="price"]'); this.priceStrikethrough = page.locator('span[data-template="strikethrough"]'); - this.merchCard = page.locator('merch-card'); + this.cardIcon = page.locator('merch-icon'); + this.cardBadge = page.locator('.ccd-slice-badge') + // suggested cards this.suggestedCard = page.locator('merch-card[variant="ccd-suggested"]'); this.suggestedCardTitle = this.page.locator('h3[slot="heading-xs"]'); - this.suggestedCardIcon = page.locator('merch-icon'); this.suggestedCardEyebrow = page.locator('h4[slot="detail-s"]'); this.suggestedCardDescription = page.locator('div[slot="body-xs"] p').first(); this.suggestedCardLegalLink = page.locator('div[slot="body-xs"] p > a'); this.suggestedCardPrice = page.locator('p[slot="price"]'); - this.suggestedCardCTA = page.locator('div[slot="cta"] a[is="checkout-link"]'); + this.suggestedCardCTA = page.locator('div[slot="cta"] > sp-button'); + this.suggestedCardCTALink = page.locator('div[slot="cta"] a[is="checkout-link"]'); + // slice cards this.sliceCard = page.locator('merch-card[variant="ccd-slice"]'); this.sliceCardWide = page.locator('merch-card[variant="ccd-slice"][size="wide"]'); + this.sliceCardImage = page.locator('div[slot="image"] img') + this.sliceCardDescription = page.locator('div[slot="body-s"] p > strong').first(); + this.sliceCardLegalLink = page.locator('div[slot="body-s"] p > a'); + this.sliceCardCTA = page.locator('div[slot="footer"] > sp-button'); + this.sliceCardCTALink = page.locator('div[slot="footer"] a[is="checkout-link"]'); - // ASIDE PROPS: + // Suggested card properties: this.suggestedCssProp = { light: { 'background-color': 'rgb(248, 248, 248)', @@ -24,6 +32,9 @@ export default class MasCCDPage { 'border-left-color': 'rgb(230, 230, 230)', 'border-right-color': 'rgb(230, 230, 230)', 'border-top-color': 'rgb(230, 230, 230)', + 'color-scheme': 'light', + 'width': '305px', + 'min-height': '205px', // change to height when loading fonts is fixed }, dark: { 'background-color': 'rgb(34, 34, 34)', @@ -31,6 +42,9 @@ export default class MasCCDPage { 'border-left-color': 'rgb(70, 70, 70)', 'border-right-color': 'rgb(70, 70, 70)', 'border-top-color': 'rgb(70, 70, 70)', + 'color-scheme': 'dark', + 'width': '305px', + 'min-height': '205px', // change to height when loading fonts is fixed }, icon: { width: '40px', @@ -38,129 +52,306 @@ export default class MasCCDPage { }, title: { light: { - color: 'rgb(34, 34, 34)', + 'color': 'rgb(34, 34, 34)', 'font-size': '16px', 'font-weight': '700', }, dark: { - color: 'rgb(248, 248, 248)', + 'color': 'rgb(248, 248, 248)', 'font-size': '16px', 'font-weight': '700', }, }, eyebrow: { light: { - color: 'rgb(109, 109, 109)', + 'color': 'rgb(109, 109, 109)', 'font-size': '11px', 'font-weight': '700', }, dark: { - color: 'rgb(248, 248, 248)', + 'color': 'rgb(248, 248, 248)', 'font-size': '11px', 'font-weight': '700', }, }, description: { light: { - color: 'rgb(70, 70, 70)', + 'color': 'rgb(70, 70, 70)', 'font-size': '14px', 'font-weight': '400', }, dark: { - color: 'rgb(248, 248, 248)', + 'color': 'rgb(248, 248, 248)', 'font-size': '14px', 'font-weight': '400', }, }, legalLink: { - color: 'rgb(20, 122, 243)', + 'color': 'rgb(20, 122, 243)', 'font-size': '12px', 'font-weight': '400', }, price: { light: { - color: 'rgb(34, 34, 34)', + 'color': 'rgb(34, 34, 34)', 'font-size': '14px', 'font-weight': '400', }, dark: { - color: 'rgb(248, 248, 248)', + 'color': 'rgb(248, 248, 248)', 'font-size': '14px', 'font-weight': '400', }, }, strikethroughPrice: { + 'color': 'rgb(109, 109, 109)', + 'font-size': '14px', + 'font-weight': '400', + 'text-decoration-line': 'line-through', + 'text-decoration-color': 'rgb(109, 109, 109)', + }, + cta: { light: { - color: 'rgb(109, 109, 109)', + 'color': 'rgb(70, 70, 70)', 'font-size': '14px', - 'font-weight': '400', - 'text-decoration-line': 'line-through', - 'text-decoration-color': 'rgb(109, 109, 109)', + 'font-weight': '700', }, dark: { - color: 'rgb(109, 109, 109)', + 'background-color': '', + 'color': 'rgb(230, 230, 230)', 'font-size': '14px', + 'font-weight': '700', + }, + }, + }; + // Slice card properties: + this.sliceCssProp = { + singleSize: { + 'width': '322px', + 'height': '154px', + }, + doubleSize: { + 'width': '600px', + 'height': '154px', + }, + light: { + 'background-color': 'rgb(248, 248, 248)', + 'border-bottom-color': 'rgb(230, 230, 230)', + 'border-left-color': 'rgb(230, 230, 230)', + 'border-right-color': 'rgb(230, 230, 230)', + 'border-top-color': 'rgb(230, 230, 230)', + 'color-scheme': 'light', + }, + dark: { + 'background-color': 'rgb(34, 34, 34)', + 'border-bottom-color': 'rgb(70, 70, 70)', + 'border-left-color': 'rgb(70, 70, 70)', + 'border-right-color': 'rgb(70, 70, 70)', + 'border-top-color': 'rgb(70, 70, 70)', + 'color-scheme': 'dark', + }, + icon: { + width: '30px', + height: '30px', + }, + badge: { + 'background-color': 'rgb(248, 217, 4)', + 'font-size': '12px', + 'font-weight': '400', + // 'height': '24px', + }, + description: { + light: { + 'color': 'rgb(34, 34, 34)', + 'font-size': '14px', + 'font-weight': '700', // fix in the code to be 700 and not strong + }, + dark: { + 'color': 'rgb(248, 248, 248)', + 'font-size': '14px', + 'font-weight': '700', + }, + }, + legalLink: { + light: { + 'color': 'rgb(34, 34, 34)', + 'font-size': '12px', + 'font-weight': '400', + }, + dark: { + // 'color': 'rgb(248, 248, 248)', // does not match figma + 'font-size': '12px', 'font-weight': '400', - 'text-decoration-line': 'line-through', - 'text-decoration-color': 'rgb(109, 109, 109)', }, }, - cta: { + price: { light: { - color: 'rgb(70, 70, 70)', + 'color': 'rgb(34, 34, 34)', 'font-size': '14px', 'font-weight': '700', }, dark: { - color: 'rgb(230, 230, 230)', + 'color': 'rgb(248, 248, 248)', 'font-size': '14px', 'font-weight': '700', }, }, + strikethroughPrice: { + 'color': 'rgb(109, 109, 109)', + 'font-size': '14px', + 'font-weight': '400', + 'text-decoration-line': 'line-through', + 'text-decoration-color': 'rgb(109, 109, 109)', + }, + cta: { + light: { + 'background-color': 'rgb(2, 101, 220)', + 'color': 'rgb(255, 255, 255)', + 'font-size': '12px', + 'font-weight': '700', + }, + dark: { + 'background-color': 'rgb(3, 103, 224)', + 'color': 'rgb(255, 255, 255)', + 'font-size': '12px', + 'font-weight': '700', + }, + }, + }; + } + + async getCard(id, cardType) { + const cardVariant = { + suggested: this.suggestedCard, + slice: this.sliceCard, + "slice-wide": this.sliceCardWide + }; + + const card = cardVariant[cardType]; + if (!card) { + throw new Error(`Invalid card type: ${cardType}`); + } + + return card.filter({ has: this.page.locator(`aem-fragment[fragment="${id}"]`) }); + } + + // General method for retrieving the locator for each card's field + async getCardField(id, cardType, fieldName) { + const card = await this.getCard(id, cardType); + + const fields = { + title: this.suggestedCardTitle, + icon: this.cardIcon, + eyebrow: this.suggestedCardEyebrow, + badge: this.cardBadge, + description: { + suggested: this.suggestedCardDescription, + slice: this.sliceCardDescription, + "slice-wide": this.sliceCardDescription + }, + legalLink: { + suggested: this.suggestedCardLegalLink, + slice: this.sliceCardLegalLink, + "slice-wide": this.sliceCardLegalLink + }, + price: { + suggested: this.suggestedCardPrice, + slice: this.price, + "slice-wide": this.price + }, + priceStrikethrough: this.priceStrikethrough, + cta: { + suggested: this.suggestedCardCTA, + slice: this.sliceCardCTA, + "slice-wide": this.sliceCardCTA + }, + ctaLink: { + suggested: this.suggestedCardCTALink, + slice: this.sliceCardCTALink, + "slice-wide": this.sliceCardCTALink + }, + image: this.sliceCardImage }; + + const fieldLocator = fields[fieldName]; + if (!fieldLocator) { + throw new Error(`Invalid field name: ${fieldName}`); + } + + if (fieldLocator[cardType]) { + return card.locator(fieldLocator[cardType]); + } + + return card.locator(fieldLocator); } - async getSuggestedCard(id) { - return this.suggestedCard.filter({ has: this.page.locator(`aem-fragment[fragment="${id}"]`) }); + // Specific methods now simplified and reusable + async getCardTitle(id, cardType) { + if (cardType !== "suggested") { + throw new Error(`Invalid card type: ${cardType}. This card tyoe does not have a title.`); + } + return this.getCardField(id, cardType, 'title'); } - async getSuggestedCardTitle(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardTitle); + async getCardIcon(id, cardType) { + return this.getCardField(id, cardType, 'icon'); } - async getSuggestedCardIcon(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardIcon); + async getCardEyebrow(id, cardType) { + if (cardType !== "suggested") { + throw new Error(`Invalid card type: ${cardType}. This card tyoe does not have a n eyebrow.`); + } + return this.getCardField(id, cardType, 'eyebrow'); } - async getSuggestedCardEyebrow(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardEyebrow); + async getCardBadge(id, cardType) { + if (cardType === "suggested") { + throw new Error('Invalid card type. "suggested" card does not have a badge.'); + } + return this.getCardField(id, cardType, 'badge'); } - async getSuggestedCardDescription(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardDescription); + async getCardDescription(id, cardType) { + return this.getCardField(id, cardType, 'description'); } - async getSuggestedCardLegalLink(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardLegalLink); + async getCardLegalLink(id, cardType) { + return this.getCardField(id, cardType, 'legalLink'); } - async getSuggestedCardPrice(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardPrice); + async getCardPrice(id, cardType) { + return this.getCardField(id, cardType, 'price'); } - async getSuggestedCardPriceStrikethrough(id) { - const card = await this.getSuggestedCardPrice(id); + async getCardPriceStrikethrough(id, cardType) { + let card; + switch(cardType) + { + case "suggested": + card = await this.getCardPrice(id, cardType); + break; + case "slice": + case "slice-wide": + card = await this.getCard(id, cardType); + break; + default: + throw new Error(`Invalid card type: ${cardType}`); + } return card.locator(this.priceStrikethrough); } - async getSuggestedCardCTA(id) { - const card = await this.getSuggestedCard(id); - return card.locator(this.suggestedCardCTA); + async getCardCTA(id, cardType) { + return this.getCardField(id, cardType, 'cta'); + } + + async getCardCTALink(id, cardType) { + return this.getCardField(id, cardType, 'ctaLink'); + } + + async getCardImage(id, cardType) { + if (cardType === "suggested") { + throw new Error('Invalid card type. "suggested" card does not have an image slot.'); + } + return this.getCardField(id, cardType, 'image'); } } diff --git a/nala/features/masccd/masccd.spec.js b/nala/features/masccd/masccd.spec.js index a6f8b3eca7..c6f2c77775 100644 --- a/nala/features/masccd/masccd.spec.js +++ b/nala/features/masccd/masccd.spec.js @@ -3,6 +3,7 @@ module.exports = { FeatureName: 'Merch CCD Card Feature', features: [ + // SUGGESTED CARDS { tcid: '0', name: '@MAS-CCD-suggested-eyebrow', @@ -148,5 +149,200 @@ module.exports = { browserParams: '?theme=dark', tags: '@mas-ccd @suggested-card @commerce @smoke @regression @milo', }, + // SLICE CARDS - SINGLE WIDTH + { + tcid: '8', + name: '@MAS-CCD-slice-percentage', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '0ef2a804-e788-4959-abb8-b4d96a18b0ef', + description: 'Save over 40% when you upgrade to Creative Cloud All apps', + percentage: '40%', + cta: 'Buy now', + offerid: '257E1D82082387D152029F93C1030624', + background: 'media-1508e7aec70760ac0ac13d9152f8030c1b67f70bf.png', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-single @commerce @smoke @regression @milo', + }, + { + tcid: '9', + name: '@MAS-CCD-slice-mnemonics', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '58c7906f-70a6-4e2b-bc29-257ff2ade513', + description: 'Creative Cloud Photography plan. Starting at', + price: 'US$9.99/mo', + cta: 'Buy now', + offerid: '7D31EB7B815967837F7882380437117D', + background: 'media_10bef5ec21c22fd7fe201cb02735082df13bf4960.jpeg', + iconLink1: 'https://www.adobe.com/products/photoshop.html', + iconLink2: 'https://www.adobe.com/products/photoshop-lightroom.html', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-single @commerce @smoke @regression @milo', + }, + { + tcid: '10', + name: '@MAS-CCD-slice-seeterms', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '51c23f28-504f-450d-9764-0e60f1e279b2', + description: 'Save 25% on Photoshop. Starting at', + linkText: 'See terms', + linkUrl: '', + price: 'US$22.99/mo', + cta: 'Buy now', + offerid: '30404A88D89A328584307175B8B27616', + background: 'media_1526ec63ba66eead46d7bde733ac7c4e994d829f1.png', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-single @commerce @smoke @regression @milo', + }, + { + tcid: '11', + name: '@MAS-CCD-slice-percentage-seeterms', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: 'c13897c7-de77-4e45-b23b-eec9fd66cad1', + description: 'Save 40% when you upgrade your plan', + percentage: '40%', + linkText: 'See terms', + linkUrl: '', + cta: 'Buy now', + offerid: '257E1D82082387D152029F93C1030624', + background: 'media-1508e7aec70760ac0ac13d9152f8030c1b67f70bf.png', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-single @commerce @smoke @regression @milo', + }, + { + tcid: '12', + name: '@MAS-CCD-slice-without-mnemonic', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '2a293069-1f9a-45ae-9840-2fa0303fe685', + description: 'Save on Creative Cloud with Mastercard', + linkText: 'See terms', + linkUrl: '', + cta: 'Get offer', + offerid: '257E1D82082387D152029F93C1030624', + background: '2024-10-16-17-03-43.jpg', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-single @commerce @smoke @regression @milo', + }, + { + tcid: '13', + name: '@MAS-CCD-slice-badge', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '3d26df5b-0784-4967-8149-8a9e59131084', + badge: 'Save 65%', + description: 'Creative Cloud All Apps for teams. Starting at', + price: 'US$89.99/mo', + cta: 'Buy now', + offerid: '257E1D82082387D152029F93C1030624', + background: 'media_158c1c22b1322dd28d7912d30fb27f29aa79f79b1.png', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-single @commerce @smoke @regression @milo', + }, + // SLICE CARDS - WIDE (DOUBLE) WIDTH + { + tcid: '14', + name: '@MAS-CCD-slice-wide-seeterms', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: 'bdf40d06-5914-4f1f-aa10-77c5676fe671', + description: 'Save over 30% on Creative Cloud All Apps. Register for MAX by August 31 and save US$200 on a full conference pass', + linkText: 'See terms', + linkUrl: '', + cta: 'Register now', + offerid: '', + background: 'media_144906e76fce812811940ce88ceded4f8d12098b5.png', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-wide @commerce @smoke @regression @milo', + }, + { + tcid: '15', + name: '@MAS-CCD-slice-wide-badge', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '31205553-b453-4c9e-a2ef-7b6aa7bfdc72', + badge: 'Huge savings*', + description: 'Save 25% on Photoshop for the first six months.', + linkText: 'See terms', + linkUrl: '', + cta: 'Buy now', + offerid: '30404A88D89A328584307175B8B27616', + background: 'media_10bef5ec21c22fd7fe201cb02735082df13bf4960.jpeg', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-wide @commerce @smoke @regression @milo', + }, + { + tcid: '16', + name: '@MAS-CCD-slice-wide-price', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: 'f3e5f2e7-df41-4300-87b9-465b3ad11abc', + description: 'Save 25% on Photoshop for the first six months', + linkText: 'See terms', + linkUrl: '', + price: 'US$22.99/mo', + cta: 'Buy now', + offerid: '30404A88D89A328584307175B8B27616', + background: 'media_10bef5ec21c22fd7fe201cb02735082df13bf4960.jpeg', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-wide @commerce @smoke @regression @milo', + }, + { + tcid: '17', + name: '@MAS-CCD-slice-wide-strikethrough', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: 'c25b20cc-e8a3-4854-b94f-51eec7d0ec25', + description: 'Creative cloud Photography plan.', + linkText: 'See terms', + linkUrl: '', + price: 'US$19.99/mo', + strikethroughPrice: 'US$22.99/mo', + cta: 'Buy now', + offerid: '951DCCB08194F40B9C79951675547DF5', + background: 'media_10bef5ec21c22fd7fe201cb02735082df13bf4960.jpeg', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-wide @commerce @smoke @regression @milo', + }, + { + tcid: '18', + name: '@MAS-CCD-slice-wide-without-mnemonic', + path: '/libs/features/mas/docs/ccd.html', + data: { + id: '6b3c6c4e-e19f-4d08-914f-fcfd9f77ca14', + description: 'Get industry-leading creative apps designed just for business. Creative Cloud All Apps for Teams. Starting at', + linkText: 'See terms', + linkUrl: '', + price: 'US$89.99/mo', + cta: 'Buy now', + offerid: '7B3FB5E4F8662A207A960BAFB6B1C21C', + background: 'media_158c1c22b1322dd28d7912d30fb27f29aa79f79b1.png', + // iconLink: '', + }, + browserParams: '?theme=dark', + tags: '@mas-ccd @slice-card @slice-wide @commerce @smoke @regression @milo', + }, ], }; diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index 5a33f698b6..6da2aef5ca 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -10,6 +10,8 @@ const miloLibs = process.env.MILO_LIBS || ''; test.describe('CCD Merchcard feature test suite', () => { test.beforeEach(async ({ page, browserName }) => { + test.skip(browserName !== 'chromium', "Not supported to run on multiple browsers."); + CCD = new MerchCCD(page); webUtil = new WebUtil(page); if (browserName === 'chromium') { @@ -17,6 +19,8 @@ test.describe('CCD Merchcard feature test suite', () => { } }); + // *** SUGGESTED CARDS: *** + // @MAS-CCD-suggested-eyebrow : CCD suggested card with eyebrow, no legal link test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { const testPage = `${baseURL}${features[0].path}${miloLibs}`; @@ -30,31 +34,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /content\/dam/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -65,14 +69,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -89,35 +93,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /content\/dam/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).toContainText(data.linkText); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.strikethroughPrice); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPriceStrikethrough(data.id), CCD.suggestedCssProp.strikethroughPrice.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "suggested"), CCD.suggestedCssProp.strikethroughPrice)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -128,16 +132,16 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPriceStrikethrough(data.id), CCD.suggestedCssProp.strikethroughPrice.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "suggested"), CCD.suggestedCssProp.strikethroughPrice)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -154,31 +158,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /content\/dam/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - expect(await (await CCD.getSuggestedCardPrice(data.id)).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + expect(await (await CCD.getCardPrice(data.id, "suggested")).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -189,13 +193,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -212,32 +216,32 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); - await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -248,14 +252,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -272,35 +276,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).toContainText(data.linkText); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText('Starting at'); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); - await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText('Starting at'); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -311,15 +315,15 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -336,31 +340,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - expect(await (await CCD.getSuggestedCardPrice(data.id)).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); - await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + expect(await (await CCD.getCardPrice(data.id, "suggested")).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -371,13 +375,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -394,34 +398,34 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).toContainText(data.eyebrow); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).toContainText(data.linkText); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); - await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -432,15 +436,15 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardEyebrow(data.id), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardLegalLink(data.id), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -458,31 +462,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardIcon(data.id)).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getSuggestedCardTitle(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardTitle(data.id)).toContainText(data.title); - await expect(await CCD.getSuggestedCardEyebrow(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardDescription(data.id)).toContainText(data.description); - await expect(await CCD.getSuggestedCardLegalLink(data.id)).not.toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardPrice(data.id)).toContainText(data.price); - expect(await (await CCD.getSuggestedCardPrice(data.id)).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(await CCD.getSuggestedCardCTA(data.id)).toBeVisible(); - await expect(await CCD.getSuggestedCardCTA(data.id)).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getSuggestedCardCTA(data.id)).toContainText(data.cta); - await expect(await CCD.getSuggestedCard(data.id)).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); + expect(await (await CCD.getCardPrice(data.id, "suggested")).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -493,13 +497,671 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getSuggestedCard(data.id)).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCard(data.id), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardIcon(data.id), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardTitle(data.id), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardDescription(data.id), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardPrice(data.id), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getSuggestedCardCTA(data.id), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); + // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // *** SLICE SINGLE CARDS: *** + + // @MAS-CCD-slice-percentage : CCD single width slice card with mnemonic, badge and price + test(`${features[8].name},${features[8].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[8].path}${miloLibs}`; + const { data } = features[8]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[8].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.percentage); + await expect(await CCD.getCardLegalLink(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[8].path}${features[8].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[8].path}${features[8].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-mnemonics : CCD single width slice card 2 mnemonics + test(`${features[9].name},${features[9].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[9].path}${miloLibs}`; + const { data } = features[9]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[9].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await (await CCD.getCardIcon(data.id, "slice")).count()).toBe(2); + // // await expect(await CCD.getCardIcon(data.id, "slice")[0]).toBeVisible(); + // expect(await (await CCD.getCardIcon(data.id, "slice"))[0]).toHaveAttribute('src', /assets\/img/); + // expect(await (await CCD.getCardIcon(data.id, "slice"))[0]).toHaveAttribute('href', data.iconLink1); + // // await expect(await CCD.getCardIcon(data.id, "slice")[1]).toBeVisible(); + // expect(await (await CCD.getCardIcon(data.id, "slice"))[1]).toHaveAttribute('src', /assets\/img/); + // expect(await (await CCD.getCardIcon(data.id, "slice"))[1]).toHaveAttribute('href', data.iconLink2); + await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[0], CCD.sliceCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[1], CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[9].path}${features[9].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[9].path}${features[9].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[0], CCD.sliceCssProp.icon)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[1], CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-seeterms : CCD single width slice card with See terms link + test(`${features[10].name},${features[10].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[10].path}${miloLibs}`; + const { data } = features[10]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[10].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[10].path}${features[10].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[10].path}${features[10].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-percentage-seeterms : CCD single width slice card with percentage and See terms link + test(`${features[11].name},${features[11].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[11].path}${miloLibs}`; + const { data } = features[11]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[11].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.percentage); + await expect(await CCD.getCardLegalLink(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[11].path}${features[11].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[11].path}${features[11].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-without-mnemonic : CCD single width slice card without mnemonic and without price + test(`${features[12].name},${features[12].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[12].path}${miloLibs}`; + const { data } = features[12]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[12].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[12].path}${features[12].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[12].path}${features[12].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-badge : CCD single width slice card with mnemonic, badge and price + test(`${features[13].name},${features[13].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[13].path}${miloLibs}`; + const { data } = features[13]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[13].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardBadge(data.id, "slice")).toContainText(data.badge); + await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice")).not.toBeVisible(); + // await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.price); + // await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice"), CCD.sliceCssProp.badge)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[13].path}${features[13].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[13].path}${features[13].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice"), CCD.sliceCssProp.badge)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + + + // *** SLICE WIDE (DOUBLE) CARDS: *** + + // @MAS-CCD-slice-wide-seeterms : CCD double width slice card with See terms link + test(`${features[14].name},${features[14].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[14].path}${miloLibs}`; + const { data } = features[14]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[14].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); + // await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[14].path}${features[14].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[14].path}${features[14].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-wide-badge : CCD double width slice card with mnemonic and badge + test(`${features[15].name},${features[15].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[15].path}${miloLibs}`; + const { data } = features[15]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[15].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardBadge(data.id, "slice-wide")).toContainText(data.badge); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).not.toBeVisible(); + // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); + // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice-wide"), CCD.sliceCssProp.badge)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[15].path}${features[15].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[15].path}${features[15].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice-wide"), CCD.sliceCssProp.badge)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-wide-price : CCD double width slice card with price + test(`${features[16].name},${features[16].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[16].path}${miloLibs}`; + const { data } = features[16]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[16].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); + // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[16].path}${features[16].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[16].path}${features[16].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-wide-strikethrough : CCD double width slice card with strikethrough price + test(`${features[17].name},${features[17].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[17].path}${miloLibs}`; + const { data } = features[17]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[17].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); + await expect(await CCD.getCardPriceStrikethrough(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardPriceStrikethrough(data.id, "slice-wide")).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[17].path}${features[17].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[17].path}${features[17].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + }); + }); + + // @MAS-CCD-slice-wide-without-mnemonic : CCD double width slice card without mnemonic + test(`${features[18].name},${features[18].tags}`, async ({ page, baseURL }) => { + const testPage = `${baseURL}${features[18].path}${miloLibs}`; + const { data } = features[18]; + console.info('[Test Page]: ', testPage); + + await test.step('step-1: Go to CCD Merch Card feature test page', async () => { + await page.goto(testPage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[18].path}`); + }); + + await test.step('step-2: Verify CCD Merch Card content', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + }); + + await test.step('step-3: Verify CCD Merch Card spec', async () => { + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + }); + + await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { + const darkThemePage = `${baseURL}${features[18].path}${features[18].browserParams}&${miloLibs}`; + await page.goto(darkThemePage); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[18].path}${features[18].browserParams}&${miloLibs}`); + }); + + await test.step('step-5: Verify CCD Merch Card spec', async () => { + await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); + }); From e933234b62dfb72ae3683425fe8af519718e4ce2 Mon Sep 17 00:00:00 2001 From: cod23684 Date: Mon, 25 Nov 2024 17:07:11 +0100 Subject: [PATCH 4/9] activate dark for suggested and eslint fixes --- nala/features/masccd/masccd.page.js | 94 ++- nala/features/masccd/masccd.test.js | 1121 +++++++++++++-------------- 2 files changed, 605 insertions(+), 610 deletions(-) diff --git a/nala/features/masccd/masccd.page.js b/nala/features/masccd/masccd.page.js index 12228444c3..ebfb30a154 100644 --- a/nala/features/masccd/masccd.page.js +++ b/nala/features/masccd/masccd.page.js @@ -5,7 +5,7 @@ export default class MasCCDPage { this.price = page.locator('span[data-template="price"]'); this.priceStrikethrough = page.locator('span[data-template="strikethrough"]'); this.cardIcon = page.locator('merch-icon'); - this.cardBadge = page.locator('.ccd-slice-badge') + this.cardBadge = page.locator('.ccd-slice-badge'); // suggested cards this.suggestedCard = page.locator('merch-card[variant="ccd-suggested"]'); this.suggestedCardTitle = this.page.locator('h3[slot="heading-xs"]'); @@ -18,7 +18,7 @@ export default class MasCCDPage { // slice cards this.sliceCard = page.locator('merch-card[variant="ccd-slice"]'); this.sliceCardWide = page.locator('merch-card[variant="ccd-slice"][size="wide"]'); - this.sliceCardImage = page.locator('div[slot="image"] img') + this.sliceCardImage = page.locator('div[slot="image"] img'); this.sliceCardDescription = page.locator('div[slot="body-s"] p > strong').first(); this.sliceCardLegalLink = page.locator('div[slot="body-s"] p > a'); this.sliceCardCTA = page.locator('div[slot="footer"] > sp-button'); @@ -33,7 +33,7 @@ export default class MasCCDPage { 'border-right-color': 'rgb(230, 230, 230)', 'border-top-color': 'rgb(230, 230, 230)', 'color-scheme': 'light', - 'width': '305px', + width: '305px', 'min-height': '205px', // change to height when loading fonts is fixed }, dark: { @@ -43,7 +43,7 @@ export default class MasCCDPage { 'border-right-color': 'rgb(70, 70, 70)', 'border-top-color': 'rgb(70, 70, 70)', 'color-scheme': 'dark', - 'width': '305px', + width: '305px', 'min-height': '205px', // change to height when loading fonts is fixed }, icon: { @@ -52,59 +52,59 @@ export default class MasCCDPage { }, title: { light: { - 'color': 'rgb(34, 34, 34)', + color: 'rgb(34, 34, 34)', 'font-size': '16px', 'font-weight': '700', }, dark: { - 'color': 'rgb(248, 248, 248)', + // 'color': 'rgb(248, 248, 248)', // page not consistent with figma 'font-size': '16px', 'font-weight': '700', }, }, eyebrow: { light: { - 'color': 'rgb(109, 109, 109)', + color: 'rgb(109, 109, 109)', 'font-size': '11px', 'font-weight': '700', }, dark: { - 'color': 'rgb(248, 248, 248)', + // 'color': 'rgb(248, 248, 248)', // page not consistent with figma 'font-size': '11px', 'font-weight': '700', }, }, description: { light: { - 'color': 'rgb(70, 70, 70)', + color: 'rgb(70, 70, 70)', 'font-size': '14px', 'font-weight': '400', }, dark: { - 'color': 'rgb(248, 248, 248)', + color: 'rgb(248, 248, 248)', 'font-size': '14px', 'font-weight': '400', }, }, legalLink: { - 'color': 'rgb(20, 122, 243)', + color: 'rgb(20, 122, 243)', // dark mode not consistent with figma 'font-size': '12px', 'font-weight': '400', }, price: { light: { - 'color': 'rgb(34, 34, 34)', + color: 'rgb(34, 34, 34)', 'font-size': '14px', 'font-weight': '400', }, dark: { - 'color': 'rgb(248, 248, 248)', + // 'color': 'rgb(248, 248, 248)', // page not consistent with figma 'font-size': '14px', 'font-weight': '400', }, }, strikethroughPrice: { - 'color': 'rgb(109, 109, 109)', + color: 'rgb(109, 109, 109)', 'font-size': '14px', 'font-weight': '400', 'text-decoration-line': 'line-through', @@ -112,13 +112,12 @@ export default class MasCCDPage { }, cta: { light: { - 'color': 'rgb(70, 70, 70)', + // 'color': 'rgb(70, 70, 70)', // page not consistent with figma 'font-size': '14px', 'font-weight': '700', }, dark: { - 'background-color': '', - 'color': 'rgb(230, 230, 230)', + color: 'rgb(230, 230, 230)', 'font-size': '14px', 'font-weight': '700', }, @@ -127,12 +126,12 @@ export default class MasCCDPage { // Slice card properties: this.sliceCssProp = { singleSize: { - 'width': '322px', - 'height': '154px', + width: '322px', + height: '154px', }, doubleSize: { - 'width': '600px', - 'height': '154px', + width: '600px', + height: '154px', }, light: { 'background-color': 'rgb(248, 248, 248)', @@ -158,46 +157,46 @@ export default class MasCCDPage { 'background-color': 'rgb(248, 217, 4)', 'font-size': '12px', 'font-weight': '400', - // 'height': '24px', + // 'height': '24px', // page does not match figma }, description: { light: { - 'color': 'rgb(34, 34, 34)', + color: 'rgb(34, 34, 34)', 'font-size': '14px', 'font-weight': '700', // fix in the code to be 700 and not strong }, dark: { - 'color': 'rgb(248, 248, 248)', + color: 'rgb(248, 248, 248)', 'font-size': '14px', 'font-weight': '700', }, }, legalLink: { light: { - 'color': 'rgb(34, 34, 34)', + color: 'rgb(34, 34, 34)', 'font-size': '12px', 'font-weight': '400', }, dark: { - // 'color': 'rgb(248, 248, 248)', // does not match figma + // 'color': 'rgb(248, 248, 248)', // page does not match figma 'font-size': '12px', 'font-weight': '400', }, }, price: { light: { - 'color': 'rgb(34, 34, 34)', + color: 'rgb(34, 34, 34)', 'font-size': '14px', 'font-weight': '700', }, dark: { - 'color': 'rgb(248, 248, 248)', + color: 'rgb(248, 248, 248)', 'font-size': '14px', 'font-weight': '700', }, }, strikethroughPrice: { - 'color': 'rgb(109, 109, 109)', + color: 'rgb(109, 109, 109)', 'font-size': '14px', 'font-weight': '400', 'text-decoration-line': 'line-through', @@ -206,25 +205,25 @@ export default class MasCCDPage { cta: { light: { 'background-color': 'rgb(2, 101, 220)', - 'color': 'rgb(255, 255, 255)', + color: 'rgb(255, 255, 255)', 'font-size': '12px', 'font-weight': '700', }, dark: { 'background-color': 'rgb(3, 103, 224)', - 'color': 'rgb(255, 255, 255)', + color: 'rgb(255, 255, 255)', 'font-size': '12px', 'font-weight': '700', }, }, - }; + }; } async getCard(id, cardType) { const cardVariant = { suggested: this.suggestedCard, slice: this.sliceCard, - "slice-wide": this.sliceCardWide + 'slice-wide': this.sliceCardWide, }; const card = cardVariant[cardType]; @@ -247,30 +246,30 @@ export default class MasCCDPage { description: { suggested: this.suggestedCardDescription, slice: this.sliceCardDescription, - "slice-wide": this.sliceCardDescription + 'slice-wide': this.sliceCardDescription, }, legalLink: { suggested: this.suggestedCardLegalLink, slice: this.sliceCardLegalLink, - "slice-wide": this.sliceCardLegalLink + 'slice-wide': this.sliceCardLegalLink, }, price: { suggested: this.suggestedCardPrice, slice: this.price, - "slice-wide": this.price + 'slice-wide': this.price, }, priceStrikethrough: this.priceStrikethrough, cta: { suggested: this.suggestedCardCTA, slice: this.sliceCardCTA, - "slice-wide": this.sliceCardCTA + 'slice-wide': this.sliceCardCTA, }, ctaLink: { suggested: this.suggestedCardCTALink, slice: this.sliceCardCTALink, - "slice-wide": this.sliceCardCTALink + 'slice-wide': this.sliceCardCTALink, }, - image: this.sliceCardImage + image: this.sliceCardImage, }; const fieldLocator = fields[fieldName]; @@ -287,7 +286,7 @@ export default class MasCCDPage { // Specific methods now simplified and reusable async getCardTitle(id, cardType) { - if (cardType !== "suggested") { + if (cardType !== 'suggested') { throw new Error(`Invalid card type: ${cardType}. This card tyoe does not have a title.`); } return this.getCardField(id, cardType, 'title'); @@ -298,14 +297,14 @@ export default class MasCCDPage { } async getCardEyebrow(id, cardType) { - if (cardType !== "suggested") { + if (cardType !== 'suggested') { throw new Error(`Invalid card type: ${cardType}. This card tyoe does not have a n eyebrow.`); } return this.getCardField(id, cardType, 'eyebrow'); } async getCardBadge(id, cardType) { - if (cardType === "suggested") { + if (cardType === 'suggested') { throw new Error('Invalid card type. "suggested" card does not have a badge.'); } return this.getCardField(id, cardType, 'badge'); @@ -325,13 +324,12 @@ export default class MasCCDPage { async getCardPriceStrikethrough(id, cardType) { let card; - switch(cardType) - { - case "suggested": + switch (cardType) { + case 'suggested': card = await this.getCardPrice(id, cardType); break; - case "slice": - case "slice-wide": + case 'slice': + case 'slice-wide': card = await this.getCard(id, cardType); break; default: @@ -349,7 +347,7 @@ export default class MasCCDPage { } async getCardImage(id, cardType) { - if (cardType === "suggested") { + if (cardType === 'suggested') { throw new Error('Invalid card type. "suggested" card does not have an image slot.'); } return this.getCardField(id, cardType, 'image'); diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index 6da2aef5ca..6d52ea80a4 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -10,7 +10,7 @@ const miloLibs = process.env.MILO_LIBS || ''; test.describe('CCD Merchcard feature test suite', () => { test.beforeEach(async ({ page, browserName }) => { - test.skip(browserName !== 'chromium', "Not supported to run on multiple browsers."); + test.skip(browserName !== 'chromium', 'Not supported to run on multiple browsers.'); CCD = new MerchCCD(page); webUtil = new WebUtil(page); @@ -34,31 +34,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /content\/dam/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -69,14 +69,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -93,35 +93,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /content\/dam/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.strikethroughPrice); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "suggested"), CCD.suggestedCssProp.strikethroughPrice)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'suggested'), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, 'suggested'), CCD.suggestedCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -132,16 +132,16 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "suggested"), CCD.suggestedCssProp.strikethroughPrice)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, 'suggested'), CCD.suggestedCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -158,31 +158,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /content\/dam/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - expect(await (await CCD.getCardPrice(data.id, "suggested")).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /content\/dam/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -193,13 +193,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -216,32 +216,32 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); - await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -252,14 +252,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -276,35 +276,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText('Starting at'); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); - await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText('Starting at'); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'suggested'), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -315,15 +315,15 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -340,31 +340,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - expect(await (await CCD.getCardPrice(data.id, "suggested")).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); - await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -375,13 +375,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -398,34 +398,34 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).toContainText(data.eyebrow); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); - await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).toContainText(data.eyebrow); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'suggested'), CCD.suggestedCssProp.legalLink)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -436,15 +436,15 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, "suggested"), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardEyebrow(data.id, 'suggested'), CCD.suggestedCssProp.eyebrow.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "suggested"), CCD.suggestedCssProp.legalLink)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -462,31 +462,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content/specs', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "suggested")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardTitle(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardTitle(data.id, "suggested")).toContainText(data.title); - await expect(await CCD.getCardEyebrow(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "suggested")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "suggested")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "suggested")).toContainText(data.price); - expect(await (await CCD.getCardPrice(data.id, "suggested")).locator('.price-unit-type').innerText()).not.toBe(''); - await expect(await CCD.getCardCTA(data.id, "suggested")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "suggested")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "suggested")).toContainText(data.cta); - await expect(await CCD.getCard(data.id, "suggested")).toHaveAttribute('background-image', new RegExp(data.background)); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardTitle(data.id, 'suggested')).toContainText(data.title); + await expect(await CCD.getCardEyebrow(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); + expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -497,13 +497,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "suggested")).toBeVisible(); - // expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "suggested"), CCD.suggestedCssProp.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "suggested"), CCD.suggestedCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, "suggested"), CCD.suggestedCssProp.title.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "suggested"), CCD.suggestedCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "suggested"), CCD.suggestedCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "suggested"), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'suggested'), CCD.suggestedCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'suggested'), CCD.suggestedCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardTitle(data.id, 'suggested'), CCD.suggestedCssProp.title.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'suggested'), CCD.suggestedCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'suggested'), CCD.suggestedCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'suggested'), CCD.suggestedCssProp.cta.dark)).toBeTruthy(); }); }); @@ -522,28 +522,28 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.percentage); - await expect(await CCD.getCardLegalLink(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.percentage); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -554,12 +554,12 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -576,35 +576,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await (await CCD.getCardIcon(data.id, "slice")).count()).toBe(2); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await (await CCD.getCardIcon(data.id, 'slice')).count()).toBe(2); // // await expect(await CCD.getCardIcon(data.id, "slice")[0]).toBeVisible(); // expect(await (await CCD.getCardIcon(data.id, "slice"))[0]).toHaveAttribute('src', /assets\/img/); // expect(await (await CCD.getCardIcon(data.id, "slice"))[0]).toHaveAttribute('href', data.iconLink1); // // await expect(await CCD.getCardIcon(data.id, "slice")[1]).toBeVisible(); // expect(await (await CCD.getCardIcon(data.id, "slice"))[1]).toHaveAttribute('src', /assets\/img/); // expect(await (await CCD.getCardIcon(data.id, "slice"))[1]).toHaveAttribute('href', data.iconLink2); - await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.price); - await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[0], CCD.sliceCssProp.icon)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[1], CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -615,14 +615,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[0], CCD.sliceCssProp.icon)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[1], CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -639,31 +639,31 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.price); - await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -674,14 +674,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -698,30 +698,30 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.percentage); - await expect(await CCD.getCardLegalLink(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.percentage); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -732,13 +732,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -755,27 +755,27 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardBadge(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice")).not.toBeVisible(); - await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -786,12 +786,12 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -808,35 +808,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardBadge(data.id, "slice")).toContainText(data.badge); - await expect(await CCD.getCardImage(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice")).not.toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardBadge(data.id, 'slice')).toContainText(data.badge); + await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).not.toBeVisible(); // await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.price); + await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); // await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.strikethroughPrice); - await expect(await CCD.getCardCTA(data.id, "slice")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice")).toContainText(data.cta); + await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice"), CCD.sliceCssProp.badge)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice'), CCD.sliceCssProp.badge)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.light)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -847,21 +847,19 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice"), CCD.sliceCssProp.singleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice"), CCD.sliceCssProp.badge)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice'), CCD.sliceCssProp.badge)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice"), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.dark)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); - - // *** SLICE WIDE (DOUBLE) CARDS: *** // @MAS-CCD-slice-wide-seeterms : CCD double width slice card with See terms link @@ -877,29 +875,29 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).not.toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).not.toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); // await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -910,13 +908,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -933,35 +931,35 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardBadge(data.id, "slice-wide")).toContainText(data.badge); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).not.toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardBadge(data.id, 'slice-wide')).toContainText(data.badge); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).not.toBeVisible(); // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.strikethroughPrice); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice-wide"), CCD.sliceCssProp.badge)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice-wide'), CCD.sliceCssProp.badge)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -972,16 +970,16 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, "slice-wide"), CCD.sliceCssProp.badge)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice-wide'), CCD.sliceCssProp.badge)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.dark)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -998,32 +996,32 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.strikethroughPrice); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice-wide'), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -1034,14 +1032,14 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice-wide'), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -1058,34 +1056,34 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).toHaveAttribute('src', /assets\/img/); - await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); - await expect(await CCD.getCardPriceStrikethrough(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardPriceStrikethrough(data.id, "slice-wide")).toContainText(data.strikethroughPrice); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); + await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); + await expect(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide')).toContainText(data.strikethroughPrice); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice-wide'), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide'), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -1096,15 +1094,15 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice-wide"), CCD.sliceCssProp.icon)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice-wide'), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice-wide'), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide'), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -1121,29 +1119,29 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-2: Verify CCD Merch Card content', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardIcon(data.id, "slice-wide")).not.toBeVisible(); - await expect(await CCD.getCardBadge(data.id, "slice-wide")).not.toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardImage(data.id, "slice-wide")).toHaveAttribute('src', new RegExp(data.background)); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardDescription(data.id, "slice-wide")).toContainText(data.description); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardLegalLink(data.id, "slice-wide")).toContainText(data.linkText); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toBeVisible(); - await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); - await expect(await CCD.getCardCTA(data.id, "slice-wide")).toContainText(data.cta); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardIcon(data.id, 'slice-wide')).not.toBeVisible(); + await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardImage(data.id, 'slice-wide')).toHaveAttribute('src', new RegExp(data.background)); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice-wide'), CCD.sliceCssProp.price.light)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); await test.step('step-4: Go to CCD Merch Card feature test page in dark mode', async () => { @@ -1154,14 +1152,13 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - await expect(await CCD.getCard(data.id, "slice-wide")).toBeVisible(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCard(data.id, "slice-wide"), CCD.sliceCssProp.doubleSize)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice-wide"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, "slice-wide"), CCD.sliceCssProp.description.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); - expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, "slice-wide"), CCD.sliceCssProp.cta.dark)).toBeTruthy(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice-wide'), CCD.sliceCssProp.doubleSize)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice-wide'), CCD.sliceCssProp.price.dark)).toBeTruthy(); + expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); - }); From 675b44451e07683bde07b0b78620b3e4263905fc Mon Sep 17 00:00:00 2001 From: cod23684 Date: Mon, 25 Nov 2024 17:19:44 +0100 Subject: [PATCH 5/9] add check for cta variant --- nala/features/masccd/masccd.test.js | 32 +++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index 6d52ea80a4..607eadd0d7 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -47,6 +47,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); }); @@ -108,6 +109,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); }); @@ -171,6 +173,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); }); @@ -229,6 +232,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); @@ -291,6 +295,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText('Starting at'); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); @@ -353,6 +358,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); @@ -412,6 +418,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); @@ -475,6 +482,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); @@ -534,6 +542,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardLegalLink(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); @@ -593,6 +602,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); @@ -652,6 +662,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); @@ -711,6 +722,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); @@ -766,6 +778,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); @@ -818,11 +831,10 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice')).not.toBeVisible(); - // await expect(await CCD.getCardLegalLink(data.id, "slice")).toContainText(data.linkText); await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); - // await expect(await CCD.getCardPrice(data.id, "slice")).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); }); @@ -833,9 +845,7 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice'), CCD.sliceCssProp.badge)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); @@ -852,10 +862,8 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, 'slice'), CCD.sliceCssProp.icon)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice'), CCD.sliceCssProp.badge)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, "slice"), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -887,6 +895,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); // await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); @@ -943,9 +952,8 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).not.toBeVisible(); - // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.price); - // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); @@ -957,8 +965,6 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice-wide'), CCD.sliceCssProp.badge)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.light)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.light)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.light)).toBeTruthy(); }); @@ -977,8 +983,6 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await webUtil.verifyCSS(await CCD.getCardBadge(data.id, 'slice-wide'), CCD.sliceCssProp.badge)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardLegalLink(data.id, 'slice-wide'), CCD.sliceCssProp.legalLink.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice-wide'), CCD.sliceCssProp.description.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, "slice-wide"), CCD.sliceCssProp.price.dark)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardPriceStrikethrough(data.id, "slice-wide"), CCD.sliceCssProp.strikethroughPrice)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice-wide'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); }); }); @@ -1008,8 +1012,8 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); - // await expect(await CCD.getCardPrice(data.id, "slice-wide")).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); @@ -1071,6 +1075,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide')).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); @@ -1131,6 +1136,7 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); }); From 4bec939da9f465b48f314b8d33f96d25992fc705 Mon Sep 17 00:00:00 2001 From: cod23684 Date: Mon, 25 Nov 2024 18:04:09 +0100 Subject: [PATCH 6/9] fix multi mnemonic check --- nala/features/masccd/masccd.test.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index 607eadd0d7..d2a4fc359a 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -586,13 +586,14 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); - expect(await (await CCD.getCardIcon(data.id, 'slice')).count()).toBe(2); - // // await expect(await CCD.getCardIcon(data.id, "slice")[0]).toBeVisible(); - // expect(await (await CCD.getCardIcon(data.id, "slice"))[0]).toHaveAttribute('src', /assets\/img/); - // expect(await (await CCD.getCardIcon(data.id, "slice"))[0]).toHaveAttribute('href', data.iconLink1); - // // await expect(await CCD.getCardIcon(data.id, "slice")[1]).toBeVisible(); - // expect(await (await CCD.getCardIcon(data.id, "slice"))[1]).toHaveAttribute('src', /assets\/img/); - // expect(await (await CCD.getCardIcon(data.id, "slice"))[1]).toHaveAttribute('href', data.iconLink2); + let cardIcons = await CCD.getCardIcon(data.id, 'slice'); + expect(await cardIcons.count()).toBe(2); + expect(await cardIcons.nth(0)).toBeVisible(); + expect(await cardIcons.nth(0)).toHaveAttribute('src', /assets\/img/); + expect(await cardIcons.nth(0)).toHaveAttribute('href', data.iconLink1); + expect(await cardIcons.nth(1)).toBeVisible(); + expect(await cardIcons.nth(1)).toHaveAttribute('src', /assets\/img/); + expect(await cardIcons.nth(1)).toHaveAttribute('href', data.iconLink2); await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardImage(data.id, 'slice')).toHaveAttribute('src', new RegExp(data.background)); @@ -608,10 +609,11 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-3: Verify CCD Merch Card spec', async () => { + let cardIcons = await CCD.getCardIcon(data.id, 'slice'); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[0], CCD.sliceCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[1], CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await cardIcons.nth(0), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await cardIcons.nth(1), CCD.sliceCssProp.icon)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.light)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.light)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.light)).toBeTruthy(); @@ -625,11 +627,12 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { + let cardIcons = await CCD.getCardIcon(data.id, 'slice'); await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[0], CCD.sliceCssProp.icon)).toBeTruthy(); - // expect(await webUtil.verifyCSS(await CCD.getCardIcon(data.id, "slice")[1], CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await cardIcons.nth(0), CCD.sliceCssProp.icon)).toBeTruthy(); + expect(await webUtil.verifyCSS(await cardIcons.nth(1), CCD.sliceCssProp.icon)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardDescription(data.id, 'slice'), CCD.sliceCssProp.description.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardPrice(data.id, 'slice'), CCD.sliceCssProp.price.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCardCTA(data.id, 'slice'), CCD.sliceCssProp.cta.dark)).toBeTruthy(); From 89aeb7d91fbfa9ce145dd6cd82503aa4e2de2c12 Mon Sep 17 00:00:00 2001 From: cod23684 Date: Mon, 25 Nov 2024 18:05:58 +0100 Subject: [PATCH 7/9] fix lint --- nala/features/masccd/masccd.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index d2a4fc359a..0d3d28da9f 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -586,7 +586,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); - let cardIcons = await CCD.getCardIcon(data.id, 'slice'); + const cardIcons = await CCD.getCardIcon(data.id, 'slice'); expect(await cardIcons.count()).toBe(2); expect(await cardIcons.nth(0)).toBeVisible(); expect(await cardIcons.nth(0)).toHaveAttribute('src', /assets\/img/); @@ -609,7 +609,7 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-3: Verify CCD Merch Card spec', async () => { - let cardIcons = await CCD.getCardIcon(data.id, 'slice'); + const cardIcons = await CCD.getCardIcon(data.id, 'slice'); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.light)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); expect(await webUtil.verifyCSS(await cardIcons.nth(0), CCD.sliceCssProp.icon)).toBeTruthy(); @@ -627,7 +627,7 @@ test.describe('CCD Merchcard feature test suite', () => { }); await test.step('step-5: Verify CCD Merch Card spec', async () => { - let cardIcons = await CCD.getCardIcon(data.id, 'slice'); + const cardIcons = await CCD.getCardIcon(data.id, 'slice'); await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.dark)).toBeTruthy(); expect(await webUtil.verifyCSS(await CCD.getCard(data.id, 'slice'), CCD.sliceCssProp.singleSize)).toBeTruthy(); From e07e729dae1f293ef7e7567f40eeb848c8599f63 Mon Sep 17 00:00:00 2001 From: cod23684 Date: Tue, 26 Nov 2024 11:11:23 +0100 Subject: [PATCH 8/9] add analytics check --- nala/features/masccd/masccd.test.js | 87 ++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 19 deletions(-) diff --git a/nala/features/masccd/masccd.test.js b/nala/features/masccd/masccd.test.js index 0d3d28da9f..5d9c1a7865 100644 --- a/nala/features/masccd/masccd.test.js +++ b/nala/features/masccd/masccd.test.js @@ -35,6 +35,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /content\/dam/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -48,8 +49,9 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -95,6 +97,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /content\/dam/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -105,13 +108,15 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -161,6 +166,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /content\/dam/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -174,8 +180,9 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -220,6 +227,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content/specs', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -233,8 +241,9 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); @@ -281,6 +290,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content/specs', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -291,13 +301,15 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText('Starting at'); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); @@ -346,6 +358,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content/specs', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -359,8 +372,9 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); @@ -405,6 +419,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content/specs', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -415,12 +430,14 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'suggested')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'suggested')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); @@ -470,6 +487,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content/specs', async () => { await expect(await CCD.getCard(data.id, 'suggested')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'suggested')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardTitle(data.id, 'suggested')).toBeVisible(); @@ -483,8 +501,9 @@ test.describe('CCD Merchcard feature test suite', () => { expect(await (await CCD.getCardPrice(data.id, 'suggested')).locator('.price-unit-type').innerText()).not.toBe(''); await expect(await CCD.getCardCTA(data.id, 'suggested')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'suggested')).toHaveAttribute('variant', 'primary'); - await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'suggested')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'suggested')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCard(data.id, 'suggested')).toHaveAttribute('background-image', new RegExp(data.background)); }); @@ -531,6 +550,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); @@ -543,8 +563,9 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -586,6 +607,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toHaveAttribute('daa-lh', /.*/); const cardIcons = await CCD.getCardIcon(data.id, 'slice'); expect(await cardIcons.count()).toBe(2); expect(await cardIcons.nth(0)).toBeVisible(); @@ -604,8 +626,9 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -653,6 +676,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); @@ -662,12 +686,14 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -713,6 +739,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); @@ -723,11 +750,13 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.percentage); await expect(await CCD.getCardLegalLink(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -771,6 +800,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardBadge(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardImage(data.id, 'slice')).toBeVisible(); @@ -779,11 +809,13 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -825,6 +857,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice')).toBeVisible(); @@ -838,8 +871,9 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -887,6 +921,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); @@ -897,10 +932,12 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardPrice(data.id, 'slice-wide')).not.toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); - // await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); + // await expect(await CCD.getCardCTALink(data.id, "slice-wide")).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + // await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -944,6 +981,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice-wide')).toBeVisible(); @@ -954,11 +992,13 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).not.toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -1004,6 +1044,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); @@ -1013,12 +1054,14 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -1064,6 +1107,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).toHaveAttribute('src', /assets\/img/); await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); @@ -1073,14 +1117,16 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); await expect(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPriceStrikethrough(data.id, 'slice-wide')).toContainText(data.strikethroughPrice); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { @@ -1128,6 +1174,7 @@ test.describe('CCD Merchcard feature test suite', () => { await test.step('step-2: Verify CCD Merch Card content', async () => { await expect(await CCD.getCard(data.id, 'slice-wide')).toBeVisible(); + await expect(await CCD.getCard(data.id, 'slice-wide')).toHaveAttribute('daa-lh', /.*/); await expect(await CCD.getCardIcon(data.id, 'slice-wide')).not.toBeVisible(); await expect(await CCD.getCardBadge(data.id, 'slice-wide')).not.toBeVisible(); await expect(await CCD.getCardImage(data.id, 'slice-wide')).toBeVisible(); @@ -1136,12 +1183,14 @@ test.describe('CCD Merchcard feature test suite', () => { await expect(await CCD.getCardDescription(data.id, 'slice-wide')).toContainText(data.description); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toContainText(data.linkText); + await expect(await CCD.getCardLegalLink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardPrice(data.id, 'slice-wide')).toContainText(data.price); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toBeVisible(); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toHaveAttribute('variant', 'accent'); - await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); await expect(await CCD.getCardCTA(data.id, 'slice-wide')).toContainText(data.cta); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('href', new RegExp(`${data.offerid}`)); + await expect(await CCD.getCardCTALink(data.id, 'slice-wide')).toHaveAttribute('data-analytics-id', /.*/); }); await test.step('step-3: Verify CCD Merch Card spec', async () => { From d7f5e115ae3ebd71d6a64dd08fc93218b8056295 Mon Sep 17 00:00:00 2001 From: cod23684 Date: Tue, 26 Nov 2024 17:07:35 +0100 Subject: [PATCH 9/9] remove comment --- nala/features/masccd/masccd.page.js | 1 - 1 file changed, 1 deletion(-) diff --git a/nala/features/masccd/masccd.page.js b/nala/features/masccd/masccd.page.js index ebfb30a154..58614d94f1 100644 --- a/nala/features/masccd/masccd.page.js +++ b/nala/features/masccd/masccd.page.js @@ -284,7 +284,6 @@ export default class MasCCDPage { return card.locator(fieldLocator); } - // Specific methods now simplified and reusable async getCardTitle(id, cardType) { if (cardType !== 'suggested') { throw new Error(`Invalid card type: ${cardType}. This card tyoe does not have a title.`);