Skip to content

Commit

Permalink
MWPW-162833 [nala][MEP] confirm the "any-marquee-section" selector (#…
Browse files Browse the repository at this point in the history
…3229)

* add nala test for any-marquee-section

* update instructions

* update spec file for description

* fix description in test file

* fix the name in the spec file

---------

Co-authored-by: John Pratt <jpratt@adobe.com>
  • Loading branch information
jpratt2 and John Pratt authored Nov 30, 2024
1 parent 0bbd818 commit 488a6b2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nala/features/personalization/any-marquee-section.spec.js
Original file line number Diff line number Diff line change
@@ -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 ',
},
],
};
31 changes: 31 additions & 0 deletions nala/features/personalization/any-marquee-section.test.js
Original file line number Diff line number Diff line change
@@ -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);
});
});

0 comments on commit 488a6b2

Please sign in to comment.