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-164967 [NALA] test for Target enablement #3504

Open
wants to merge 5 commits 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
17 changes: 17 additions & 0 deletions nala/features/personalization/target-on.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
name: 'check for Target enablement via page metadata and via URL parameter',
features: [
{
tcid: '0',
name: '@check for running Target tests',
desc: 'there should be 2 running Target tests, one enabled by a URL parameter and one enabled by page metadata',
path: '',
data: {
defaultURL: '/drafts/nala/features/personalization/target-on/target-on2?target=on&mep=%2Fdrafts%2Fnala%2Ffeatures%2Fpersonalization%2Ftarget-on%2Fmanifest.json--default',
metadataURL: '/drafts/nala/features/personalization/target-on/target-on',
parameterURL: '/drafts/nala/features/personalization/target-on/target-on2?target=on',
},
tags: '@targeton0 @smoke @regression @milo ',
},
],
};
35 changes: 35 additions & 0 deletions nala/features/personalization/target-on.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// to run the test: npm run nala stage target-on.test.js

// Note: this test deliberately skips checking for the global metadata spreadsheet because one does not exist in the milo repository

import { expect, test } from '@playwright/test';
import { features } from './target-on.spec.js';
import MarqueeBlock from '../../blocks/marquee/marquee.page.js';

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

// Test 0: check for running Target tests
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
const defaultURL = `${baseURL}${features[0].data.defaultURL}${miloLibs}`;
const metadataURL = `${baseURL}${features[0].data.metadataURL}${miloLibs}`;
const parameterURL = `${baseURL}${features[0].data.parameterURL}${miloLibs}`;
const marquee = new MarqueeBlock(page);

await test.step('step-1: verify default test page', async () => {
console.info(`[Test Page]: ${defaultURL}`);
await page.goto(defaultURL);
await expect(marquee.headingXL).toHaveText('Heading XL Marquee standard medium left');

Check failure on line 21 in nala/features/personalization/target-on.test.js

View workflow job for this annotation

GitHub Actions / Running Nala E2E UI Tests (20.x)

[milo-live-chromium] › features/personalization/target-on.test.js:12:5 › @check for running Target tests

1) [milo-live-chromium] › features/personalization/target-on.test.js:12:5 › @check for running Target tests,@targeton0 @smoke @regression @milo Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toHaveText(expected) Locator: locator('.marquee').first().locator('.heading-xl').first() Expected string: "Heading XL Marquee standard medium left" Received: <element(s) not found> Call log: - expect.toHaveText with timeout 5000ms - waiting for locator('.marquee').first().locator('.heading-xl').first() 19 | console.info(`[Test Page]: ${defaultURL}`); 20 | await page.goto(defaultURL); > 21 | await expect(marquee.headingXL).toHaveText('Heading XL Marquee standard medium left'); | ^ 22 | }); 23 | 24 | await test.step('step-2: verify metadata test page', async () => { at /home/runner/work/milo/milo/nala/features/personalization/target-on.test.js:21:37 at /home/runner/work/milo/milo/nala/features/personalization/target-on.test.js:18:3
});

await test.step('step-2: verify metadata test page', async () => {
console.info(`[Test Page]: ${metadataURL}`);
await page.goto(metadataURL);
await expect(marquee.headingXL).toHaveText('Target is running');

Check failure on line 27 in nala/features/personalization/target-on.test.js

View workflow job for this annotation

GitHub Actions / Running Nala E2E UI Tests (20.x)

[milo-live-chromium] › features/personalization/target-on.test.js:12:5 › @check for running Target tests

1) [milo-live-chromium] › features/personalization/target-on.test.js:12:5 › @check for running Target tests,@targeton0 @smoke @regression @milo Error: Timed out 5000ms waiting for expect(locator).toHaveText(expected) Locator: locator('.marquee').first().locator('.heading-xl').first() Expected string: "Target is running" Received string: "Heading XL Marquee standard medium left" Call log: - expect.toHaveText with timeout 5000ms - waiting for locator('.marquee').first().locator('.heading-xl').first() - locator resolved to <h2 class="heading-xl" id="heading-xl-marquee-standard-medium-left">…</h2> - unexpected value "Heading XL Marquee standard medium left" 25 | console.info(`[Test Page]: ${metadataURL}`); 26 | await page.goto(metadataURL); > 27 | await expect(marquee.headingXL).toHaveText('Target is running'); | ^ 28 | }); 29 | 30 | await test.step('step-3: verify parameter test page', async () => { at /home/runner/work/milo/milo/nala/features/personalization/target-on.test.js:27:37 at /home/runner/work/milo/milo/nala/features/personalization/target-on.test.js:24:3
});

await test.step('step-3: verify parameter test page', async () => {
console.info(`[Test Page]: ${parameterURL}`);
await page.goto(parameterURL);
await expect(marquee.headingXL).toHaveText('Target is running');
});
});
Loading