diff --git a/nala/features/personalization/any-marquee-section.spec.js b/nala/features/personalization/any-marquee-section.spec.js new file mode 100644 index 0000000000..54b25eb3f1 --- /dev/null +++ b/nala/features/personalization/any-marquee-section.spec.js @@ -0,0 +1,13 @@ +module.exports = { + name: 'test the any-marquee-section selector', + features: [ + { + tcid: '0', + name: '@test the default and personalized pages', + desc: 'there should be marquees present in the default page, "replacement text" should be present in the PZN page', + path: '/drafts/nala/features/personalization/any-marquee-section/any-marquee-section', + data: { defaultURL: '/drafts/nala/features/personalization/any-marquee-section/any-marquee-section?mep=%2Fdrafts%2Fnala%2Ffeatures%2Fpersonalization%2Fany-marquee-section%2Fany-marquee-section.json--default' }, + tags: '@anymarquee0 @smoke @regression @milo ', + }, + ], +}; diff --git a/nala/features/personalization/any-marquee-section.test.js b/nala/features/personalization/any-marquee-section.test.js new file mode 100644 index 0000000000..4bd5c69fa9 --- /dev/null +++ b/nala/features/personalization/any-marquee-section.test.js @@ -0,0 +1,31 @@ +// to run the test: npm run nala stage any-marquee-section.test.js + +import { expect, test } from '@playwright/test'; +import { features } from './any-marquee-section.spec.js'; + +const miloLibs = process.env.MILO_LIBS || ''; + +// Test 0: verify the selector "any-marquee-section" +test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + const defaultURL = `${baseURL}${features[0].data.defaultURL}${miloLibs}`; + const pznURL = `${baseURL}${features[0].path}${miloLibs}`; + const PZNUpdateLocator = '[data-manifest-id="any-marquee-section.json"]'; + const marqueeLocator = '.marquee'; + const heroMarqueeLocator = '.hero-marquee'; + + await test.step('step-1: verify default test page', async () => { + console.info(`[Test Page]: ${defaultURL}`); + await page.goto(defaultURL); + await expect(page.locator(PZNUpdateLocator)).toHaveCount(0); + await expect(page.locator(marqueeLocator)).toHaveCount(18); + await expect(page.locator(heroMarqueeLocator)).toHaveCount(3); + }); + + await test.step('step-2: verify personalized page substitutions', async () => { + console.info(`[Test Page]: ${pznURL}`); + await page.goto(pznURL); + await expect(page.locator(PZNUpdateLocator)).toHaveCount(21); + await expect(page.locator(marqueeLocator)).toHaveCount(0); + await expect(page.locator(heroMarqueeLocator)).toHaveCount(0); + }); +});