From 044990ff24ecfe1c80468a9edf916e4bb2b56c97 Mon Sep 17 00:00:00 2001 From: John Pratt Date: Wed, 20 Nov 2024 10:14:41 -0700 Subject: [PATCH 1/5] add nala test for any-marquee-section --- .../any-marquee-section.spec.js | 13 +++++++++ .../any-marquee-section.test.js | 29 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 nala/features/personalization/any-marquee-section.spec.js create mode 100644 nala/features/personalization/any-marquee-section.test.js 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..66f50b4d2a --- /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 page', + desc: 'there should be marquees present, not any "replacement text"', + 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..171bce7db2 --- /dev/null +++ b/nala/features/personalization/any-marquee-section.test.js @@ -0,0 +1,29 @@ +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-selector" +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); + }); +}); From 395a8b1b7faed0e059894807ebd8ecd7fdf465f0 Mon Sep 17 00:00:00 2001 From: John Pratt Date: Wed, 20 Nov 2024 10:19:07 -0700 Subject: [PATCH 2/5] update instructions --- nala/features/personalization/any-marquee-section.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nala/features/personalization/any-marquee-section.test.js b/nala/features/personalization/any-marquee-section.test.js index 171bce7db2..23c8820268 100644 --- a/nala/features/personalization/any-marquee-section.test.js +++ b/nala/features/personalization/any-marquee-section.test.js @@ -1,3 +1,5 @@ +// 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'; From ba8eabfa514e08fdb8d275ee1c323046f4323d81 Mon Sep 17 00:00:00 2001 From: John Pratt Date: Wed, 20 Nov 2024 11:16:30 -0700 Subject: [PATCH 3/5] update spec file for description --- nala/features/personalization/any-marquee-section.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/features/personalization/any-marquee-section.spec.js b/nala/features/personalization/any-marquee-section.spec.js index 66f50b4d2a..799b7ba5d2 100644 --- a/nala/features/personalization/any-marquee-section.spec.js +++ b/nala/features/personalization/any-marquee-section.spec.js @@ -4,7 +4,7 @@ module.exports = { { tcid: '0', name: '@test the default page', - desc: 'there should be marquees present, not any "replacement text"', + 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 ', From 96b93d1d9807118e0db633f52becac465ccd5d14 Mon Sep 17 00:00:00 2001 From: John Pratt Date: Wed, 20 Nov 2024 11:20:14 -0700 Subject: [PATCH 4/5] fix description in test file --- nala/features/personalization/any-marquee-section.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/features/personalization/any-marquee-section.test.js b/nala/features/personalization/any-marquee-section.test.js index 23c8820268..4bd5c69fa9 100644 --- a/nala/features/personalization/any-marquee-section.test.js +++ b/nala/features/personalization/any-marquee-section.test.js @@ -5,7 +5,7 @@ import { features } from './any-marquee-section.spec.js'; const miloLibs = process.env.MILO_LIBS || ''; -// Test 0: verify the selector "any-marquee-selector" +// 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}`; From 35d79cfbf51d52b7bc846beb2c9491c9ab642fe0 Mon Sep 17 00:00:00 2001 From: John Pratt Date: Wed, 20 Nov 2024 11:33:42 -0700 Subject: [PATCH 5/5] fix the name in the spec file --- nala/features/personalization/any-marquee-section.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/features/personalization/any-marquee-section.spec.js b/nala/features/personalization/any-marquee-section.spec.js index 799b7ba5d2..54b25eb3f1 100644 --- a/nala/features/personalization/any-marquee-section.spec.js +++ b/nala/features/personalization/any-marquee-section.spec.js @@ -3,7 +3,7 @@ module.exports = { features: [ { tcid: '0', - name: '@test the default page', + 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' },