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-166356 [MEP][NALA] Fragment autoload according to Geo #3544

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
20 changes: 20 additions & 0 deletions nala/features/personalization/fragment-autoload.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
FeatureName: 'test for automatic geo-specific fragment loading',
features: [

{
tcid: '0',
name: 'confirm the US personalized experience',
path: '/drafts/nala/features/personalization/fragment-autoload/autofragbasepage',
tags: '@mep @fragload0 @smoke @regression @milo',
},

{
tcid: '1',
name: 'confirm the FR personalized experience',
path: '/fr/drafts/nala/features/personalization/fragment-autoload/autofragbasepage',
data: {},
tags: '@mep @fragload1 @smoke @regression @milo',
},
],
};
31 changes: 31 additions & 0 deletions nala/features/personalization/fragment-autoload.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// to run tests:
// npm run nala stage fragment-autoload.test.js

import { expect, test } from '@playwright/test';
import { features } from './fragment-autoload.spec.js';
import TextBlock from '../../blocks/text/text.page.js';
import MarqueeBlock from '../../blocks/marquee/marquee.page.js';

const miloLibs = process.env.MILO_LIBS || '';

// Test 0: confirm the US personalized page
test(`[Test Id - ${features[0].tcid}] ${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
const marquee = new MarqueeBlock(page);
const text = new TextBlock(page, 1);
const URL = `${baseURL}${features[0].path}${miloLibs}`;
console.info(`[Test Page]: ${URL}`);
await page.goto(URL);
await expect(marquee.headingXL).toHaveText('US frag');
await expect(text.headlineAlt).toHaveText('Replacement text for US and French page');
});

// Test 1: confirm the FR personalized page
test(`[Test Id - ${features[1].tcid}] ${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
const marquee = new MarqueeBlock(page);
const text = new TextBlock(page, 1);
const URL = `${baseURL}${features[1].path}${miloLibs}`;
console.info(`[Test Page]: ${URL}`);
await page.goto(URL);
await expect(marquee.headingXL).toHaveText('FR fragment');
await expect(text.headlineAlt).toHaveText('Replacement text for US and French page');
});
Loading