From d629cf93a341c368cc77f4cdd72dccee7af937b4 Mon Sep 17 00:00:00 2001 From: Santoshkumar Nateekar Date: Fri, 12 Jan 2024 10:39:55 -0800 Subject: [PATCH] [MILOLIBS RUN : MWPW-141223] Provide support to run nala tests on a given milo libs (#240) * update the test files * update the tests * update the failures * update the personalizataion and iframe tests * update wait --------- Co-authored-by: nateekar --- .github/workflows/milolib.yml | 6 +- features/milo/georouting.spec.js | 2 +- global.setup.js | 231 ++++++++++++--------- playwright.config.js | 2 +- selectors/milo/georouting.feature.page.js | 3 +- tests/milo/actionitem.block.test.js | 50 ++--- tests/milo/aside.block.test.js | 102 ++++----- tests/milo/breadcrumbs.block.test.js | 26 +-- tests/milo/card.block.test.js | 44 ++-- tests/milo/carousel.block.test.js | 20 +- tests/milo/chart.block.test.js | 1 + tests/milo/columns.block.test.js | 32 +-- tests/milo/figure.block.test.js | 14 +- tests/milo/footer.block.test.js | 82 ++++++-- tests/milo/georouting.feature.test.js | 38 ++-- tests/milo/header.block.test.js | 28 ++- tests/milo/howto.block.test.js | 20 +- tests/milo/htmlextn.feature.test.js | 5 +- tests/milo/icon.block.test.js | 20 +- tests/milo/iframe.block.test.js | 8 +- tests/milo/marquee.block.test.js | 92 ++++---- tests/milo/media.block.test.js | 31 +-- tests/milo/merchcard.block.test.js | 68 +++--- tests/milo/modal.block.test.js | 20 +- tests/milo/personalization.feature.test.js | 26 +-- tests/milo/quote.block.test.js | 38 ++-- tests/milo/review.block.test.js | 14 +- tests/milo/tab.block.test.js | 14 +- tests/milo/table.block.test.js | 32 +-- tests/milo/text.block.test.js | 50 ++--- tests/milo/video.block.test.js | 55 ++--- tests/milo/zpattern.block.test.js | 26 +-- 32 files changed, 663 insertions(+), 537 deletions(-) diff --git a/.github/workflows/milolib.yml b/.github/workflows/milolib.yml index 8e8d0392..1e6376e0 100644 --- a/.github/workflows/milolib.yml +++ b/.github/workflows/milolib.yml @@ -1,14 +1,14 @@ -name: Run Nala on Milo Libs Manually +name: Run Nala on Milo Libs on: workflow_dispatch: inputs: branch: - description: 'Provide the branch url' + description: 'Provide the live branch url. ex: https://main--cc--adobecom.hlx.live' required: false type: string milolibs: - description: 'Provide MiloLibs param' + description: 'Provide MiloLibs param. ex: ?milolibs=marquee-static-hover' required: false type: string tags: diff --git a/features/milo/georouting.spec.js b/features/milo/georouting.spec.js index 557cb41d..a98353ff 100644 --- a/features/milo/georouting.spec.js +++ b/features/milo/georouting.spec.js @@ -7,7 +7,7 @@ module.exports = { desc: 'User accessing DE page from US locale.', path: '/de/drafts/nala/features/georouting/georouting', data: { - title: 'This Adobe site doesn\'t match your location.', + title: /This Adobe site doesn[' ’]t match your location./, text: 'Based on your location, we think you may prefer the United States website', button: 'United States', link: 'Deutschland', diff --git a/global.setup.js b/global.setup.js index 13c9352c..c1faaf0f 100644 --- a/global.setup.js +++ b/global.setup.js @@ -1,120 +1,151 @@ import { exit } from 'process'; - const { execSync } = require('child_process'); const { isBranchURLValid } = require('./libs/baseurl.js'); const axios = require('axios'); -async function globalSetup() { - console.info('----Executing Global setup---------'); +const MAIN_BRANCH_LIVE_URL = 'https://main--milo--adobecom.hlx.live'; +const STAGE_BRANCH_URL = 'https://milo.stage.adobe.com'; +const LOCALHOST_URL = 'http://localhost:3000'; + +async function getGitHubPRBranchLiveUrl() { + // get the pr number + const prReference = process.env.GITHUB_REF; + const prNumber = prReference.split('/')[2]; + + // get the pr branch name + const branch = process.env.GITHUB_HEAD_REF; + const prBranch = branch.replace(/\//g, '-'); + + // get the org and repo + const repository = process.env.GITHUB_REPOSITORY; + const repoParts = repository.split('/'); + const toRepoOrg = repoParts[0]; + const toRepoName = repoParts[1]; + + // Get the org and repo from the environment variables + const prFromOrg = process.env.prOrg; + const prFromRepoName = process.env.prRepo; + let prBranchLiveUrl; - let stageBranchLiveUrl; - let localTestLiveUrl; - let localOrg; - let localRepo; - let prNumber - // Check if the code is running in a GitHub CI/CD environment - if (process.env.GITHUB_ACTIONS === 'true') { - console.info('---- Running Tests in the GitHub environment ---------'); - - // get the pr number - const prReference = process.env.GITHUB_REF; - prNumber = prReference.split('/')[2]; - - // get the pr branch name - const branch = process.env.GITHUB_HEAD_REF; - const prBranch = branch.replace(/\//g, '-'); - - // get the org and repo - const repository = process.env.GITHUB_REPOSITORY; - const repoParts = repository.split('/'); - const toRepoOrg = repoParts[0]; - const toRepoName = repoParts[1]; - - // Get the org and repo from the environment variables - const prFromOrg = process.env.prOrg; - const prFromRepoName = process.env.prRepo; - - try { - // Construct the pr branch URL - if (toRepoName === 'nala' || toRepoName === 'janus') { - prBranchLiveUrl = `https://main--milo--adobecom.hlx.live`; - } else { - prBranchLiveUrl = `https://${prBranch}--${prFromRepoName}--${prFromOrg}.hlx.live`; - } + if (toRepoName === 'nala' || toRepoName === 'janus') { + prBranchLiveUrl = MAIN_BRANCH_LIVE_URL; + } else { + prBranchLiveUrl = `https://${prBranch}--${prFromRepoName}--${prFromOrg}.hlx.live`; + } - // Validate the pr branch URL by making an HTTP request - if (await isBranchURLValid(prBranchLiveUrl)) { - process.env.PR_BRANCH_LIVE_URL = prBranchLiveUrl; - } - console.info('PR Repository : ', repository); - console.info('PR TO ORG : ', toRepoOrg); - console.info('PR TO REPO : ', toRepoName); - console.info('PR From ORG : ', prFromOrg); - console.info('PR From REPO : ', prFromRepoName); - console.info('PR Branch : ', branch); - console.info('PR Branch(U) : ', prBranch); - console.info('PR Number : ', prNumber); - console.info('PR From Branch live url : ', prBranchLiveUrl); - } catch (err) { - console.error(`Error => Error in setting PR Branch test URL : ${prBranchLiveUrl}`); - console.info(`Note : PR branch test url ${prBranchLiveUrl} is not valid, Exiting test execution.`); - process.exit(1); - } - } else if (process.env.CIRCLECI) { - console.info('---- Running Tests in the CircleCI environment ---------'); + try { + if (await isBranchURLValid(prBranchLiveUrl)) { + process.env.PR_BRANCH_LIVE_URL = prBranchLiveUrl; + } + console.info('PR Repository : ', repository); + console.info('PR TO ORG : ', toRepoOrg); + console.info('PR TO REPO : ', toRepoName); + console.info('PR From ORG : ', prFromOrg); + console.info('PR From REPO : ', prFromRepoName); + console.info('PR Branch : ', branch); + console.info('PR Branch(U) : ', prBranch); + console.info('PR Number : ', prNumber); + console.info('PR From Branch live url : ', prBranchLiveUrl); + } catch (err) { + console.error(`Error => Error in setting PR Branch test URL : ${prBranchLiveUrl}`); + console.info(`Note: PR branch test url ${prBranchLiveUrl} is not valid, Exiting test execution.`); + process.exit(1); + } +} + +async function getGitHubMiloLibsBranchLiveUrl() { + const repository = process.env.GITHUB_REPOSITORY; + + let prBranchLiveUrl; + let miloLibs; + + prBranchLiveUrl = process.env.PR_BRANCH_MILOLIBS_LIVE_URL; + miloLibs = process.env.MILO_LIBS; + + try { + if (await isBranchURLValid(prBranchLiveUrl)) { + process.env.PR_BRANCH_LIVE_URL = prBranchLiveUrl; + } + console.info('PR Repository : ', repository); + console.info('PR Branch live url : ', prBranchLiveUrl); + console.info('Milo Libs : ', miloLibs); + } catch (err) { + console.error(`Error => Error in setting PR Branch test URL : ${prBranchLiveUrl}`); + console.info(`Note: PR branch test url ${prBranchLiveUrl} is not valid, Exiting test execution.`); + process.exit(1); + } +} - stageBranchLiveUrl = 'https://milo.stage.adobe.com'; - - // Validate the stage URL by making an HTTP request +async function getCircleCIBranchLiveUrl() { + const stageBranchLiveUrl = STAGE_BRANCH_URL; + + try { if (await isBranchURLValid(stageBranchLiveUrl)) { process.env.PR_BRANCH_LIVE_URL = stageBranchLiveUrl; } console.info('Stage Branch Live URL : ', stageBranchLiveUrl); + } catch (err) { + console.error('Error => Error in setting Stage Branch test URL : ', stageBranchLiveUrl); + console.info('Note: Stage branch test url is not valid, Exiting test execution.'); + process.exit(1); + } +} - } else { - - console.info('---- Running Tests in the Local environment ---------'); - - try { - // Run 'git rev-parse --show-toplevel' to get the root directory of the Git repository - const localGitRootDir = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim(); - - if (localGitRootDir) { - // Get the repository and organization/owner name from the Git remote URL - const gitRemoteOriginUrl = execSync('git config --get remote.origin.url', { cwd: localGitRootDir, encoding: 'utf-8' }).trim(); - const match = gitRemoteOriginUrl.match(/github\.com\/(.*?)\/(.*?)\.git/); - console.info('Git Local Remote Origin : ', gitRemoteOriginUrl ); - if (match) { - localOrg = match[1]; - localRepo = match[2]; - - console.info('Git ORG : ', localOrg ); - console.info('Git REPO : ', localRepo ); - - // get the current local branch name - const localBranch = execSync('git rev-parse --abbrev-ref HEAD', { cwd: localGitRootDir, encoding: 'utf-8' }).trim(); - console.info('Local Branch : ', localBranch ); - - if ( localRepo === 'nala' || localRepo === 'janus'){ - localTestLiveUrl = `https://main--milo--adobecom.hlx.live`; - } else { - localTestLiveUrl = `http://localhost:3000`; - } - - // Validate the pr branch URL by making an HTTP request - if ( await isBranchURLValid(localTestLiveUrl)){ - process.env.LOCAL_TEST_LIVE_URL = localTestLiveUrl; - } - console.info('Local Test Live URL : ', process.env.LOCAL_TEST_LIVE_URL ); +async function getLocalBranchLiveUrl() { + try { + const localGitRootDir = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim(); + + if (localGitRootDir) { + const gitRemoteOriginUrl = execSync('git config --get remote.origin.url', { cwd: localGitRootDir, encoding: 'utf-8' }).trim(); + const match = gitRemoteOriginUrl.match(/github\.com\/(.*?)\/(.*?)\.git/); + + if (match) { + const [localOrg, localRepo] = match.slice(1, 3); + const localBranch = execSync('git rev-parse --abbrev-ref HEAD', { cwd: localGitRootDir, encoding: 'utf-8' }).trim(); + let localTestLiveUrl; + + if (localRepo === 'nala' || localRepo === 'janus') { + localTestLiveUrl = MAIN_BRANCH_LIVE_URL; + } else { + localTestLiveUrl = LOCALHOST_URL; + } + + if (await isBranchURLValid(localTestLiveUrl)) { + process.env.LOCAL_TEST_LIVE_URL = localTestLiveUrl; } - } - } catch (error) { - console.error(`Error => Error in setting local test URL : ${localTestLiveUrl}`) - console.info(`Note : Local or branch test url ${localTestLiveUrl} is not valid, Exiting test execution.`); - process.exit(1); + console.info('Git ORG : ', localOrg); + console.info('Git REPO : ', localRepo); + console.info('Local Branch : ', localBranch); + console.info('Local Test Live URL : ', process.env.LOCAL_TEST_LIVE_URL); + } + } + } catch (error) { + console.error(`Error => Error in setting local test URL : ${localTestLiveUrl}`); + console.info(`Note: Local or branch test url is not valid, Exiting test execution.`); + process.exit(1); + } +} + +async function globalSetup() { + console.info('----Executing Global setup---------'); + + if (process.env.GITHUB_ACTIONS === 'true') { + console.info('---- Running Tests in the GitHub environment ---------'); + + if (process.env.MILO_LIBS_RUN === 'true') { + await getGitHubMiloLibsBranchLiveUrl(); + } else { + await getGitHubPRBranchLiveUrl(); } + } else if (process.env.CIRCLECI) { + console.info('---- Running Tests in the CircleCI environment ---------'); + await getCircleCIBranchLiveUrl(); + } else { + console.info('---- Running Tests in the Local environment ---------'); + await getLocalBranchLiveUrl(); } } + export default globalSetup; diff --git a/playwright.config.js b/playwright.config.js index 6f89ad59..0f656c10 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -9,7 +9,7 @@ const envs = require('./envs/envs.js'); const config = { testDir: './tests/milo', outputDir: './test-results', - globalSetup: './global.setup_1.js', + globalSetup: './global.setup.js', /* Maximum time one test can run for. */ timeout: 30 * 1000, expect: { diff --git a/selectors/milo/georouting.feature.page.js b/selectors/milo/georouting.feature.page.js index a7645eac..7c169d6b 100644 --- a/selectors/milo/georouting.feature.page.js +++ b/selectors/milo/georouting.feature.page.js @@ -6,7 +6,8 @@ export default class Georouting { // global footer locators this.footer = this.page.locator('.global-footer'); - this.changeRegionLink = this.footer.locator('//a[@data-modal-path="/fragments/regions"]'); + //this.changeRegionLink = this.footer.locator('//a[@data-modal-path="/fragments/regions"]'); + this.changeRegionLink = this.footer.locator('.modal.link-block'); // change region modal locators this.changeRegionModal = this.page.locator('.dialog-modal'); diff --git a/tests/milo/actionitem.block.test.js b/tests/milo/actionitem.block.test.js index 8989b278..348c3f91 100644 --- a/tests/milo/actionitem.block.test.js +++ b/tests/milo/actionitem.block.test.js @@ -6,6 +6,8 @@ import ActionItem from '../../selectors/milo/actionitem.block.page.js'; let actionItem; let webUtil; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Action-Item block test suite', () => { test.beforeEach(async ({ page }) => { actionItem = new ActionItem(page); @@ -14,13 +16,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 0 : Action-Item (Small) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const data = features[0].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -35,13 +37,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 1 : Action-Item (Medium) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const data = features[1].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -56,13 +58,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 2 : Action-Item (Large) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const data = features[2].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -77,13 +79,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 3 : Action-Item (Center) test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const data = features[3].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -97,13 +99,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 4 : Action-Item (Rounded) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const data = features[4].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -118,13 +120,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 5 : Action-Item (Float Button) test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const data = features[5].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -137,13 +139,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 6 : Action-Item (scroller) test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); const data = features[6].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[6].path}`); + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { @@ -160,13 +162,13 @@ test.describe('Milo Action-Item block test suite', () => { // Test 7 : Action-Item (scroller) test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[7].path}`); + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); const data = features[7].data; await test.step('step-1: Go to Action item block test page', async () => { - await page.goto(`${baseURL}${features[7].path}`); + await page.goto(`${baseURL}${features[7].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}`); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); }); await test.step('step-2: Verify Action item content/specs', async () => { diff --git a/tests/milo/aside.block.test.js b/tests/milo/aside.block.test.js index e8460e74..53c60217 100644 --- a/tests/milo/aside.block.test.js +++ b/tests/milo/aside.block.test.js @@ -2,6 +2,8 @@ import { expect, test } from '@playwright/test'; import { features } from '../../features/milo/aside.block.spec.js'; import AsideBlock from '../../selectors/milo/aside.block.page.js'; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Aside Block test suite', () => { // Aside Small Checks: test(`${features[0].name}, ${features[0].tags}`, async ({ page, baseURL }) => { @@ -9,9 +11,9 @@ test.describe('Aside Block test suite', () => { console.info(`[Test Page]: ${baseURL}${features[0].path}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[0].path}${features[0].browserParams}`); + await page.goto(`${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}${features[0].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -38,12 +40,12 @@ test.describe('Aside Block test suite', () => { // Aside Medium Checks: test(`${features[1].name}, ${features[1].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[1].path}${features[1].browserParams}`); + await page.goto(`${baseURL}${features[1].path}${features[1].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}${features[1].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${features[1].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -68,12 +70,12 @@ test.describe('Aside Block test suite', () => { // Aside Large Checks: test(`${features[2].name}, ${features[2].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[2].path}${features[2].browserParams}`); + await page.goto(`${baseURL}${features[2].path}${features[2].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}${features[2].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${features[2].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -98,12 +100,12 @@ test.describe('Aside Block test suite', () => { // Aside Split Small Dark Checks: test(`${features[3].name}, ${features[3].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[3].path}${features[3].browserParams}`); + await page.goto(`${baseURL}${features[3].path}${features[3].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}${features[3].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${features[3].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -128,12 +130,12 @@ test.describe('Aside Block test suite', () => { // Aside Split Small Half Dark Checks: test(`${features[4].name}, ${features[4].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[4].path}${features[4].browserParams}`); + await page.goto(`${baseURL}${features[4].path}${features[4].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}${features[4].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${features[4].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -158,12 +160,12 @@ test.describe('Aside Block test suite', () => { // Aside Split Medium Checks: test(`${features[5].name}, ${features[5].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[5].path}${features[5].browserParams}`); + await page.goto(`${baseURL}${features[5].path}${features[5].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}${features[5].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${features[5].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -188,12 +190,12 @@ test.describe('Aside Block test suite', () => { // Aside Split Medium Half Checks: test(`${features[6].name}, ${features[6].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[6].path}${features[6].browserParams}`); + await page.goto(`${baseURL}${features[6].path}${features[6].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}${features[6].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${features[6].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -218,12 +220,12 @@ test.describe('Aside Block test suite', () => { // Aside Split Large Checks: test(`${features[7].name}, ${features[7].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[7].path}`); + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[7].path}${features[7].browserParams}`); + await page.goto(`${baseURL}${features[7].path}${features[7].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}${features[7].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${features[7].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -246,12 +248,12 @@ test.describe('Aside Block test suite', () => { // Aside Split Large Half Dark Checks: test(`${features[8].name}, ${features[8].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[8].path}`); + console.info(`[Test Page]: ${baseURL}${features[8].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[8].path}${features[8].browserParams}`); + await page.goto(`${baseURL}${features[8].path}${features[8].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[8].path}${features[8].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[8].path}${features[8].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -276,12 +278,12 @@ test.describe('Aside Block test suite', () => { // Aside Inline Checks: test(`${features[9].name}, ${features[9].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[9].path}`); + console.info(`[Test Page]: ${baseURL}${features[9].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[9].path}${features[9].browserParams}`); + await page.goto(`${baseURL}${features[9].path}${features[9].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[9].path}${features[9].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[9].path}${features[9].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -306,12 +308,12 @@ test.describe('Aside Block test suite', () => { // Aside Inline Dark Checks: test(`${features[10].name}, ${features[10].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[10].path}`); + console.info(`[Test Page]: ${baseURL}${features[10].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[10].path}${features[10].browserParams}`); + await page.goto(`${baseURL}${features[10].path}${features[10].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[10].path}${features[10].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[10].path}${features[10].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -336,12 +338,12 @@ test.describe('Aside Block test suite', () => { // Aside Notification Extra Small Dark: test(`${features[11].name}, ${features[11].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[11].path}`); + console.info(`[Test Page]: ${baseURL}${features[11].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[11].path}${features[11].browserParams}`); + await page.goto(`${baseURL}${features[11].path}${features[11].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[11].path}${features[11].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[11].path}${features[11].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -371,12 +373,12 @@ test.describe('Aside Block test suite', () => { // Aside Notification Small: test(`${features[12].name}, ${features[12].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[12].path}`); + console.info(`[Test Page]: ${baseURL}${features[12].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[12].path}${features[12].browserParams}`); + await page.goto(`${baseURL}${features[12].path}${features[12].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[12].path}${features[12].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[12].path}${features[12].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -404,12 +406,12 @@ test.describe('Aside Block test suite', () => { // Aside Notification Medium: test(`${features[13].name}, ${features[13].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[13].path}`); + console.info(`[Test Page]: ${baseURL}${features[13].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[13].path}${features[13].browserParams}`); + await page.goto(`${baseURL}${features[13].path}${features[13].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[13].path}${features[13].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[13].path}${features[13].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -434,12 +436,12 @@ test.describe('Aside Block test suite', () => { // Aside Notification Medium Center: test(`${features[14].name}, ${features[14].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[14].path}`); + console.info(`[Test Page]: ${baseURL}${features[14].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[14].path}${features[14].browserParams}`); + await page.goto(`${baseURL}${features[14].path}${features[14].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[14].path}${features[14].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[14].path}${features[14].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -464,12 +466,12 @@ test.describe('Aside Block test suite', () => { // Aside Notification Large: test(`${features[15].name}, ${features[15].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[15].path}`); + console.info(`[Test Page]: ${baseURL}${features[15].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[15].path}${features[15].browserParams}`); + await page.goto(`${baseURL}${features[15].path}${features[15].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[15].path}${features[15].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[15].path}${features[15].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { @@ -494,12 +496,12 @@ test.describe('Aside Block test suite', () => { // Aside Notification Large Center: test(`${features[16].name}, ${features[16].tags}`, async ({ page, baseURL }) => { const Aside = new AsideBlock(page); - console.info(`[Test Page]: ${baseURL}${features[16].path}`); + console.info(`[Test Page]: ${baseURL}${features[16].path}${miloLibs}`); await test.step('Navigate to page with Aside block', async () => { - await page.goto(`${baseURL}${features[16].path}${features[16].browserParams}`); + await page.goto(`${baseURL}${features[16].path}${features[16].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[16].path}${features[16].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[16].path}${features[16].browserParams}&${miloLibs}`); }); await test.step('Validate Aside block content', async () => { diff --git a/tests/milo/breadcrumbs.block.test.js b/tests/milo/breadcrumbs.block.test.js index bb55cf2f..0f485e9b 100644 --- a/tests/milo/breadcrumbs.block.test.js +++ b/tests/milo/breadcrumbs.block.test.js @@ -5,16 +5,18 @@ import { expect, test } from '@playwright/test'; import { features } from '../../features/milo/breadcrumbs.block.spec.js'; import FedsHeader from '../../selectors/feds/feds.header.page.js'; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Breadcrumbs Component Test Suite', () => { // FEDS Breadcrumbs-With-Base Checks: test(`${features[0].name}, ${features[0].tags}`, async ({ page, baseURL }) => { const Header = new FedsHeader(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[0].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[0].path}${miloLibs}`); await test.step('Navigate to FEDS Breadcrumbs-With-Base page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('Check breadcrumbs structure on current page', async () => { @@ -33,12 +35,12 @@ test.describe('Breadcrumbs Component Test Suite', () => { // FEDS Breadcrumbs-From-Document checks: test(`${features[1].name}, ${features[1].tags}`, async ({ page, baseURL }) => { const Header = new FedsHeader(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[1].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[1].path}${miloLibs}`); await test.step('Navigate to FEDS Breadcrumbs-From-Document page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('Check breadcrumbs structure on current page', async () => { @@ -57,12 +59,12 @@ test.describe('Breadcrumbs Component Test Suite', () => { // FEDS Breadcrumbs-Hidden-Links checks: test(`${features[2].name}, ${features[2].tags}`, async ({ page, baseURL }) => { const Header = new FedsHeader(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[2].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[2].path}${miloLibs}`); await test.step('Navigate to FEDS Breadcrumbs-Hidden-Links page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('Check breadcrumbs structure on current page', async () => { @@ -81,12 +83,12 @@ test.describe('Breadcrumbs Component Test Suite', () => { // FEDS Breadcrumbs-No-Hidden-Links checks: test(`${features[3].name}, ${features[3].tags}`, async ({ page, baseURL }) => { const Header = new FedsHeader(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[3].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[3].path}${miloLibs}`); await test.step('Navigate to FEDS Breadcrumbs-No-Hidden-Links page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('Check breadcrumbs structure on current page', async () => { diff --git a/tests/milo/card.block.test.js b/tests/milo/card.block.test.js index 87ed4e1a..30d92007 100644 --- a/tests/milo/card.block.test.js +++ b/tests/milo/card.block.test.js @@ -6,6 +6,8 @@ import ConsonantCard from '../../selectors/milo/card.block.page.js'; let card; let webUtil; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Consonant card feature test suite', () => { test.beforeEach(async ({ page }) => { card = new ConsonantCard(page); @@ -14,13 +16,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 0 : Card test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const data = features[0].data; await test.step('step-1: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Card content/specs', async () => { @@ -42,13 +44,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 1 : Card (half-card, border) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const data = features[1].data; await test.step('step-1: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Half Card with Boarder content/specs', async () => { @@ -72,13 +74,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 2 : card (double-width-card, border) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const data = features[2].data; await test.step('step-2: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify card (double-width-card, border) content/specs', async () => { @@ -95,13 +97,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 3 : Card (product-card, border) test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const data = features[3].data; await test.step('step-2: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Card (product-card, border) content/specs', async () => { @@ -124,13 +126,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 4 : Card (half-height-card, border) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const data = features[4].data; await test.step('step-2: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Card (half-height-card, border) content/specs', async () => { @@ -147,13 +149,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 5 : Card-horizontal test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const data = features[5].data; await test.step('step-2: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Card-horizontal content/specs', async () => { @@ -171,13 +173,13 @@ test.describe('Milo Consonant card feature test suite', () => { // Test 6 : Card-horizontal (tile) test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); const data = features[6].data; await test.step('step-2: Go to Consonant Card feature test page', async () => { - await page.goto(`${baseURL}${features[6].path}`); + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); }); await test.step('step-2: Verify Card-horizontal (tile) content/specs', async () => { diff --git a/tests/milo/carousel.block.test.js b/tests/milo/carousel.block.test.js index 289bb1fb..9d1d7822 100644 --- a/tests/milo/carousel.block.test.js +++ b/tests/milo/carousel.block.test.js @@ -4,18 +4,20 @@ import CarouselBlock from '../../selectors/milo/carousel.block.page.js'; let carousel; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Carousel Block test suite', () => { test.beforeEach(async ({ page }) => { carousel = new CarouselBlock(page); }); test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to Carousel block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Carousel container', async () => { @@ -50,12 +52,12 @@ test.describe('Milo Carousel Block test suite', () => { }); test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to Carousel lightbox block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify carousel with lightbox features', async () => { @@ -83,12 +85,12 @@ test.describe('Milo Carousel Block test suite', () => { }); test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); await test.step('step-1: Go to Carousel multi-slide show-2 block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify multi slide carousel show-2 features', async () => { diff --git a/tests/milo/chart.block.test.js b/tests/milo/chart.block.test.js index 3c108ca2..e50ccf48 100644 --- a/tests/milo/chart.block.test.js +++ b/tests/milo/chart.block.test.js @@ -3,6 +3,7 @@ import { features } from '../../features/milo/chart.block.spec.js'; import ChartBlock from '../../selectors/milo/chart.block.page.js'; let chart; +const miloLibs = process.env.MILO_LIBS || ''; test.describe('Milo Chart feature test suite', () => { test.beforeEach(async ({ page }) => { diff --git a/tests/milo/columns.block.test.js b/tests/milo/columns.block.test.js index 6e6d035c..de2c144f 100644 --- a/tests/milo/columns.block.test.js +++ b/tests/milo/columns.block.test.js @@ -7,6 +7,8 @@ import ColumnsBlock from '../../selectors/milo/columns.block.page.js'; let column; let webUtil; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Columns Block test suite', () => { test.beforeEach(async ({ page }) => { column = new ColumnsBlock(page); @@ -15,13 +17,13 @@ test.describe('Milo Columns Block test suite', () => { // Test 0 : Column default block test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to Columns block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Columns block content/specs', async () => { @@ -43,13 +45,13 @@ test.describe('Milo Columns Block test suite', () => { // Test 1 : Columns (contained) block test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to Columns block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Columns(contained) block content/specs', async () => { @@ -70,13 +72,13 @@ test.describe('Milo Columns Block test suite', () => { // Test 2 : Columns (contained,middle) block test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to Columns block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Columns(contained,middle) block content/specs', async () => { @@ -97,13 +99,13 @@ test.describe('Milo Columns Block test suite', () => { // Test 3 : Columns (table) block test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to Columns block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Columns(table) block content/specs', async () => { @@ -128,13 +130,13 @@ test.describe('Milo Columns Block test suite', () => { // Test 4 : Columns (contained,table) block test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Go to Columns block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Columns(contained,table) block content/specs', async () => { diff --git a/tests/milo/figure.block.test.js b/tests/milo/figure.block.test.js index cfccb8ad..07e52607 100644 --- a/tests/milo/figure.block.test.js +++ b/tests/milo/figure.block.test.js @@ -4,18 +4,20 @@ import FigureBlock from '../../selectors/milo/figure.block.page.js'; let figureBlock; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Figure Block test suite', () => { test.beforeEach(async ({ page }) => { figureBlock = new FigureBlock(page); }); test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to figure Block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify figure block ', async () => { @@ -27,12 +29,12 @@ test.describe('Milo Figure Block test suite', () => { }); test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); await test.step('step-1: Go to figure block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify figure block multiple images with caption ', async () => { diff --git a/tests/milo/footer.block.test.js b/tests/milo/footer.block.test.js index 7c22019e..418b0b90 100644 --- a/tests/milo/footer.block.test.js +++ b/tests/milo/footer.block.test.js @@ -5,16 +5,18 @@ import { expect, test } from '@playwright/test'; import { features } from '../../features/milo/footer.block.spec.js'; import FedsFooter from '../../selectors/feds/feds.footer.page.js'; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Footer Block Test Suite', () => { // FEDS Default Footer Checks: test(`${features[0].name}, ${features[0].tags}`, async ({ page, baseURL }) => { const Footer = new FedsFooter(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[0].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[0].path}${miloLibs}`); await test.step('Navigate to FEDS Default Footer page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('Check FEDS Default Footer critical elements', async () => { @@ -30,8 +32,12 @@ test.describe('Footer Block Test Suite', () => { // !Note: Footer featuredProducts not appearing in NALA. Possible BUG! // await expect(Footer.featuredProductsContainer).toBeVisible(); await expect(Footer.footerColumns).toHaveCount(5); - await expect(Footer.footerSections).toHaveCount(6); - await expect(Footer.footerHeadings).toHaveCount(6); + + // updated the footer section and heading content as per consuming sites + // milo=6, cc=9 and so on + await expect([4, 6, 9].includes(await Footer.footerSections.count())).toBeTruthy(); + await expect([4, 6, 9].includes(await Footer.footerHeadings.count())).toBeTruthy(); + await expect(Footer.socialIcons).toHaveCount(4); await expect(Footer.legalLinks).toHaveCount(5); }); @@ -47,12 +53,12 @@ test.describe('Footer Block Test Suite', () => { // FEDS Skinny Footer Checks: test(`${features[1].name}, ${features[1].tags}`, async ({ page, baseURL }) => { const Footer = new FedsFooter(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[1].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[1].path}${miloLibs}`); await test.step('Navigate to FEDS Skinny Footer page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('Check FEDS Skinny Footer critical elements', async () => { @@ -66,18 +72,38 @@ test.describe('Footer Block Test Suite', () => { await expect(Footer.footerContainer).toBeVisible(); await expect(Footer.changeRegionContainer).toBeVisible(); - await expect(Footer.featuredProducts).toHaveCount(0); - await expect(Footer.featuredProductsContainer).not.toBeVisible(); + //await expect(Footer.featuredProducts).toHaveCount(0); + // updated the featuredProducts count as per consuming sites + // milo=0, cc=4 and so on + expect([0, 4].includes(await Footer.featuredProducts.count())).toBeTruthy(); + + const featuredProductsCount = await Footer.featuredProducts.count(); + + if (featuredProductsCount === 0) { + await expect(Footer.featuredProductsContainer).not.toBeVisible(); + } else { + await expect(Footer.featuredProductsContainer).toBeVisible(); + } await expect(Footer.legalLinks).toHaveCount(5); await expect(Footer.socialIcons).toHaveCount(4); - await expect(Footer.footerColumns).toHaveCount(0); - await expect(Footer.footerSections).toHaveCount(0); - await expect(Footer.footerHeadings).toHaveCount(0); - await expect(Footer.footerColumns).not.toBeVisible(); - await expect(Footer.footerSections).not.toBeVisible(); - await expect(Footer.footerHeadings).not.toBeVisible(); + //await expect(Footer.footerColumns).toHaveCount(0); + //await expect(Footer.footerSections).toHaveCount(0); + //await expect(Footer.footerHeadings).toHaveCount(0); + + const footerSectionsCount = await Footer.featuredProducts.count(); + + if (footerSectionsCount === 0) { + await expect(Footer.footerColumns).not.toBeVisible(); + await expect(Footer.footerSections).not.toBeVisible(); + await expect(Footer.footerHeadings).not.toBeVisible(); + } else { + expect([0, 5].includes(await Footer.footerColumns.count())).toBeTruthy(); + expect([4, 6, 9].includes(await Footer.footerSections.count())).toBeTruthy(); + expect([4, 6, 9].includes(await Footer.footerHeadings.count())).toBeTruthy(); + } + }); await test.step('Check ChangeRegion functionality', async () => { @@ -91,12 +117,12 @@ test.describe('Footer Block Test Suite', () => { // FEDS Privacy Footer Checks: test(`${features[2].name}, ${features[2].tags}`, async ({ page, baseURL }) => { const Footer = new FedsFooter(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[2].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[2].path}${miloLibs}`); await test.step('Navigate to FEDS Privacy Footer page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('Check FEDS Privacy Footer critical elements', async () => { @@ -112,13 +138,23 @@ test.describe('Footer Block Test Suite', () => { await expect(Footer.featuredProductsContainer).toBeVisible(); await expect(Footer.footerColumns).toHaveCount(5); - await expect(Footer.footerSections).toHaveCount(6); - await expect(Footer.footerHeadings).toHaveCount(6); - await expect(Footer.featuredProducts).toHaveCount(3); - await expect(Footer.legalSections).toHaveCount(2); + //await expect(Footer.footerSections).toHaveCount(9) + //await expect(Footer.footerHeadings).toHaveCount(9) + //await expect(Footer.featuredProducts).toHaveCount(3); + //await expect(Footer.legalSections).toHaveCount(2); await expect(Footer.socialIcons).toHaveCount(4); await expect(Footer.legalLinks).toHaveCount(5); + + // updated the footer section and heading content equal or greater + // than 6, to pass tests on cc pages. + expect([4, 6, 9].includes(await Footer.footerSections.count())).toBeTruthy(); + expect([4, 6, 9].includes(await Footer.footerHeadings.count())).toBeTruthy(); + expect([3, 4].includes(await Footer.featuredProducts.count())).toBeTruthy(); + expect([1, 2].includes(await Footer.legalSections.count())).toBeTruthy(); + expect([4].includes(await Footer.socialIcons.count())).toBeTruthy(); + expect([5].includes(await Footer.legalLinks.count())).toBeTruthy(); + }); await test.step('Check ChangeRegion functionality', async () => { diff --git a/tests/milo/georouting.feature.test.js b/tests/milo/georouting.feature.test.js index 4a42a428..534185a9 100644 --- a/tests/milo/georouting.feature.test.js +++ b/tests/milo/georouting.feature.test.js @@ -4,6 +4,8 @@ import Georouting from '../../selectors/milo/georouting.feature.page.js'; let modal; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Georouting feature test suite', () => { test.beforeEach(async ({ page }) => { modal = new Georouting(page); @@ -12,14 +14,14 @@ test.describe('Milo Georouting feature test suite', () => { test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL, browserName }) => { test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers'); test.slow(); - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Clear cookies and access "DE" page from "US" region', async () => { await page.context().clearCookies(); - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); await modal.geoModal.waitFor({ state: 'visible', timeout: 30000 }); }); @@ -36,14 +38,14 @@ test.describe('Milo Georouting feature test suite', () => { test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}&${miloLibs}`); const { data } = features[1]; await test.step('step-1: Clear cookies and access "US" page with query param (akamailLocale=DE)', async () => { await page.context().clearCookies(); - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}&${miloLibs}`); await modal.geoModal.waitFor({ state: 'visible', timeout: 10000 }); }); @@ -59,14 +61,14 @@ test.describe('Milo Georouting feature test suite', () => { test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Clear cookies and access "US" page', async () => { await page.context().clearCookies(); - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Click "Change region" link from footer and navigate to "Deutschland" page', async () => { @@ -82,14 +84,14 @@ test.describe('Milo Georouting feature test suite', () => { test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}&${miloLibs}`); const { data } = features[3]; await test.step('step-1: Clear cookies and access "US" page', async () => { await page.context().clearCookies(); - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}&${miloLibs}`); await modal.geoModal.waitFor({ state: 'visible', timeout: 10000 }); }); @@ -99,14 +101,14 @@ test.describe('Milo Georouting feature test suite', () => { }); test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Clear cookies and access given "DE" page', async () => { await page.context().clearCookies(); - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify that georouting modal is not shown', async () => { @@ -117,14 +119,14 @@ test.describe('Milo Georouting feature test suite', () => { test(`${features[5].name},${features[5].tags}`, async ({ page, browserName, baseURL }) => { test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers'); test.slow(); - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const { data } = features[5]; await test.step('step-1: Clear cookies and access given "DE" page', async () => { await page.context().clearCookies(); - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); await modal.geoModal.waitFor({ state: 'visible', timeout: 10000 }); }); diff --git a/tests/milo/header.block.test.js b/tests/milo/header.block.test.js index 946d7866..618fded6 100644 --- a/tests/milo/header.block.test.js +++ b/tests/milo/header.block.test.js @@ -5,16 +5,18 @@ import { expect, test } from '@playwright/test'; import { features } from '../../features/milo/header.block.spec.js'; import FedsHeader from '../../selectors/feds/feds.header.page.js'; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Header Block Test Suite', () => { // FEDS Default Header Checks: test(`${features[0].name}, ${features[0].tags}`, async ({ page, baseURL }) => { const Header = new FedsHeader(page); - console.info(`[FEDSInfo] Checking page: ${baseURL}${features[0].path}`); + console.info(`[FEDSInfo] Checking page: ${baseURL}${features[0].path}${miloLibs}`); await test.step('Navigate to FEDS HEADER page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('Check HEADER block content', async () => { @@ -22,17 +24,25 @@ test.describe('Header Block Test Suite', () => { await Header.mainNavContainer.waitFor({ state: 'visible', timeout: 5000 }); // Check HEADER block content: await expect(Header.mainNavLogo).toBeVisible(); - await expect(Header.searchIcon).toBeVisible(); - + //skipping the step for PR branch runs - // working on better workaround soloution - + // working on better workaround soloution // await expect(Header.signInButton).toBeVisible(); }); await test.step('Check HEADER search component', async () => { - await Header.openSearchBar(); - await Header.closeSearchBar(); + + // adding the below check to accommodate testing on consuming sites + const isSearchIconVisible = await Header.searchIcon.isVisible(); + if (isSearchIconVisible) { + await test.step('Check HEADER search component', async () => { + await Header.openSearchBar(); + await Header.closeSearchBar(); + }); + } else { + console.info('Search icon is not visible, skipping the search component test.'); + } + }); await test.step('Check HEADER block mega menu component', async () => { diff --git a/tests/milo/howto.block.test.js b/tests/milo/howto.block.test.js index 4bf36f0f..a4597141 100644 --- a/tests/milo/howto.block.test.js +++ b/tests/milo/howto.block.test.js @@ -6,6 +6,8 @@ import HowToBlock from '../../selectors/milo/howto.block.page.js'; let webUtil; let howTo; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo HowTo block test suite', () => { test.beforeEach(async ({ page }) => { webUtil = new WebUtil(page); @@ -14,12 +16,12 @@ test.describe('Milo HowTo block test suite', () => { // Test 0 : HowTo default block test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to HowTo block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify HowTo specs', async () => { @@ -34,12 +36,12 @@ test.describe('Milo HowTo block test suite', () => { // Test 1 : how-to (large) block test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); await test.step('step-1: Go to HowTo large block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify HowTo large specs', async () => { @@ -54,12 +56,12 @@ test.describe('Milo HowTo block test suite', () => { // Test 2 : how-to (seo) block test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); await test.step('step-1: Go to HowTo SEO block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify HowTo SEO specs', async () => { diff --git a/tests/milo/htmlextn.feature.test.js b/tests/milo/htmlextn.feature.test.js index 1669d2e2..8673e6c7 100644 --- a/tests/milo/htmlextn.feature.test.js +++ b/tests/milo/htmlextn.feature.test.js @@ -2,6 +2,7 @@ import { expect, test } from '@playwright/test'; import { features } from '../../features/milo/htmlextn.spec.js' const envList = require('../../envs/envs.js'); +const miloLibs = process.env.MILO_LIBS || ''; test.describe('Milo Html Extension feature test suite', () => { @@ -14,7 +15,8 @@ test.describe('Milo Html Extension feature test suite', () => { for (const path of paths) { console.info('[Test Page]\n:', envList[env]+`${path}`); const url = envList[env]+ path; - await page.goto(url); + await page.goto(url); + await page.waitForLoadState('domcontentloaded'); if (!page.url().match(/@blog/) && (page.url().match(/customer-success-stories/))) { expect(page.url()).toContain('.html'); @@ -35,6 +37,7 @@ test.describe('Milo Html Extension feature test suite', () => { console.info('[Test Page]\n:', envList[env]+`${path}`); const url = envList[env]+ path; await page.goto(url); + await page.waitForLoadState('domcontentloaded'); if (!page.url().match(/@blog/) && (page.url().match(/customer-success-stories/))) { expect(page.url()).toContain('.html'); diff --git a/tests/milo/icon.block.test.js b/tests/milo/icon.block.test.js index 41ac1ad8..92f1f122 100644 --- a/tests/milo/icon.block.test.js +++ b/tests/milo/icon.block.test.js @@ -4,18 +4,20 @@ import IconBlock from '../../selectors/milo/icon.block.page.js'; let icon; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Icon Block test suite', () => { test.beforeEach(async ({ page }) => { icon = new IconBlock(page); }); test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to Icon block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Icon block content/specs', async () => { @@ -25,12 +27,12 @@ test.describe('Milo Icon Block test suite', () => { }); test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); await test.step('step-1: Go to Icon block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Icon block content/specs', async () => { @@ -40,12 +42,12 @@ test.describe('Milo Icon Block test suite', () => { }); test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); await test.step('step-1: Go to Icon block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Icon block content/specs', async () => { diff --git a/tests/milo/iframe.block.test.js b/tests/milo/iframe.block.test.js index ea36b87d..80215fa7 100644 --- a/tests/milo/iframe.block.test.js +++ b/tests/milo/iframe.block.test.js @@ -2,16 +2,18 @@ import { expect, test } from '@playwright/test'; import { features } from '../../features/milo/iframe.block.spec.js'; import IframeBlock from '../../selectors/milo/iframe.block.page.js'; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Iframe Block test suite', () => { // Iframe Block Checks: test(`${features[0].name}, ${features[0].tags}`, async ({ page, baseURL }) => { const Iframe = new IframeBlock(page); - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('Navigate to page with Iframe block', async () => { - await page.goto(`${baseURL}${features[0].path}${features[0].browserParams}`); + await page.goto(`${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}${features[0].browserParams}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${features[0].browserParams}&${miloLibs}`); }); await test.step('Validate Iframe block content', async () => { diff --git a/tests/milo/marquee.block.test.js b/tests/milo/marquee.block.test.js index 7439fe65..6aef8ac8 100644 --- a/tests/milo/marquee.block.test.js +++ b/tests/milo/marquee.block.test.js @@ -6,6 +6,8 @@ import MarqueeBlock from '../../selectors/milo/marquee.block.page.js'; let webUtil; let marquee; let consoleErrors = []; + +const miloLibs = process.env.MILO_LIBS || ''; const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED','adobeid-na1-stg1.services']; test.describe('Milo Marquee Block test suite', () => { @@ -26,13 +28,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 0 : Marquee (light) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to Marquee (light) block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify marquee(light) specs', async () => { @@ -61,13 +63,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 1 : Marquee (small) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to Marquee (small) block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (small) specs', async () => { @@ -94,13 +96,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 2 : Marquee (small,light) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to Marquee (small, light ) block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (small, light) specs', async () => { @@ -130,13 +132,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 3 : Marquee (large) test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to Marquee (large ) block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large) specs', async () => { @@ -165,13 +167,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 4 : Marquee (large,light) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Go to Marquee (large, light ) block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large, light) specs', async () => { @@ -200,13 +202,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 5 : Marquee (quiet) test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const { data } = features[5]; await test.step('step-1: Go to Marquee (quiet ) block test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (quiet) specs', async () => { @@ -233,13 +235,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 6 : Marquee (inline) test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); const { data } = features[6]; await test.step('step-1: Go to Marquee (inline ) block test page', async () => { - await page.goto(`${baseURL}${features[6].path}`); + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (inline) specs', async () => { @@ -264,13 +266,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 7 : Marquee (split,small) test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[7].path}`); + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); const { data } = features[7]; await test.step('step-1: Go to Marquee (split, small ) block test page', async () => { - await page.goto(`${baseURL}${features[7].path}`); + await page.goto(`${baseURL}${features[7].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}`); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, small) specs', async () => { @@ -299,13 +301,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 8 : Marquee (split,large) test(`${features[8].name},${features[8].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[8].path}`); + console.info(`[Test Page]: ${baseURL}${features[8].path}${miloLibs}`); const { data } = features[8]; await test.step('step-1: Go to Marquee (split, large ) block test page', async () => { - await page.goto(`${baseURL}${features[8].path}`); + await page.goto(`${baseURL}${features[8].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[8].path}`); + await expect(page).toHaveURL(`${baseURL}${features[8].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, large) specs ', async () => { @@ -338,13 +340,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 9 : Marquee (split,one-third,large,light) test(`${features[9].name},${features[9].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[9].path}`); + console.info(`[Test Page]: ${baseURL}${features[9].path}${miloLibs}`); const { data } = features[9]; await test.step('step-1: Go to Marquee (split, one-third, large, light ) block test page', async () => { - await page.goto(`${baseURL}${features[9].path}`); + await page.goto(`${baseURL}${features[9].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[9].path}`); + await expect(page).toHaveURL(`${baseURL}${features[9].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, one-third, large, light) specs', async () => { @@ -377,13 +379,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 10 : Marquee (split,one-third) test(`${features[10].name},${features[10].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[10].path}`); + console.info(`[Test Page]: ${baseURL}${features[10].path}${miloLibs}`); const { data } = features[10]; await test.step('step-1: Go to Marquee (split, one-third ) block test page', async () => { - await page.goto(`${baseURL}${features[10].path}`); + await page.goto(`${baseURL}${features[10].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[10].path}`); + await expect(page).toHaveURL(`${baseURL}${features[10].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split, one-third) specs', async () => { @@ -416,13 +418,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 11 : Marquee (split,one-third,small,light) test(`${features[11].name},${features[11].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[11].path}`); + console.info(`[Test Page]: ${baseURL}${features[11].path}${miloLibs}`); const { data } = features[11]; await test.step('step-1: Go to Marquee (split,one-third,small,light ) block test page', async () => { - await page.goto(`${baseURL}${features[11].path}`); + await page.goto(`${baseURL}${features[11].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[11].path}`); + await expect(page).toHaveURL(`${baseURL}${features[11].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (split,one-third,small,light) specs', async () => { @@ -452,13 +454,13 @@ test.describe('Milo Marquee Block test suite', () => { test(`${features[12].name},${features[12].tags}`, async ({ page, baseURL, browserName }) => { test.slow(); test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers') - console.info(`[Test Page]: ${baseURL}${features[12].path}`); + console.info(`[Test Page]: ${baseURL}${features[12].path}${miloLibs}`); const { data } = features[12]; await test.step('step-1: Go to Marquee (small) block test page', async () => { - await page.goto(`${baseURL}${features[12].path}`); + await page.goto(`${baseURL}${features[12].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[12].path}`); + await expect(page).toHaveURL(`${baseURL}${features[12].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (small) background video playsinline specs', async () => { @@ -487,13 +489,13 @@ test.describe('Milo Marquee Block test suite', () => { test(`${features[13].name},${features[13].tags}`, async ({ page, baseURL, browserName }) => { test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers') test.slow(); - console.info(`[Test Page]: ${baseURL}${features[13].path}`); + console.info(`[Test Page]: ${baseURL}${features[13].path}${miloLibs}`); const { data } = features[13]; await test.step('step-1: Go to Marquee (large, light ) block test page', async () => { - await page.goto(`${baseURL}${features[13].path}`); + await page.goto(`${baseURL}${features[13].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[13].path}`); + await expect(page).toHaveURL(`${baseURL}${features[13].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large, light) desktop background specs', async () => { @@ -526,13 +528,13 @@ test.describe('Milo Marquee Block test suite', () => { // Test 14 : Marquee large (background video playsinline loop once) test(`${features[14].name},${features[14].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[14].path}`); + console.info(`[Test Page]: ${baseURL}${features[14].path}${miloLibs}`); const { data } = features[14]; await test.step('step-1: Go to Marquee (large, dark ) block test page', async () => { - await page.goto(`${baseURL}${features[14].path}`); + await page.goto(`${baseURL}${features[14].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[14].path}`); + await expect(page).toHaveURL(`${baseURL}${features[14].path}${miloLibs}`); }); await test.step('step-2: Verify Marquee (large, dark) background specs', async () => { diff --git a/tests/milo/media.block.test.js b/tests/milo/media.block.test.js index a049a5f5..1d3335fe 100644 --- a/tests/milo/media.block.test.js +++ b/tests/milo/media.block.test.js @@ -6,6 +6,7 @@ import MediaBlock from '../../selectors/milo/media.block.page.js'; let webUtil; let media; let consoleErrors = []; +const miloLibs = process.env.MILO_LIBS || ''; const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED','adobeid-na1-stg1.services']; test.describe('Milo Media Block test suite', () => { @@ -26,13 +27,13 @@ test.describe('Milo Media Block test suite', () => { // Test 0 : Media (small) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to Media (small) block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify media (small) block specs', async () => { @@ -61,13 +62,13 @@ test.describe('Milo Media Block test suite', () => { // Test 1 : Media test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to media block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify media block specs', async () => { @@ -95,13 +96,13 @@ test.describe('Milo Media Block test suite', () => { // Test 2 : Media (large, dark) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to media block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify media (large, dark) block specs', async () => { @@ -131,13 +132,13 @@ test.describe('Milo Media Block test suite', () => { test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL, browserName }) => { test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers') test.slow(); - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to media block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify media (large, dark) block specs', async () => { @@ -166,13 +167,13 @@ test.describe('Milo Media Block test suite', () => { // Test 5 : Media (large, dark) video, autoplay loop once test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Go to media block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify media (large, dark) block specs', async () => { diff --git a/tests/milo/merchcard.block.test.js b/tests/milo/merchcard.block.test.js index bef690aa..b19a7efd 100644 --- a/tests/milo/merchcard.block.test.js +++ b/tests/milo/merchcard.block.test.js @@ -6,6 +6,8 @@ import MerchCard from '../../selectors/milo/merchcard.block.page.js'; let merchCard; let webUtil; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Modal feature test suite', () => { test.beforeEach(async ({ page }) => { merchCard = new MerchCard(page); @@ -14,13 +16,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 0 : Merch Card (Segment) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const data = features[0].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card content/specs', async () => { @@ -46,13 +48,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 1 : Merch Card (Segment) with Badge test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const data = features[1].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card with Badge content/specs', async () => { @@ -85,13 +87,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 2 : Merch Card (Special Offers) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const data = features[2].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card special offers content/specs', async () => { @@ -113,13 +115,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 3 : Merch Card (Special Offers) with badge test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const data = features[3].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card special offers content/specs', async () => { @@ -151,13 +153,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 4 : Merch Card (plans) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const data = features[4].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card special offers content/specs', async () => { @@ -180,13 +182,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 5 : Merch Card (plans) with badge test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const data = features[5].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card special offers content/specs', async () => { @@ -213,13 +215,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 6 : Merch Card (plans) with secure // Note: skipping the test as there were failures, informed the team test.skip(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); const data = features[6].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[6].path}`); + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card special offers content/specs', async () => { @@ -260,13 +262,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 7 : Merch Card (plans, secure) with badge // Note: skipping the test as there were failures, informed the team test.skip(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[7].path}`); + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); const data = features[7].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[7].path}`); + await page.goto(`${baseURL}${features[7].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}`); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card special offers content/specs', async () => { @@ -305,13 +307,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 8 : Merch Card (catalog) test(`${features[8].name},${features[8].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[8].path}`); + console.info(`[Test Page]: ${baseURL}${features[8].path}${miloLibs}`); const data = features[8].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[8].path}`); + await page.goto(`${baseURL}${features[8].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[8].path}`); + await expect(page).toHaveURL(`${baseURL}${features[8].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card catalog content/specs', async () => { @@ -337,13 +339,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 9 : Merch Card (catalog) with badge test(`${features[9].name},${features[9].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[9].path}`); + console.info(`[Test Page]: ${baseURL}${features[9].path}${miloLibs}`); const data = features[9].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[9].path}`); + await page.goto(`${baseURL}${features[9].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[9].path}`); + await expect(page).toHaveURL(`${baseURL}${features[9].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card catalog with badge content/specs', async () => { @@ -374,13 +376,13 @@ test.describe('Milo Modal feature test suite', () => { // Test 10 : Merch Card (catalog) with more info and badge test(`${features[10].name},${features[10].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[10].path}`); + console.info(`[Test Page]: ${baseURL}${features[10].path}${miloLibs}`); const data = features[10].data; await test.step('step-1: Go to Merch Card feature test page', async () => { - await page.goto(`${baseURL}${features[10].path}`); + await page.goto(`${baseURL}${features[10].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[10].path}`); + await expect(page).toHaveURL(`${baseURL}${features[10].path}${miloLibs}`); }); await test.step('step-2: Verify Merch Card catalog with badge content/specs', async () => { diff --git a/tests/milo/modal.block.test.js b/tests/milo/modal.block.test.js index ba972b6f..e8077d2b 100644 --- a/tests/milo/modal.block.test.js +++ b/tests/milo/modal.block.test.js @@ -6,6 +6,8 @@ import ModalBlock from '../../selectors/milo/modal.block.page.js'; let modal; let webUtil; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Modal feature test suite', () => { test.beforeEach(async ({ page }) => { modal = new ModalBlock(page); @@ -14,12 +16,12 @@ test.describe('Milo Modal feature test suite', () => { // Test 0 : Modal with Text block test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to Modal feature test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Modal text fragment content/specs', async () => { @@ -47,12 +49,12 @@ test.describe('Milo Modal feature test suite', () => { // Test 1 : Modal with Media block test(`${features[1].name}, ${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); await test.step('step-1: Go to Modal feature test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Modal media fragement content/specs', async () => { @@ -82,12 +84,12 @@ test.describe('Milo Modal feature test suite', () => { // Test 2 : Modal with Video Autoplay test(`${features[2].name}, ${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); await test.step('step-1: Go to Modal feature test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Modal media fragement content/specs', async () => { diff --git a/tests/milo/personalization.feature.test.js b/tests/milo/personalization.feature.test.js index 8b01fccd..8d3fd98e 100644 --- a/tests/milo/personalization.feature.test.js +++ b/tests/milo/personalization.feature.test.js @@ -11,6 +11,8 @@ let marquee; let text; let pznUrl; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Personalization feature test suite', () => { test.beforeEach(async ({ page }) => { webUtil = new WebUtil(page); @@ -18,16 +20,16 @@ test.describe('Milo Personalization feature test suite', () => { // Test 0 : Personalization (Replace content) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const data = features[0].data; text = new TextBlock(page); marquee = new MarqueeBlock(page); - pznUrl = `${baseURL}${features[0].path}${'?target='}${data.target}` + pznUrl = `${baseURL}${features[0].path}${'?target='}${data.target}&${miloLibs}` await test.step('step-1: Go to default test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify default test page content/specs', async () => { @@ -51,16 +53,16 @@ test.describe('Milo Personalization feature test suite', () => { // Test 1 : Personalization (Insert Content Before) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const data = features[1].data; text = new TextBlock(page); marquee = new MarqueeBlock(page); - pznUrl = `${baseURL}${features[1].path}${'?target='}${data.target}` + pznUrl = `${baseURL}${features[1].path}${'?target='}${data.target}&${miloLibs}` await test.step('step-1: Go to default test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify default test page content/specs', async () => { @@ -90,16 +92,16 @@ test.describe('Milo Personalization feature test suite', () => { // Test 2 : Personalization (Insert Content After) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const data = features[2].data; text = new TextBlock(page); howto = new Howto(page); - pznUrl = `${baseURL}${features[2].path}${'?target='}${data.target}` + pznUrl = `${baseURL}${features[2].path}${'?target='}${data.target}&${miloLibs}` await test.step('step-1: Go to default test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify default test page content/specs', async () => { diff --git a/tests/milo/quote.block.test.js b/tests/milo/quote.block.test.js index bcecd2a5..ef914a42 100644 --- a/tests/milo/quote.block.test.js +++ b/tests/milo/quote.block.test.js @@ -6,6 +6,8 @@ import QuoteBlock from '../../selectors/milo/quote.block.page.js'; let quote; let webUtil +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Quote Block test suite', () => { test.beforeEach(async ({ page }) => { webUtil = new WebUtil(page); @@ -14,13 +16,13 @@ test.describe('Milo Quote Block test suite', () => { // Test 0 : Quote default block test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to Quote block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Quote block content/specs', async () => { @@ -37,13 +39,13 @@ test.describe('Milo Quote Block test suite', () => { // Test 1 : quote (contained) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to Quote block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Quote (contained) block content/specs', async () => { @@ -59,13 +61,13 @@ test.describe('Milo Quote Block test suite', () => { // Test 2 : Quote (inline,contained) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to Quote (inline) block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Quote (inline) block content/specs', async () => { @@ -82,13 +84,13 @@ test.describe('Milo Quote Block test suite', () => { // Test 3 : quote (borders) test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[MiloInfo] Checking page: ${baseURL}${features[3].path}`); + console.info(`[MiloInfo] Checking page: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to Quote (borders) block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Quote (borders) block content/specs', async () => { @@ -104,13 +106,13 @@ test.describe('Milo Quote Block test suite', () => { // Test 4 : quote (align-right) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Go to Quote (align-right) block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Quote (align-right) block content/specs', async () => { @@ -126,13 +128,13 @@ test.describe('Milo Quote Block test suite', () => { // Test 5 : quote (xl-spaced) test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const { data } = features[5]; await test.step('step-1: Go to Quote (xl-spaced) block test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Quote (xl-spaced) block content/specs', async () => { diff --git a/tests/milo/review.block.test.js b/tests/milo/review.block.test.js index bc6151af..aea505a2 100644 --- a/tests/milo/review.block.test.js +++ b/tests/milo/review.block.test.js @@ -4,6 +4,8 @@ import ReviewBlock from '../../selectors/milo/review.block.page.js'; let review; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Review Block test suite', () => { test.beforeEach(async ({ page, browser }) => { // review block requires clearing cookies @@ -13,12 +15,12 @@ test.describe('Milo Review Block test suite', () => { }); test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); await test.step('step-1: Go to review feature test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify review block and submit the review < 3', async () => { @@ -29,12 +31,12 @@ test.describe('Milo Review Block test suite', () => { }); test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); await test.step('step-1: Go to review block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify review block and submit the review > 3', async () => { diff --git a/tests/milo/tab.block.test.js b/tests/milo/tab.block.test.js index 93db25cf..a0bbe178 100644 --- a/tests/milo/tab.block.test.js +++ b/tests/milo/tab.block.test.js @@ -4,6 +4,8 @@ import TabBlock from '../../selectors/milo/tabs.block.page.js'; let tab; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Tab block feature test suite', () => { test.beforeEach(async ({ page }) => { tab = new TabBlock(page); @@ -11,13 +13,13 @@ test.describe('Milo Tab block feature test suite', () => { // Test 0 : Tabs (xl-spacing) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const data = features[0].data; await test.step('step-1: Go to Tabs block feature test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify tabs content/specs', async () => { @@ -43,13 +45,13 @@ test.describe('Milo Tab block feature test suite', () => { // Test 1 : Tabs (Quiet, Dark, Center) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const data = features[1].data; await test.step('step-1: Go to Tabs block feature test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify tabs content/specs', async () => { diff --git a/tests/milo/table.block.test.js b/tests/milo/table.block.test.js index 08bb26b4..e30f706b 100644 --- a/tests/milo/table.block.test.js +++ b/tests/milo/table.block.test.js @@ -4,6 +4,8 @@ import TableBlock from '../../selectors/milo/table.block.page'; let table; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Table block feature test suite', () => { test.beforeEach(async ({ page }) => { table = new TableBlock(page); @@ -11,13 +13,13 @@ test.describe('Milo Table block feature test suite', () => { // Test 0 : Table block (default) test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const data = features[0].data; await test.step('step-1: Go to Table block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify table content/specs', async () => { @@ -43,13 +45,13 @@ test.describe('Milo Table block feature test suite', () => { // Test 1 : Table (highlight) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const data = features[1].data; await test.step('step-1: Go to Table block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify table content/specs', async () => { @@ -83,13 +85,13 @@ test.describe('Milo Table block feature test suite', () => { // Test 2 : Table (sticky) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const data = features[2].data; await test.step('step-1: Go to Table block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify table content/specs', async () => { @@ -119,13 +121,13 @@ test.describe('Milo Table block feature test suite', () => { // Test 3 : Table (highlight, collapse, sticky) test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const data = features[3].data; await test.step('step-1: Go to Table block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify table content/specs', async () => { @@ -165,13 +167,13 @@ test.describe('Milo Table block feature test suite', () => { // Test 4 : Table (merch) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const data = features[4].data; await test.step('step-1: Go to Table block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify table content/specs', async () => { diff --git a/tests/milo/text.block.test.js b/tests/milo/text.block.test.js index 98bdd25c..cdd221d5 100644 --- a/tests/milo/text.block.test.js +++ b/tests/milo/text.block.test.js @@ -6,6 +6,8 @@ import TextBlock from '../../selectors/milo/text.block.page.js'; let text; let webUtil; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Text Block test suite', () => { test.beforeEach(async ({ page }) => { text = new TextBlock(page); @@ -14,13 +16,13 @@ test.describe('Milo Text Block test suite', () => { // Test 0 : Text test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to Text block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Text specs', async () => { @@ -43,13 +45,13 @@ test.describe('Milo Text Block test suite', () => { // Test 1 : Text (intro) test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to Text (intro) block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify Text (intro) specs', async () => { @@ -70,13 +72,13 @@ test.describe('Milo Text Block test suite', () => { // Test 2 : Text (full-width) test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to Text (full width) block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify Text (full width) specs', async () => { @@ -100,13 +102,13 @@ test.describe('Milo Text Block test suite', () => { // Test 3 : Text (full-width, large) test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to text (full-width, large) block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify Text (full-width, large) specs', async () => { @@ -129,13 +131,13 @@ test.describe('Milo Text Block test suite', () => { // Test 4 : Text (long-form, large) test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Go to Text (long form, large) block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify Text (long form, large) specs', async () => { @@ -158,13 +160,13 @@ test.describe('Milo Text Block test suite', () => { // Test 5 : Text (inset, medium, m-spacing) test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const { data } = features[5]; await test.step('step-1: Go to Text (inset, medium, m-spacing ) block test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify Text (inset, large, m spacing) specs', async () => { @@ -187,13 +189,13 @@ test.describe('Milo Text Block test suite', () => { // Test 6 : Text (legal) test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); const { data } = features[6]; await test.step('step-1: Go to Text (legal) block test page', async () => { - await page.goto(`${baseURL}${features[6].path}`); + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); }); await test.step('step-2: Verify Text (legal) specs', async () => { @@ -214,13 +216,13 @@ test.describe('Milo Text Block test suite', () => { }); test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[7].path}`); + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); const { data } = features[7]; await test.step('step-1: Go to Text (link-farm) block test page', async () => { - await page.goto(`${baseURL}${features[7].path}`); + await page.goto(`${baseURL}${features[7].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}`); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); }); await test.step('step-2: Verify Text (link-farm) specs', async () => { diff --git a/tests/milo/video.block.test.js b/tests/milo/video.block.test.js index b99976a8..1b8bd4b5 100644 --- a/tests/milo/video.block.test.js +++ b/tests/milo/video.block.test.js @@ -6,6 +6,7 @@ import VideoBlock from '../../selectors/milo/video.block.page.js'; let webUtil; let video; let consoleErrors = []; +const miloLibs = process.env.MILO_LIBS || ''; const knownConsoleErrors = ['Access-Control-Allow-Origin','Failed to load resource: net::ERR_FAILED']; test.describe('Milo Video Block test suite', () => { @@ -26,13 +27,13 @@ test.describe('Milo Video Block test suite', () => { // Test 0 : Video default test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -51,13 +52,13 @@ test.describe('Milo Video Block test suite', () => { // Test 1 : Video autoplay loop test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -76,13 +77,13 @@ test.describe('Milo Video Block test suite', () => { // Test 2 : Video autoplay loop once test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -101,13 +102,13 @@ test.describe('Milo Video Block test suite', () => { // Test 3 : Video hover play test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -129,13 +130,13 @@ test.describe('Milo Video Block test suite', () => { // Test 4 : MPC Video test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[4].path}`); + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); const { data } = features[4]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[4].path}`); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[4].path}`); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -158,13 +159,13 @@ test.describe('Milo Video Block test suite', () => { // Test 5 : MPC Video Autoplay Looping test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[5].path}`); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); const { data } = features[5]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[5].path}`); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[5].path}`); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -186,13 +187,13 @@ test.describe('Milo Video Block test suite', () => { // Test 6 : Youtube Video test(`${features[6].name},${features[6].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[6].path}`); + console.info(`[Test Page]: ${baseURL}${features[6].path}${miloLibs}`); const { data } = features[6]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[6].path}`); + await page.goto(`${baseURL}${features[6].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[6].path}`); + await expect(page).toHaveURL(`${baseURL}${features[6].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -214,13 +215,13 @@ test.describe('Milo Video Block test suite', () => { // Test 7 : Modal Video default test(`${features[7].name},${features[7].tags}`, async ({ page, baseURL }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[7].path}`); + console.info(`[Test Page]: ${baseURL}${features[7].path}${miloLibs}`); const { data } = features[7]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[7].path}`); + await page.goto(`${baseURL}${features[7].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[7].path}`); + await expect(page).toHaveURL(`${baseURL}${features[7].path}${miloLibs}`); }); await test.step('step-2: Verify video block content/specs', async () => { @@ -243,13 +244,13 @@ test.describe('Milo Video Block test suite', () => { // Test 8 : Modal video with cards test(`${features[8].name},${features[8].tags}`, async ({ page, baseURL,browserName }) => { test.slow(); - console.info(`[Test Page]: ${baseURL}${features[8].path}`); + console.info(`[Test Page]: ${baseURL}${features[8].path}${miloLibs}`); const { data } = features[8]; await test.step('step-1: Go to video block test page', async () => { - await page.goto(`${baseURL}${features[8].path}`); + await page.goto(`${baseURL}${features[8].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[8].path}`); + await expect(page).toHaveURL(`${baseURL}${features[8].path}${miloLibs}`); }); await test.step('step-2: Verify consonant cards with modal video block content/specs', async () => { diff --git a/tests/milo/zpattern.block.test.js b/tests/milo/zpattern.block.test.js index 2930397e..85b7adb0 100644 --- a/tests/milo/zpattern.block.test.js +++ b/tests/milo/zpattern.block.test.js @@ -6,6 +6,8 @@ import ZPatternBlock from '../../selectors/milo/zpattern.block.page.js'; let webUtil; let zpattern; +const miloLibs = process.env.MILO_LIBS || ''; + test.describe('Milo Z Pattern Block test suite', () => { test.beforeEach(async ({ page }) => { webUtil = new WebUtil(page); @@ -14,13 +16,13 @@ test.describe('Milo Z Pattern Block test suite', () => { // Test 0 : ZPattern default block test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[0].path}`); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); const { data } = features[0]; await test.step('step-1: Go to Z Pattern block test page', async () => { - await page.goto(`${baseURL}${features[0].path}`); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[0].path}`); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); }); await test.step('step-2: Verify Z Pattern block specs', async () => { @@ -53,13 +55,13 @@ test.describe('Milo Z Pattern Block test suite', () => { // Test 1 :ZPattern (small) block test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[1].path}`); + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); const { data } = features[1]; await test.step('step-1: Go to z-pattern (small) block test page', async () => { - await page.goto(`${baseURL}${features[1].path}`); + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[1].path}`); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); }); await test.step('step-2: Verify z-pattern (small) block specs', async () => { @@ -92,13 +94,13 @@ test.describe('Milo Z Pattern Block test suite', () => { // Test 2 :Zpattern (large) block test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[2].path}`); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); const { data } = features[2]; await test.step('step-1: Go to z-pattern (large) block test page', async () => { - await page.goto(`${baseURL}${features[2].path}`); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[2].path}`); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); }); await test.step('step-2: Verify z-pattern (large) block specs', async () => { @@ -131,13 +133,13 @@ test.describe('Milo Z Pattern Block test suite', () => { // Test 3 :Zpattern (dark) block test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { - console.info(`[Test Page]: ${baseURL}${features[3].path}`); + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); const { data } = features[3]; await test.step('step-1: Go to z-pattern (large) block test page', async () => { - await page.goto(`${baseURL}${features[3].path}`); + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); await page.waitForLoadState('domcontentloaded'); - await expect(page).toHaveURL(`${baseURL}${features[3].path}`); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); }); await test.step('step-2: Verify z-pattern (dark) block specs', async () => {