Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Updating tests to pass on bacom. #419

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions features/milo/georouting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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',
Expand All @@ -25,7 +25,7 @@ module.exports = {
desc: 'User is accessing the US page with a query parameter (akamaiLocale=DE).',
path: '/drafts/nala/features/georouting/georouting?akamaiLocale=DE',
data: {
title: 'Diese Adobe-Site passt nicht zu deinem Standort.',
title: /Diese Adobe-Site passt nicht zu deinem Standort\.?/,
text: 'Basierend auf deiner IP-Adresse könnte die Website für Deutschland passender sein.',
button: 'Deutschland',
link: 'United States',
Expand Down Expand Up @@ -59,23 +59,23 @@ module.exports = {
data: {
tab1: {
name: 'Deutsch',
title: 'Diese Adobe-Site passt nicht zu deinem Standort.',
title: /Diese Adobe-Site passt nicht zu deinem Standort\.?/,
text: 'Basierend auf deiner IP-Adresse könnte die Website für Schweiz passender sein.',
button: 'Schweiz',
link: 'United States',
flag: 'Schweiz',
},
tab2: {
name: 'Français',
title: 'Ce site Adobe ne correspond pas à votre zone géographique.',
title: /Ce site Adobe ne correspond pas à votre zone géographique\.?/,
text: 'Pour accéder à du contenu, des offres et des tarifs correspondant davantage à votre zone géographique, rendez-vous plutôt sur le site web Suisse.',
button: 'Suisse',
link: 'United States',
flag: 'Suisse',
},
tab3: {
name: 'Italiano',
title: 'Questo sito Adobe non corrisponde alla tua posizione geografica.',
title: /Questo sito Adobe non corrisponde alla tua posizione geografica\.?/,
text: 'In base alla tua posizione, ti consigliamo di consultare il sito web di Adobe Svizzera, dove troverai contenuti, offerte e prezzi specifici per la tua area geografica.',
button: 'Svizzera',
link: 'United States',
Expand Down
6 changes: 3 additions & 3 deletions features/milo/merchcard.block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = {
description: 'The complete PDF solution for working anywhere (includes desktop, web, and mobile access).',
link1Text: 'See plan & pricing details',
checkboxLabel: 'Add a 30-day free trial of Adobe Stock.*',
secureLabel: 'Secure transaction',
secureLabel: /Secure transaction/i,
footerBlueButton1Text: 'Buy now',
footerBlueButton2Text: 'Buy now',
footerOutlineButtonText: 'Free trial',
Expand All @@ -125,8 +125,8 @@ module.exports = {
description: 'Get 20+ Creative Cloud apps including Photoshop, Illustrator, Adobe Express, Premiere Pro, and Acrobat Pro. (Substance 3D apps are not included.)',
link1Text: 'See plan & pricing details',
checkboxLabel: 'Add a 30-day free trial of Adobe Stock.*',
secureLabel: 'Secure transaction',
footerBlueButton1Text: 'Buy now',
secureLabel: /Secure transaction/i,
footerBlueButton1Text: /Buy now/i,
footerOutlineButtonText: 'Free trial',
},
tags: '@merch-card @smoke @regression @milo',
Expand Down
20 changes: 15 additions & 5 deletions tests/milo/commerce.feature.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ import FedsHeader from '../../selectors/feds/feds.header.page.js';
const miloLibs = process.env.MILO_LIBS || '';

let COMM;
test.beforeEach(async ({ page }) => { COMM = new CommercePage(page); });
test.beforeEach(async ({ page, baseURL }) => {
COMM = new CommercePage(page);
const skipOn = ['bacom', 'business'];

skipOn.some((skip) => {
if (baseURL.includes(skip)) test.skip(true, `Skipping the commerce tests for ${baseURL}`);
return null;
});
});

test.describe('Commerce feature test suite', () => {
// @Commerce-Price-Term - Validate price with term display
Expand Down Expand Up @@ -292,17 +300,19 @@ test.describe('Commerce feature test suite', () => {
await webUtil.scrollPage('down', 'slow');
const unresolvedPlaceholders = await page.evaluate(
() => [...document.querySelectorAll('[data-wcs-osi]')].filter(
(el) => !el.classList.contains('placeholder-resolved')
));
(el) => !el.classList.contains('placeholder-resolved'),
),
);
expect(unresolvedPlaceholders.length).toBe(0);
});

// Validate commerce checkout links are indeed commerce
await test.step('Validate checkout links', async () => {
const invalidCheckoutLinks = await page.evaluate(
() => [...document.querySelectorAll('[data-wcs-osi][is="checkout-link"]')].filter(
(el) => !el.getAttribute('href').includes('commerce')
));
(el) => !el.getAttribute('href').includes('commerce'),
),
);
expect(invalidCheckoutLinks.length).toBe(0);
});
});
Expand Down
9 changes: 8 additions & 1 deletion tests/milo/personalization.feature.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@ test.describe('Milo Personalization feature test suite', () => {
webUtil = new WebUtil(page);
});

test.beforeAll(async ({ browserName }) => {
test.beforeAll(async ({ browserName, baseURL }) => {
if (browserName === 'chromium') {
test.skip('Skipping tests for Chromium browser');
}

const skipOn = ['bacom', 'business'];

skipOn.some((skip) => {
if (baseURL.includes(skip)) test.skip(true, `Skipping the personalization tests for ${baseURL}`);
return null;
});
});

// Test 0 : Personalization (Replace content)
Expand Down
10 changes: 9 additions & 1 deletion tests/milo/promotions.feature.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import PromoPage from '../../selectors/milo/promotions.feature.page.js';
const miloLibs = process.env.MILO_LIBS || '';

let PROMO;
test.beforeEach(async ({ page }) => { PROMO = new PromoPage(page); });
test.beforeEach(async ({ page, baseURL }) => {
PROMO = new PromoPage(page);
const skipOn = ['bacom', 'business'];

skipOn.some((skip) => {
if (baseURL.includes(skip)) test.skip(true, `Skipping the promo tests for ${baseURL}`);
return null;
});
});

test.describe('Promotions feature test suite', () => {
// @Promo-insert - Validate promo insert text after marquee and before text component
Expand Down
Loading