Skip to content

Commit

Permalink
Updating tests to pass on bacom. (#419)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Li <[email protected]>
  • Loading branch information
Dli3 and Dennis Li authored Aug 15, 2024
1 parent 8aca645 commit dd108f4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 15 deletions.
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

0 comments on commit dd108f4

Please sign in to comment.