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-162093 [MEP][NALA] add 2 more legacy tests #3175

Open
wants to merge 1 commit into
base: stage
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions nala/features/personalization/personalization.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,21 @@ module.exports = {
},
tags: '@pzn @smoke @regression @milo ',
},
{
tcid: '3',
name: '@Replace Fragment',
desc: 'Personalization with action=replaceFragment',
path: '/drafts/nala/features/personalization/legacy/replace-fragment',
data: { defaultURLpath: '/drafts/nala/features/personalization/legacy/replace-fragment?mep=%2Fdrafts%2Fnala%2Ffeatures%2Fpersonalization%2Flegacy%2Freplace-fragment.json--default' },
tags: '@pzn @pzn3 @smoke @regression @milo ',
},
{
tcid: '4',
name: '@Remove Content',
desc: 'Personalization with action=removeContent',
path: '/drafts/nala/features/personalization/legacy/remove-content',
data: { defaultURLpath: '/drafts/nala/features/personalization/legacy/remove-content?mep=%2Fdrafts%2Fnala%2Ffeatures%2Fpersonalization%2Flegacy%2Fremove-content.json--default' },
tags: '@pzn @pzn4 @smoke @regression @milo ',
},
],
};
43 changes: 43 additions & 0 deletions nala/features/personalization/personalization.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,47 @@ test.describe('Milo Personalization feature test suite', () => {
await expect(await text.text).toHaveAttribute('daa-lh', textBlockDll);
});
});
// Test 3 : Personalization (replaceFragment)
test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => {
text = new TextBlock(page);
marquee = new MarqueeBlock(page);
const { data } = features[3];
const pznURL = `${baseURL}${features[3].path}${miloLibs}`;
const defaultURL = `${baseURL}${data.defaultURLpath}&${miloLibs}`;

await test.step('step-1: Navigate to default page and verify content/specs', async () => {
console.info(`[Test Page]: ${defaultURL}`);
await page.goto(defaultURL);
await expect(text.introHeadlineAlt).toContainText('This text block will be replaced');
await expect(marquee.marquee).toHaveCount(0);
});

await test.step('step-2: Navigate to personalized page and verify content/specs', async () => {
console.info(`[Test Page]: ${pznURL}`);
await page.goto(pznURL);
await expect(text.introHeadlineAlt).toHaveCount(0);
await expect(marquee.marquee).toContainText('This is a new marquee, replacing the text block');
});
});

// Test 4 : Personalization (remove content)
test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => {
howto = new Howto(page);
const { data } = features[4];
const pznURL = `${baseURL}${features[4].path}${miloLibs}`;
const defaultURL = `${baseURL}${data.defaultURLpath}&${miloLibs}`;

await test.step('step-1: Navigate to default page and verify content/specs', async () => {
console.info(`[Test Page]: ${defaultURL}`);
await page.goto(defaultURL);
await expect(howto.heading).toContainText('THIS HEADING WILL BE REMOVED');
await expect(howto.heading).toBeVisible();
});

await test.step('step-2: Navigate to personalized page and verify content/specs', async () => {
console.info(`[Test Page]: ${pznURL}`);
await page.goto(pznURL);
await expect(howto.heading).not.toBeVisible();
});
});
});
Loading