Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-162833 [nala][MEP] confirm the "any-marquee-section" selector #3229

Merged
merged 5 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
});
Loading