From 42c9c904b1fb4072084fb0f7623ea77ef2e024df Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Fri, 18 Oct 2024 13:10:53 +0200 Subject: [PATCH 01/13] Testing pop-up selector timeout --- nala/blocks/popups/popups.spec.js | 18 +++++++++--------- nala/blocks/popups/popups.test.js | 14 ++++++++++---- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/nala/blocks/popups/popups.spec.js b/nala/blocks/popups/popups.spec.js index d72c093..ff3f561 100644 --- a/nala/blocks/popups/popups.spec.js +++ b/nala/blocks/popups/popups.spec.js @@ -5,7 +5,7 @@ export default { tcid: '1', name: '@desc-regression-geo-pop-up-german-locale', path: '/channelpartners/?akamaiLocale=de', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Diese Adobe-Site passt nicht zu Ihrem Standort', buttonType: 'Switch:de-us|Geo_Routing_Modal', @@ -16,7 +16,7 @@ export default { tcid: '2', name: '@desc-regression-geo-pop-up-spanish-locale', path: '/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:es-us|Geo_Routing_Modal', @@ -27,7 +27,7 @@ export default { tcid: '3', name: '@desc-regression-geo-pop-up-french-locale', path: '/channelpartners/?akamaiLocale=fr', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Ce site Adobe ne correspond pas à votre zone géographique', buttonType: 'Switch:fr-us|Geo_Routing_Modal', @@ -38,7 +38,7 @@ export default { tcid: '4', name: '@desc-regression-geo-pop-up-italian-locale', path: '/channelpartners/?akamaiLocale=it', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Questo sito Adobe non corrisponde alla tua posizione geografica', buttonType: 'Switch:it-us|Geo_Routing_Modal', @@ -49,7 +49,7 @@ export default { tcid: '5', name: '@desc-regression-geo-pop-up-japanese-locale', path: '/channelpartners/?akamaiLocale=jp', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'アドビwebサイトの地域設定がお客様の位置情報と一致しません', buttonType: 'Switch:jp-us|Geo_Routing_Modal', @@ -60,7 +60,7 @@ export default { tcid: '6', name: '@desc-regression-geo-pop-up-chinese-locale', path: '/channelpartners/?akamaiLocale=cn', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: '此 Adobe 网站与您的位置不匹配', buttonType: 'Switch:cn-us|Geo_Routing_Modal', @@ -71,7 +71,7 @@ export default { tcid: '7', name: '@desc-regression-geo-pop-up-brazilian-locale', path: '/channelpartners/?akamaiLocale=br', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:la-us|Geo_Routing_Modal', @@ -82,7 +82,7 @@ export default { tcid: '8', name: '@desc-regression-accessing-german-public-page-switch-to-spanish-locale', path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', @@ -97,7 +97,7 @@ export default { tcid: '9', name: '@desc-regression-accessing-german-public-page-stay-on-german-locale', path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', diff --git a/nala/blocks/popups/popups.test.js b/nala/blocks/popups/popups.test.js index adb9197..603e679 100644 --- a/nala/blocks/popups/popups.test.js +++ b/nala/blocks/popups/popups.test.js @@ -25,6 +25,10 @@ test.describe('Validate popups', () => { } }); + async function getGeoPopUpSelector(popUpText) { + return `div.georouting-wrapper:has-text("${popUpText}")`; + } + differentLocaleCases.forEach((feature) => { test(`${feature.name},${feature.tags}`, async ({ page, baseURL }) => { const newBaseUrl = baseURL.includes('adobecom.hlx.live') ? 'https://partners.stage.adobe.com' : baseURL; @@ -34,8 +38,9 @@ test.describe('Validate popups', () => { }); await test.step('Verify geo pop-up appeared', async () => { - const geoPopUp = await popupsPage.getGeoPopUpElement(feature.data.geoPopUpText); - await expect(geoPopUp).toBeVisible(); + const geoPopUpSelector = await getGeoPopUpSelector(feature.data.geoPopUpText); + await page.waitForSelector(geoPopUpSelector, { timeout: 4000 }); + const switchLocaleButton = await popupsPage.getGeoLocaleButton(feature.data.buttonType); await expect(switchLocaleButton).toBeVisible(); const href = await switchLocaleButton.getAttribute('href'); @@ -53,8 +58,9 @@ test.describe('Validate popups', () => { }); await test.step('Verify geo pop-up appeared', async () => { - const geoPopUp = await popupsPage.getGeoPopUpElement(feature.data.geoPopUpText); - await expect(geoPopUp).toBeVisible(); + const geoPopUpSelector = await getGeoPopUpSelector(feature.data.geoPopUpText); + await page.waitForSelector(geoPopUpSelector, { timeout: 4000 }); + const switchLocaleButton = await popupsPage.getGeoLocaleButton(feature.data.switchLocaleButton); await expect(switchLocaleButton).toBeVisible(); const hrefSwitch = await switchLocaleButton.getAttribute('href'); From 0088a326da0faeac30a5b6446ebb66112a58cb62 Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Fri, 18 Oct 2024 14:56:44 +0200 Subject: [PATCH 02/13] Testing pop-up selector timeout --- nala/blocks/popups/popups.spec.js | 16 ++++++++-------- nala/blocks/popups/popups.test.js | 20 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/nala/blocks/popups/popups.spec.js b/nala/blocks/popups/popups.spec.js index ff3f561..72e93bc 100644 --- a/nala/blocks/popups/popups.spec.js +++ b/nala/blocks/popups/popups.spec.js @@ -16,7 +16,7 @@ export default { tcid: '2', name: '@desc-regression-geo-pop-up-spanish-locale', path: '/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:es-us|Geo_Routing_Modal', @@ -27,7 +27,7 @@ export default { tcid: '3', name: '@desc-regression-geo-pop-up-french-locale', path: '/channelpartners/?akamaiLocale=fr', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'Ce site Adobe ne correspond pas à votre zone géographique', buttonType: 'Switch:fr-us|Geo_Routing_Modal', @@ -38,7 +38,7 @@ export default { tcid: '4', name: '@desc-regression-geo-pop-up-italian-locale', path: '/channelpartners/?akamaiLocale=it', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'Questo sito Adobe non corrisponde alla tua posizione geografica', buttonType: 'Switch:it-us|Geo_Routing_Modal', @@ -49,7 +49,7 @@ export default { tcid: '5', name: '@desc-regression-geo-pop-up-japanese-locale', path: '/channelpartners/?akamaiLocale=jp', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'アドビwebサイトの地域設定がお客様の位置情報と一致しません', buttonType: 'Switch:jp-us|Geo_Routing_Modal', @@ -60,7 +60,7 @@ export default { tcid: '6', name: '@desc-regression-geo-pop-up-chinese-locale', path: '/channelpartners/?akamaiLocale=cn', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: '此 Adobe 网站与您的位置不匹配', buttonType: 'Switch:cn-us|Geo_Routing_Modal', @@ -71,7 +71,7 @@ export default { tcid: '7', name: '@desc-regression-geo-pop-up-brazilian-locale', path: '/channelpartners/?akamaiLocale=br', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:la-us|Geo_Routing_Modal', @@ -82,7 +82,7 @@ export default { tcid: '8', name: '@desc-regression-accessing-german-public-page-switch-to-spanish-locale', path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', @@ -97,7 +97,7 @@ export default { tcid: '9', name: '@desc-regression-accessing-german-public-page-stay-on-german-locale', path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression @anonymous', + tags: '@dme-popups @geo-popups @regression', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', diff --git a/nala/blocks/popups/popups.test.js b/nala/blocks/popups/popups.test.js index 603e679..bc884fa 100644 --- a/nala/blocks/popups/popups.test.js +++ b/nala/blocks/popups/popups.test.js @@ -11,6 +11,9 @@ const switchLocaleCases = features.slice(7, 9); test.describe('Validate popups', () => { test.beforeEach(async ({ page, baseURL, browserName, context }) => { popupsPage = new PopupsPage(page); + page.on('console', (msg) => { + console.log(`${msg.type()}: ${msg.text()}`, msg.type() === 'error' ? msg.location().url : null); + }); if (!baseURL.includes('partners.stage.adobe.com')) { await context.setExtraHTTPHeaders({ authorization: `token ${process.env.HLX_API_KEY}` }); } @@ -34,12 +37,25 @@ test.describe('Validate popups', () => { const newBaseUrl = baseURL.includes('adobecom.hlx.live') ? 'https://partners.stage.adobe.com' : baseURL; await test.step('Go to public page', async () => { await page.goto(`${newBaseUrl}${feature.path}`); - await page.waitForLoadState(); + await page.waitForLoadState('domcontentloaded'); }); await test.step('Verify geo pop-up appeared', async () => { + const modal = page.locator('div.dialog-modal.locale-modal-v2'); + const isModalVisible = await modal.isVisible(); + console.log(`Dialog modal is visible: ${isModalVisible}`); + const startTime = Date.now(); + const geoPopUpSelector = await getGeoPopUpSelector(feature.data.geoPopUpText); - await page.waitForSelector(geoPopUpSelector, { timeout: 4000 }); + await page.waitForSelector(geoPopUpSelector, { timeout: 20000 }); + + const endTime = Date.now(); + const duration = endTime - startTime; + console.log(`Dialog modal took ${duration} to load`); + + const modalAfter = page.locator('div.dialog-modal.locale-modal-v2'); + const isModalAfterVisible = await modalAfter.isVisible(); + console.log(`Dialog modal is visible: ${isModalAfterVisible}`); const switchLocaleButton = await popupsPage.getGeoLocaleButton(feature.data.buttonType); await expect(switchLocaleButton).toBeVisible(); From f77a56c81d1ee01fcab5c16876cf8bfb84c43e49 Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Fri, 18 Oct 2024 16:11:56 +0200 Subject: [PATCH 03/13] Testing pop-up selector timeout --- nala/blocks/popups/popups.spec.js | 16 ++++++++-------- nala/blocks/popups/popups.test.js | 23 ++--------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/nala/blocks/popups/popups.spec.js b/nala/blocks/popups/popups.spec.js index 72e93bc..ff3f561 100644 --- a/nala/blocks/popups/popups.spec.js +++ b/nala/blocks/popups/popups.spec.js @@ -16,7 +16,7 @@ export default { tcid: '2', name: '@desc-regression-geo-pop-up-spanish-locale', path: '/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:es-us|Geo_Routing_Modal', @@ -27,7 +27,7 @@ export default { tcid: '3', name: '@desc-regression-geo-pop-up-french-locale', path: '/channelpartners/?akamaiLocale=fr', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Ce site Adobe ne correspond pas à votre zone géographique', buttonType: 'Switch:fr-us|Geo_Routing_Modal', @@ -38,7 +38,7 @@ export default { tcid: '4', name: '@desc-regression-geo-pop-up-italian-locale', path: '/channelpartners/?akamaiLocale=it', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Questo sito Adobe non corrisponde alla tua posizione geografica', buttonType: 'Switch:it-us|Geo_Routing_Modal', @@ -49,7 +49,7 @@ export default { tcid: '5', name: '@desc-regression-geo-pop-up-japanese-locale', path: '/channelpartners/?akamaiLocale=jp', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'アドビwebサイトの地域設定がお客様の位置情報と一致しません', buttonType: 'Switch:jp-us|Geo_Routing_Modal', @@ -60,7 +60,7 @@ export default { tcid: '6', name: '@desc-regression-geo-pop-up-chinese-locale', path: '/channelpartners/?akamaiLocale=cn', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: '此 Adobe 网站与您的位置不匹配', buttonType: 'Switch:cn-us|Geo_Routing_Modal', @@ -71,7 +71,7 @@ export default { tcid: '7', name: '@desc-regression-geo-pop-up-brazilian-locale', path: '/channelpartners/?akamaiLocale=br', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:la-us|Geo_Routing_Modal', @@ -82,7 +82,7 @@ export default { tcid: '8', name: '@desc-regression-accessing-german-public-page-switch-to-spanish-locale', path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', @@ -97,7 +97,7 @@ export default { tcid: '9', name: '@desc-regression-accessing-german-public-page-stay-on-german-locale', path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression', + tags: '@dme-popups @geo-popups @regression @anonymous', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', diff --git a/nala/blocks/popups/popups.test.js b/nala/blocks/popups/popups.test.js index bc884fa..770b278 100644 --- a/nala/blocks/popups/popups.test.js +++ b/nala/blocks/popups/popups.test.js @@ -9,14 +9,8 @@ const differentLocaleCases = features.slice(0, 7); const switchLocaleCases = features.slice(7, 9); test.describe('Validate popups', () => { - test.beforeEach(async ({ page, baseURL, browserName, context }) => { + test.beforeEach(async ({ page, baseURL, browserName }) => { popupsPage = new PopupsPage(page); - page.on('console', (msg) => { - console.log(`${msg.type()}: ${msg.text()}`, msg.type() === 'error' ? msg.location().url : null); - }); - if (!baseURL.includes('partners.stage.adobe.com')) { - await context.setExtraHTTPHeaders({ authorization: `token ${process.env.HLX_API_KEY}` }); - } if (browserName === 'chromium' && !baseURL.includes('partners.stage.adobe.com')) { await page.route('https://www.adobe.com/chimera-api/**', async (route, request) => { const newUrl = request.url().replace( @@ -41,21 +35,8 @@ test.describe('Validate popups', () => { }); await test.step('Verify geo pop-up appeared', async () => { - const modal = page.locator('div.dialog-modal.locale-modal-v2'); - const isModalVisible = await modal.isVisible(); - console.log(`Dialog modal is visible: ${isModalVisible}`); - const startTime = Date.now(); - const geoPopUpSelector = await getGeoPopUpSelector(feature.data.geoPopUpText); - await page.waitForSelector(geoPopUpSelector, { timeout: 20000 }); - - const endTime = Date.now(); - const duration = endTime - startTime; - console.log(`Dialog modal took ${duration} to load`); - - const modalAfter = page.locator('div.dialog-modal.locale-modal-v2'); - const isModalAfterVisible = await modalAfter.isVisible(); - console.log(`Dialog modal is visible: ${isModalAfterVisible}`); + await page.waitForSelector(geoPopUpSelector, { timeout: 4000 }); const switchLocaleButton = await popupsPage.getGeoLocaleButton(feature.data.buttonType); await expect(switchLocaleButton).toBeVisible(); From 2a1a70e94641055d6d62e70aec9d2ff13f2340ff Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Fri, 18 Oct 2024 23:50:54 +0200 Subject: [PATCH 04/13] Testing pop-up selector timeout --- nala/blocks/popups/popups.test.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nala/blocks/popups/popups.test.js b/nala/blocks/popups/popups.test.js index 770b278..6dc8ede 100644 --- a/nala/blocks/popups/popups.test.js +++ b/nala/blocks/popups/popups.test.js @@ -11,6 +11,12 @@ const switchLocaleCases = features.slice(7, 9); test.describe('Validate popups', () => { test.beforeEach(async ({ page, baseURL, browserName }) => { popupsPage = new PopupsPage(page); + page.on('console', (msg) => { + console.log(`${msg.type()}: ${msg.text()}`, msg.type() === 'error' ? msg.location().url : null); + }); + if (!baseURL.includes('partners.stage.adobe.com')) { + await context.setExtraHTTPHeaders({ authorization: `token ${process.env.HLX_API_KEY}` }); + } if (browserName === 'chromium' && !baseURL.includes('partners.stage.adobe.com')) { await page.route('https://www.adobe.com/chimera-api/**', async (route, request) => { const newUrl = request.url().replace( @@ -28,9 +34,11 @@ test.describe('Validate popups', () => { differentLocaleCases.forEach((feature) => { test(`${feature.name},${feature.tags}`, async ({ page, baseURL }) => { - const newBaseUrl = baseURL.includes('adobecom.hlx.live') ? 'https://partners.stage.adobe.com' : baseURL; + // const newBaseUrl = baseURL.includes('adobecom.hlx.live') ? 'https://partners.stage.adobe.com' : baseURL; await test.step('Go to public page', async () => { - await page.goto(`${newBaseUrl}${feature.path}`); + // await page.goto(`${newBaseUrl}${feature.path}`); + console.log(`Target URL: ${baseURL}${feature.path}`); + await page.goto(`${baseURL}${feature.path}`); await page.waitForLoadState('domcontentloaded'); }); From ee63087b78c488a98c55e650e39c7bcd92a51a41 Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Fri, 18 Oct 2024 23:59:22 +0200 Subject: [PATCH 05/13] Testing pop-up selector timeout --- nala/blocks/popups/popups.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/blocks/popups/popups.test.js b/nala/blocks/popups/popups.test.js index 6dc8ede..83e598c 100644 --- a/nala/blocks/popups/popups.test.js +++ b/nala/blocks/popups/popups.test.js @@ -9,7 +9,7 @@ const differentLocaleCases = features.slice(0, 7); const switchLocaleCases = features.slice(7, 9); test.describe('Validate popups', () => { - test.beforeEach(async ({ page, baseURL, browserName }) => { + test.beforeEach(async ({ page, baseURL, browserName, context }) => { popupsPage = new PopupsPage(page); page.on('console', (msg) => { console.log(`${msg.type()}: ${msg.text()}`, msg.type() === 'error' ? msg.location().url : null); From 3ea522ef1f8267c514561d942f1ca11996cc816a Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Mon, 21 Oct 2024 13:31:46 +0200 Subject: [PATCH 06/13] Testing pop-up selector timeout --- nala/blocks/popups/popups.spec.js | 36 +++++++++++++++---------------- nala/blocks/popups/popups.test.js | 6 ++---- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/nala/blocks/popups/popups.spec.js b/nala/blocks/popups/popups.spec.js index ff3f561..1d06da4 100644 --- a/nala/blocks/popups/popups.spec.js +++ b/nala/blocks/popups/popups.spec.js @@ -4,8 +4,8 @@ export default { { tcid: '1', name: '@desc-regression-geo-pop-up-german-locale', - path: '/channelpartners/?akamaiLocale=de', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=de&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Diese Adobe-Site passt nicht zu Ihrem Standort', buttonType: 'Switch:de-us|Geo_Routing_Modal', @@ -15,8 +15,8 @@ export default { { tcid: '2', name: '@desc-regression-geo-pop-up-spanish-locale', - path: '/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=es&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:es-us|Geo_Routing_Modal', @@ -26,8 +26,8 @@ export default { { tcid: '3', name: '@desc-regression-geo-pop-up-french-locale', - path: '/channelpartners/?akamaiLocale=fr', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=fr&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Ce site Adobe ne correspond pas à votre zone géographique', buttonType: 'Switch:fr-us|Geo_Routing_Modal', @@ -37,8 +37,8 @@ export default { { tcid: '4', name: '@desc-regression-geo-pop-up-italian-locale', - path: '/channelpartners/?akamaiLocale=it', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=it&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Questo sito Adobe non corrisponde alla tua posizione geografica', buttonType: 'Switch:it-us|Geo_Routing_Modal', @@ -48,8 +48,8 @@ export default { { tcid: '5', name: '@desc-regression-geo-pop-up-japanese-locale', - path: '/channelpartners/?akamaiLocale=jp', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=jp&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'アドビwebサイトの地域設定がお客様の位置情報と一致しません', buttonType: 'Switch:jp-us|Geo_Routing_Modal', @@ -59,8 +59,8 @@ export default { { tcid: '6', name: '@desc-regression-geo-pop-up-chinese-locale', - path: '/channelpartners/?akamaiLocale=cn', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=cn&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: '此 Adobe 网站与您的位置不匹配', buttonType: 'Switch:cn-us|Geo_Routing_Modal', @@ -70,8 +70,8 @@ export default { { tcid: '7', name: '@desc-regression-geo-pop-up-brazilian-locale', - path: '/channelpartners/?akamaiLocale=br', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/channelpartners/?akamaiLocale=br&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', buttonType: 'Switch:la-us|Geo_Routing_Modal', @@ -81,8 +81,8 @@ export default { { tcid: '8', name: '@desc-regression-accessing-german-public-page-switch-to-spanish-locale', - path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/de/channelpartners/?akamaiLocale=es&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', @@ -96,8 +96,8 @@ export default { { tcid: '9', name: '@desc-regression-accessing-german-public-page-stay-on-german-locale', - path: '/de/channelpartners/?akamaiLocale=es', - tags: '@dme-popups @geo-popups @regression @anonymous', + path: '/de/channelpartners/?akamaiLocale=es&martech=off', + tags: '@dme-popups @geo-popups @regression @circleCi', data: { geoPopUpText: 'Este sitio de Adobe no coincide con tu ubicación', switchLocaleButton: 'Switch:es-de|Geo_Routing_Modal', diff --git a/nala/blocks/popups/popups.test.js b/nala/blocks/popups/popups.test.js index 83e598c..86357e2 100644 --- a/nala/blocks/popups/popups.test.js +++ b/nala/blocks/popups/popups.test.js @@ -34,11 +34,9 @@ test.describe('Validate popups', () => { differentLocaleCases.forEach((feature) => { test(`${feature.name},${feature.tags}`, async ({ page, baseURL }) => { - // const newBaseUrl = baseURL.includes('adobecom.hlx.live') ? 'https://partners.stage.adobe.com' : baseURL; + const newBaseUrl = baseURL.includes('adobecom.hlx.live') ? 'https://partners.stage.adobe.com' : baseURL; await test.step('Go to public page', async () => { - // await page.goto(`${newBaseUrl}${feature.path}`); - console.log(`Target URL: ${baseURL}${feature.path}`); - await page.goto(`${baseURL}${feature.path}`); + await page.goto(`${newBaseUrl}${feature.path}`); await page.waitForLoadState('domcontentloaded'); }); From 187e064298930c8f342dc28bf8826baf546855dc Mon Sep 17 00:00:00 2001 From: Kristijan Vizi Date: Wed, 23 Oct 2024 13:50:52 +0200 Subject: [PATCH 07/13] Testing region selectors --- .../region-selectors/region-selectors.page.js | 22 +++ .../region-selectors/region-selectors.spec.js | 143 ++++++++++++++++++ .../region-selectors/region-selectors.test.js | 117 ++++++++++++++ 3 files changed, 282 insertions(+) create mode 100644 nala/blocks/region-selectors/region-selectors.page.js create mode 100644 nala/blocks/region-selectors/region-selectors.spec.js create mode 100644 nala/blocks/region-selectors/region-selectors.test.js diff --git a/nala/blocks/region-selectors/region-selectors.page.js b/nala/blocks/region-selectors/region-selectors.page.js new file mode 100644 index 0000000..687db47 --- /dev/null +++ b/nala/blocks/region-selectors/region-selectors.page.js @@ -0,0 +1,22 @@ +export default class RegionSelectorsPage { + constructor(page) { + this.page = page; + this.regionSelectorPopUp = page.locator('div.region-nav[data-block]'); + this.profileIconButton = page.locator('.feds-profile-button'); + + this.oneTrustBanner = page.getByLabel('Cookie banner'); + this.oneTrustBannerDoNotEnableButton = page.getByRole('button', { name: 'Don\'t enable' }); + } + + async clickLinkWithText(text) { + await this.page.locator(`div.region-nav a:has-text("${text}")`).click(); + } + + async getButtonElement(text) { + return this.page.getByRole('button', { name: `${text}` }); + } + + async getPopUpParagraphByText(text) { + return this.page.locator(`div[data-valign="middle"] p:has-text("${text}")`); + } +} diff --git a/nala/blocks/region-selectors/region-selectors.spec.js b/nala/blocks/region-selectors/region-selectors.spec.js new file mode 100644 index 0000000..2f7f3da --- /dev/null +++ b/nala/blocks/region-selectors/region-selectors.spec.js @@ -0,0 +1,143 @@ +export default { + FeatureName: 'DME Region Selectors', + features: [ + { + tcid: '1', + name: '@desc-regression-region-selectors-north-america', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/na/channelpartners/', + linkText: 'North America', + }, + }, + { + tcid: '2', + name: '@desc-regression-region-selectors-latin-america', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/la/channelpartners/', + linkText: 'Latin America', + }, + }, + { + tcid: '3', + name: '@desc-regression-region-selectors-europe-middle-east-africa', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/emea/channelpartners/', + linkText: 'Europe, Middle East, and Africa (English)', + }, + }, + { + tcid: '4', + name: '@desc-regression-region-selectors-france', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/fr/channelpartners/', + linkText: 'France', + }, + }, + { + tcid: '5', + name: '@desc-regression-region-selectors-germany', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/de/channelpartners/', + linkText: 'Deutschland', + }, + }, + { + tcid: '6', + name: '@desc-regression-region-selectors-italy', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/it/channelpartners/', + linkText: 'Italia', + }, + }, + { + tcid: '7', + name: '@desc-regression-region-selectors-asia-pacific', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/apac/channelpartners/', + linkText: 'Asia Pacific (English)', + }, + }, + { + tcid: '8', + name: '@desc-regression-region-selectors-korea', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/kr/channelpartners/', + linkText: '한국', + }, + }, + { + tcid: '9', + name: '@desc-regression-region-selectors-china', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/cn/channelpartners/', + linkText: '中国', + }, + }, + { + tcid: '10', + name: '@desc-regression-region-selectors-japan', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/jp/channelpartners/', + linkText: 'Japan', + }, + }, + { + tcid: '11', + name: '@desc-regression-region-selectors-japan-second-link', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @anonymous', + data: { + changeRegionEng: 'Change region', + localeSwitchUrl: '/jp/channelpartners/', + linkText: '日本', + }, + }, + { + tcid: '12', + name: '@login-regression-region-selectors-spain', + path: '/channelpartners/?georouting=off&martech=off', + tags: '@dme-region-selector @regression @circleCi', + data: { + partnerLevel: 'cpp-spain-platinum:', + localeSwitchUrl: '/es/channelpartners/', + changeRegionEng: 'Change region', + changeRegionEsp: 'Cambiar región', + closePopUpButton: 'Close', + signInButton: 'Iniciar sesión', + linkText: 'España', + titleText: 'Elija su región.', + titleDesc: 'Al seleccionar una región, se cambia el idioma y el contenido en el sitio de socios de canal de Adobe.', + }, + }, + ], +}; diff --git a/nala/blocks/region-selectors/region-selectors.test.js b/nala/blocks/region-selectors/region-selectors.test.js new file mode 100644 index 0000000..e063a9f --- /dev/null +++ b/nala/blocks/region-selectors/region-selectors.test.js @@ -0,0 +1,117 @@ +import { test, expect } from '@playwright/test'; +import RegionSelectorsPage from './region-selectors.page.js'; +import RegionSelectors from './region-selectors.spec.js'; +import SignInPage from '../signin/signin.page.js'; + +let regionSelectorsPage; +let signInPage; + +const { features } = RegionSelectors; +const locales = features.slice(0, 11); + +test.describe('Validate region selector', () => { + test.beforeEach(async ({ page, baseURL, browserName, context }) => { + regionSelectorsPage = new RegionSelectorsPage(page); + signInPage = new SignInPage(page); + if (!baseURL.includes('partners.stage.adobe.com')) { + await context.setExtraHTTPHeaders({ authorization: `token ${process.env.HLX_API_KEY}` }); + } + if (browserName === 'chromium' && !baseURL.includes('partners.stage.adobe.com')) { + await page.route('https://www.adobe.com/chimera-api/**', async (route, request) => { + const newUrl = request.url().replace( + 'https://www.adobe.com/chimera-api', + 'https://14257-chimera.adobeioruntime.net/api/v1/web/chimera-0.0.1', + ); + route.continue({ url: newUrl }); + }); + } + }); + + locales.forEach((feature) => { + test(`${feature.name},${feature.tags}`, async ({ page, baseURL }) => { + await test.step('Go to public page', async () => { + await page.goto(`${baseURL}${feature.path}`); + await page.waitForLoadState('load'); + }); + + await test.step('Verify change region option is present in the footer', async () => { + const changeRegionButton = await regionSelectorsPage.getButtonElement(feature.data.changeRegionEng); + await changeRegionButton.waitFor({ state: 'visible' }); + await changeRegionButton.click(); + const regionSelectorPopUp = await regionSelectorsPage.regionSelectorPopUp; + await expect(regionSelectorPopUp).toBeVisible(); + }); + + await test.step('Verify region links', async () => { + await regionSelectorsPage.clickLinkWithText(feature.data.linkText); + const urlRegex = new RegExp(`.*${feature.data.localeSwitchUrl}.*`); + await page.waitForURL(urlRegex, { timeout: 5000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(feature.data.localeSwitchUrl); + }); + }); + }); + + test(`${features[11].name},${features[11].tags}`, async ({ page, baseURL }) => { + test.slow(); + const { data, path } = features[11]; + await test.step('Go to public page', async () => { + await page.goto(`${baseURL}${path}`); + await page.waitForLoadState('load'); + }); + + await test.step('Verify change region option is present in the footer', async () => { + const changeRegionButton = await regionSelectorsPage.getButtonElement(data.changeRegionEng); + await changeRegionButton.waitFor({ state: 'visible' }); + await changeRegionButton.click(); + const regionSelectorPopUp = await regionSelectorsPage.regionSelectorPopUp; + await expect(regionSelectorPopUp).toBeVisible(); + }); + + try { + const oneTrustBanner = await regionSelectorsPage.oneTrustBanner; + await oneTrustBanner.waitFor({ state: 'visible', timeout: 5000 }); + const closeButton = await regionSelectorsPage.oneTrustBannerDoNotEnableButton; + await closeButton.click(); + } catch (error) { + console.log('One trust pop-up did not appear'); + } + + await test.step('Switch to spanish locale', async () => { + await regionSelectorsPage.clickLinkWithText(data.linkText); + const urlRegex = new RegExp(`.*${data.localeSwitchUrl}.*`); + await page.waitForURL(urlRegex, { timeout: 5000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(data.localeSwitchUrl); + }); + + await test.step('Verify redirection and translated change region pop-up', async () => { + const changeRegionButton = await regionSelectorsPage.getButtonElement(data.changeRegionEsp); + await changeRegionButton.waitFor({ state: 'visible' }); + await changeRegionButton.click(); + const regionSelectorPopUp = await regionSelectorsPage.regionSelectorPopUp; + await expect(regionSelectorPopUp).toBeVisible(); + const titleText = await regionSelectorsPage.getPopUpParagraphByText(data.titleText); + await expect(titleText).toBeVisible(); + const titleDesc = await regionSelectorsPage.getPopUpParagraphByText(data.titleDesc); + await expect(titleDesc).toBeVisible(); + const closePopUpButton = await regionSelectorsPage.getButtonElement(data.closePopUpButton); + await closePopUpButton.click(); + }); + + await test.step('Sign in', async () => { + const signInButton = await regionSelectorsPage.getButtonElement(data.signInButton); + await signInButton.click(); + await signInPage.signIn(page, `${data.partnerLevel}`); + await page.waitForLoadState('domcontentloaded'); + }); + + await test.step('Verify change region option is not present in the footer for the logged in user', async () => { + await regionSelectorsPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const changeRegionButton = await regionSelectorsPage.getButtonElement(data.changeRegionEng); + await expect(changeRegionButton).toBeHidden(); + }); + }); +}); From 565cda4e6423bd33585e78823b2b29001cf90264 Mon Sep 17 00:00:00 2001 From: sashaCodeTest Date: Thu, 9 Jan 2025 09:05:14 +0100 Subject: [PATCH 08/13] Smoke Tests --- nala/blocks/smoke-test/smoke.page.js | 88 +++++++++++ nala/blocks/smoke-test/smoke.spec.js | 121 +++++++++++++++ nala/blocks/smoke-test/smoke.test.js | 218 +++++++++++++++++++++++++++ 3 files changed, 427 insertions(+) create mode 100644 nala/blocks/smoke-test/smoke.page.js create mode 100644 nala/blocks/smoke-test/smoke.spec.js create mode 100644 nala/blocks/smoke-test/smoke.test.js diff --git a/nala/blocks/smoke-test/smoke.page.js b/nala/blocks/smoke-test/smoke.page.js new file mode 100644 index 0000000..460ab47 --- /dev/null +++ b/nala/blocks/smoke-test/smoke.page.js @@ -0,0 +1,88 @@ +export default class SmokeTest { + constructor(page) { + this.page = page; + this.joinNowButton = page.locator( + '#feds-nav-wrapper .feds-cta--primary:has-text("Join Now")' + ); + this.signInButton = page.locator('.feds-signIn'); + this.GNav = page.locator('.feds-topnav'); + this.profileIcon = page.locator('.feds-profile-button'); + this.priceList = page.locator('[daa-ll="Price lists-1"]'); + this.tableSelector = '.table-container'; + this.searchGnav = page.locator('.feds-search-trigger'); + this.searchGnavField = page.locator('.feds-search-input'); + this.searchFieldPage = page.locator('#search'); + this.announcemnts = page.locator('[daa-ll="Announcements-6"]'); + } + + async verifyButtonExist() { + const joinNowExist = await this.joinNowButton.isVisible(); + const signInExists = await this.signInButton.isVisible(); + + return { + joinNowButton: joinNowExist, + signInButton: signInExists, + }; + } + + async verifyProtectedGnav() { + const gNavExists = await this.GNav.isVisible(); + + return { + GNav: gNavExists, + }; + } + + async verifyProfileIcon() { + const profileIconExists = await this.profileIcon.isVisible(); + + return { + profileIcon: profileIconExists, + }; + } + + async getCurrentUrl() { + return await this.page.url(); + } + + async clickDownloadButtonInFirstRow() { + const firstRowWithDownload = this.page + .locator(`${this.tableSelector} tr:has(td[headers="download"])`) + .first(); + const downloadButton = firstRowWithDownload.locator('#button'); + await downloadButton.click(); + } + + async searchPageDownloadButton() { + const enableAll = this.page.locator('#onetrust-accept-btn-handler'); + await enableAll.waitFor({ state: 'visible' }); + await enableAll.click(); + const shadowHost = await this.page + .locator('search-cards.search-cards-wrapper[data-idx="2"]') + .elementHandle(); + const shadowRoot = await shadowHost.evaluateHandle( + (node) => node.shadowRoot + ); + + const downloadButton = await shadowRoot.$( + 'sp-action-button[href="https://partners.stage.adobe.com/channelpartnerassets/assets/public/public_1/scanning_documents_into_pdf_files--ar.pdf?download"]' + ); + + await downloadButton.click(); + } + + async announcmentCardVerification() { + const shadowHostCard = await this.page + .locator( + 'announcements-cards.content.announcements-wrapper[data-idx="0"]' + ) + .elementHandle(); + const shadowRootCard = await shadowHostCard.evaluateHandle( + (node) => node.shadowRoot + ); + + const announcementsCrad = await shadowRootCard.$$('.card-wrapper'); + const firstCard = announcementsCrad[0]; + await firstCard.isVisible(); + } +} diff --git a/nala/blocks/smoke-test/smoke.spec.js b/nala/blocks/smoke-test/smoke.spec.js new file mode 100644 index 0000000..3138f26 --- /dev/null +++ b/nala/blocks/smoke-test/smoke.spec.js @@ -0,0 +1,121 @@ +export default { + FeatureName: 'Smoke Tests', + features: [ + { + tcid: '1', + name: '@lending-page-validation-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + baseURL: 'https://www.stage.adobe.com?akamaiLocale=us', + }, + + { + tcid: '2', + name: '@home-page-validation-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + baseURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-latin-na-platinum:', + signInButtonInternationalText: 'Sign In', + }, + }, + + { + tcid: '3', + name: '@price-list-validation-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + basedURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-distributor-us:', + signInButtonInternationalText: 'Sign In', + expectedPublicPageURL: + 'https://partners.stage.adobe.com/na/channelpartners/home/pricelists/', + }, + }, + + { + tcid: '4', + name: '@search-page-validation-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + basedURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-distributor-us:', + signInButtonInternationalText: 'Sign In', + searchText: 'pdf', + }, + }, + + { + tcid: '5', + name: '@user-redirection-apac-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + basedURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-distributor-india:', + expectedPublicPageURL: + 'https://partners.stage.adobe.com/apac/channelpartners/drafts/automation/regression/protected-home#', + signInButtonInternationalText: 'Sign In', + }, + }, + + { + tcid: '6', + name: '@user-redirection-emea-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + basedURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-emea-platinum:', + expectedPublicPageURL: + 'https://partners.stage.adobe.com/emea/channelpartners/drafts/automation/regression/protected-home#', + signInButtonInternationalText: 'Sign In', + }, + }, + + { + tcid: '7', + name: '@user-redirection-jp-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + basedURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-distributor-japan:', + expectedPublicPageURL: + 'https://partners.stage.adobe.com/jp/channelpartners/drafts/automation/regression/protected-home#', + signInButtonInternationalText: 'Sign In', + }, + }, + + { + tcid: '8', + name: '@user-redirection-latam-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + basedURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-latin-america-na-platinum:', + expectedPublicPageURL: + 'https://partners.stage.adobe.com/latam/channelpartners/drafts/automation/regression/protected-home#', + signInButtonInternationalText: 'Sign In', + }, + }, + + { + tcid: '9', + name: '@announcement-page-validation-smoke-test', + path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off', + tags: '@dme-smoke-test', + baseURL: 'https://www.stage.adobe.com?akamaiLocale=us', + data: { + partnerLevel: 'cpp-na-certified:', + expectedPublicPageURL: + 'https://partners.stage.adobe.com/latam/channelpartners/drafts/automation/regression/protected-home#', + signInButtonInternationalText: 'Sign In', + }, + }, + ], +}; diff --git a/nala/blocks/smoke-test/smoke.test.js b/nala/blocks/smoke-test/smoke.test.js new file mode 100644 index 0000000..e5f3cfd --- /dev/null +++ b/nala/blocks/smoke-test/smoke.test.js @@ -0,0 +1,218 @@ +import { test, expect } from '@playwright/test'; +import smokeSpec from './smoke.spec'; +import SmokeTest from './smoke.page.js'; +import SignInPage from '../signin/signin.page.js'; + +let smokeTest; +let signInSmokeTest; + +const { features } = smokeSpec; + +test.describe('Smoke Tests', () => { + test.beforeEach(async ({ page, baseURL }) => { + smokeTest = new SmokeTest(page); + signInSmokeTest = new SignInPage(page); + + const { path } = features[0]; + await test.step('Go to Landing page', async () => { + await page.goto(new URL(path, baseURL).href); + }); + }); + //@lending-page-validation-smoke-test + test(`${features[0].name}, ${features[0].tags}`, async () => { + await test.step('Validate Join Now and Sign In Buttons', async () => { + // checking if there are buttons on the page + await smokeTest.verifyButtonExist(); + }); + }); + //@home-page-validation-smoke-test + test(`${features[1].name}, ${features[1].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[1].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, enter user email and password', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[1].data.partnerLevel}`); + }); + await test.step('Verify protected Gnav exists', async () => { + await smokeTest.verifyProtectedGnav(); + }); + await test.step('Verify Profile Icon exists', async () => { + await smokeTest.verifyProfileIcon(); + }); + }); + //@price-list-validation-smoke-test + test(`${features[2].name}, ${features[2].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[2].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, enter user email and password', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[2].data.partnerLevel}`); + }); + await test.step('Go to Price List from GNav and verify redirection', async () => { + //cliking on price list from gnav + await smokeTest.priceList.click(); + await page.waitForTimeout(3000); + //checking url + const currentURL = await page.evaluate(() => window.location.href); + await expect(currentURL).toContain( + features[2].data.expectedPublicPageURL + ); + }); + await test.step('Find a row in price list and click on download', async () => { + await smokeTest.clickDownloadButtonInFirstRow(); + }); + }); + //@search-page-validation-smoke-test + test(`${features[3].name}, ${features[3].tags}`, async ({ page }) => { + const { data } = features[3]; + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[3].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, enter user email and password', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[2].data.partnerLevel}`); + }); + await test.step('Click rearch from GNav', async () => { + //cliking on search from gnav + await smokeTest.searchGnav.click(); + }); + //search pdf and click enter + await test.step('Verify a search field and type text', async () => { + // await smokeTest.search(); + await smokeTest.searchGnavField.fill(data.searchText); + await smokeTest.searchGnavField.press('Enter'); + }); + + await test.step('Verify search page conntent', async () => { + const searchFieldValue = await smokeTest.searchFieldPage.getAttribute( + 'value' + ); + expect(searchFieldValue).toContain(data.searchText); + }); + + await test.step('Find a row in assets list and click on download', async () => { + // await smokeTest.searchFirstAsset.click(); + await smokeTest.searchPageDownloadButton(); + }); + }); + + //@user-redirection-apac-smoke-test + test(`${features[4].name}, ${features[4].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[4].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, verify user redirection', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[4].data.partnerLevel}`); + await page.waitForTimeout(10000); + + const currentURL = await page.evaluate(() => window.location.href); + await expect(currentURL).toContain( + features[4].data.expectedPublicPageURL + ); + }); + }); + //@user-redirection-emea-smoke-test + test(`${features[5].name}, ${features[5].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[5].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, verify user redirection', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[5].data.partnerLevel}`); + await page.waitForTimeout(10000); + + const currentURL = await page.evaluate(() => window.location.href); + await expect(currentURL).toContain( + features[5].data.expectedPublicPageURL + ); + }); + }); + //@user-redirection-jp-smoke-test + test(`${features[6].name}, ${features[6].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[6].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, verify user redirection', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[6].data.partnerLevel}`); + await page.waitForTimeout(10000); + const currentURL = await page.evaluate(() => window.location.href); + await expect(currentURL).toContain( + features[6].data.expectedPublicPageURL + ); + }); + }); + //@search-page-validation-smoke-test + test(`${features[7].name}, ${features[7].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[7].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In, verify user redirection', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[7].data.partnerLevel}`); + await page.waitForTimeout(10000); + const currentURL = await page.evaluate(() => window.location.href); + await expect(currentURL).toContain( + features[7].data.expectedPublicPageURL + ); + }); + }); + //@announcement-page-validation-smoke-test + test(`${features[8].name}, ${features[8].tags}`, async ({ page }) => { + await test.step('Click Sign In button', async () => { + // finding sign in button + const signInButtonInt = await signInSmokeTest.getSignInButton( + `${features[7].data.signInButtonInternationalText}` + ); + //click on sign in button + await signInButtonInt.click(); + }); + await test.step('Sing In', async () => { + // entering user email and password + await signInSmokeTest.signIn(page, `${features[8].data.partnerLevel}`); + + await test.step('Click on Announcments from GNav and verify one Announcment card is displayed', async () => { + await smokeTest.announcemnts.click(); + await smokeTest.announcmentCardVerification(); + }); + }); + }); +}); From 06395e56da1c85738d95d6dba7f9654aedeb17b0 Mon Sep 17 00:00:00 2001 From: sashaCodeTest Date: Thu, 9 Jan 2025 10:42:05 +0100 Subject: [PATCH 09/13] Lint fix --- nala/blocks/smoke-test/smoke.page.js | 20 ++++---- nala/blocks/smoke-test/smoke.test.js | 72 ++++++++++++++-------------- 2 files changed, 44 insertions(+), 48 deletions(-) diff --git a/nala/blocks/smoke-test/smoke.page.js b/nala/blocks/smoke-test/smoke.page.js index 460ab47..9863bfd 100644 --- a/nala/blocks/smoke-test/smoke.page.js +++ b/nala/blocks/smoke-test/smoke.page.js @@ -2,7 +2,7 @@ export default class SmokeTest { constructor(page) { this.page = page; this.joinNowButton = page.locator( - '#feds-nav-wrapper .feds-cta--primary:has-text("Join Now")' + '#feds-nav-wrapper .feds-cta--primary:has-text("Join Now")', ); this.signInButton = page.locator('.feds-signIn'); this.GNav = page.locator('.feds-topnav'); @@ -28,21 +28,17 @@ export default class SmokeTest { async verifyProtectedGnav() { const gNavExists = await this.GNav.isVisible(); - return { - GNav: gNavExists, - }; + return { GNav: gNavExists }; } async verifyProfileIcon() { const profileIconExists = await this.profileIcon.isVisible(); - return { - profileIcon: profileIconExists, - }; + return { profileIcon: profileIconExists }; } async getCurrentUrl() { - return await this.page.url(); + return this.page.url(); } async clickDownloadButtonInFirstRow() { @@ -61,11 +57,11 @@ export default class SmokeTest { .locator('search-cards.search-cards-wrapper[data-idx="2"]') .elementHandle(); const shadowRoot = await shadowHost.evaluateHandle( - (node) => node.shadowRoot + (node) => node.shadowRoot, ); const downloadButton = await shadowRoot.$( - 'sp-action-button[href="https://partners.stage.adobe.com/channelpartnerassets/assets/public/public_1/scanning_documents_into_pdf_files--ar.pdf?download"]' + 'sp-action-button[href="https://partners.stage.adobe.com/channelpartnerassets/assets/public/public_1/scanning_documents_into_pdf_files--ar.pdf?download"]', ); await downloadButton.click(); @@ -74,11 +70,11 @@ export default class SmokeTest { async announcmentCardVerification() { const shadowHostCard = await this.page .locator( - 'announcements-cards.content.announcements-wrapper[data-idx="0"]' + 'announcements-cards.content.announcements-wrapper[data-idx="0"]', ) .elementHandle(); const shadowRootCard = await shadowHostCard.evaluateHandle( - (node) => node.shadowRoot + (node) => node.shadowRoot, ); const announcementsCrad = await shadowRootCard.$$('.card-wrapper'); diff --git a/nala/blocks/smoke-test/smoke.test.js b/nala/blocks/smoke-test/smoke.test.js index e5f3cfd..ddabbbf 100644 --- a/nala/blocks/smoke-test/smoke.test.js +++ b/nala/blocks/smoke-test/smoke.test.js @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import smokeSpec from './smoke.spec'; +import smokeSpec from './smoke.spec.js'; import SmokeTest from './smoke.page.js'; import SignInPage from '../signin/signin.page.js'; @@ -18,21 +18,21 @@ test.describe('Smoke Tests', () => { await page.goto(new URL(path, baseURL).href); }); }); - //@lending-page-validation-smoke-test + // @lending-page-validation-smoke-test test(`${features[0].name}, ${features[0].tags}`, async () => { await test.step('Validate Join Now and Sign In Buttons', async () => { // checking if there are buttons on the page await smokeTest.verifyButtonExist(); }); }); - //@home-page-validation-smoke-test + // @home-page-validation-smoke-test test(`${features[1].name}, ${features[1].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[1].data.signInButtonInternationalText}` + `${features[1].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, enter user email and password', async () => { @@ -46,14 +46,14 @@ test.describe('Smoke Tests', () => { await smokeTest.verifyProfileIcon(); }); }); - //@price-list-validation-smoke-test + // @price-list-validation-smoke-test test(`${features[2].name}, ${features[2].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[2].data.signInButtonInternationalText}` + `${features[2].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, enter user email and password', async () => { @@ -61,28 +61,28 @@ test.describe('Smoke Tests', () => { await signInSmokeTest.signIn(page, `${features[2].data.partnerLevel}`); }); await test.step('Go to Price List from GNav and verify redirection', async () => { - //cliking on price list from gnav + // cliking on price list from gnav await smokeTest.priceList.click(); await page.waitForTimeout(3000); - //checking url + // checking url const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( - features[2].data.expectedPublicPageURL + features[2].data.expectedPublicPageURL, ); }); await test.step('Find a row in price list and click on download', async () => { await smokeTest.clickDownloadButtonInFirstRow(); }); }); - //@search-page-validation-smoke-test + // @search-page-validation-smoke-test test(`${features[3].name}, ${features[3].tags}`, async ({ page }) => { const { data } = features[3]; await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[3].data.signInButtonInternationalText}` + `${features[3].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, enter user email and password', async () => { @@ -90,10 +90,10 @@ test.describe('Smoke Tests', () => { await signInSmokeTest.signIn(page, `${features[2].data.partnerLevel}`); }); await test.step('Click rearch from GNav', async () => { - //cliking on search from gnav + // cliking on search from gnav await smokeTest.searchGnav.click(); }); - //search pdf and click enter + // search pdf and click enter await test.step('Verify a search field and type text', async () => { // await smokeTest.search(); await smokeTest.searchGnavField.fill(data.searchText); @@ -102,7 +102,7 @@ test.describe('Smoke Tests', () => { await test.step('Verify search page conntent', async () => { const searchFieldValue = await smokeTest.searchFieldPage.getAttribute( - 'value' + 'value', ); expect(searchFieldValue).toContain(data.searchText); }); @@ -113,14 +113,14 @@ test.describe('Smoke Tests', () => { }); }); - //@user-redirection-apac-smoke-test + // @user-redirection-apac-smoke-test test(`${features[4].name}, ${features[4].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[4].data.signInButtonInternationalText}` + `${features[4].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, verify user redirection', async () => { @@ -130,18 +130,18 @@ test.describe('Smoke Tests', () => { const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( - features[4].data.expectedPublicPageURL + features[4].data.expectedPublicPageURL, ); }); }); - //@user-redirection-emea-smoke-test + // @user-redirection-emea-smoke-test test(`${features[5].name}, ${features[5].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[5].data.signInButtonInternationalText}` + `${features[5].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, verify user redirection', async () => { @@ -151,18 +151,18 @@ test.describe('Smoke Tests', () => { const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( - features[5].data.expectedPublicPageURL + features[5].data.expectedPublicPageURL, ); }); }); - //@user-redirection-jp-smoke-test + // @user-redirection-jp-smoke-test test(`${features[6].name}, ${features[6].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[6].data.signInButtonInternationalText}` + `${features[6].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, verify user redirection', async () => { @@ -171,18 +171,18 @@ test.describe('Smoke Tests', () => { await page.waitForTimeout(10000); const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( - features[6].data.expectedPublicPageURL + features[6].data.expectedPublicPageURL, ); }); }); - //@search-page-validation-smoke-test + // @search-page-validation-smoke-test test(`${features[7].name}, ${features[7].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[7].data.signInButtonInternationalText}` + `${features[7].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In, verify user redirection', async () => { @@ -191,18 +191,18 @@ test.describe('Smoke Tests', () => { await page.waitForTimeout(10000); const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( - features[7].data.expectedPublicPageURL + features[7].data.expectedPublicPageURL, ); }); }); - //@announcement-page-validation-smoke-test + // @announcement-page-validation-smoke-test test(`${features[8].name}, ${features[8].tags}`, async ({ page }) => { await test.step('Click Sign In button', async () => { // finding sign in button const signInButtonInt = await signInSmokeTest.getSignInButton( - `${features[7].data.signInButtonInternationalText}` + `${features[7].data.signInButtonInternationalText}`, ); - //click on sign in button + // click on sign in button await signInButtonInt.click(); }); await test.step('Sing In', async () => { From a11a12446f7610069283594402ebb84f5b560022 Mon Sep 17 00:00:00 2001 From: sashaCodeTest Date: Thu, 9 Jan 2025 13:27:03 +0100 Subject: [PATCH 10/13] Implemented requested changes --- nala/blocks/smoke-test/smoke.page.js | 15 +-------------- nala/blocks/smoke-test/smoke.test.js | 9 ++++----- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/nala/blocks/smoke-test/smoke.page.js b/nala/blocks/smoke-test/smoke.page.js index 9863bfd..199f86d 100644 --- a/nala/blocks/smoke-test/smoke.page.js +++ b/nala/blocks/smoke-test/smoke.page.js @@ -50,20 +50,7 @@ export default class SmokeTest { } async searchPageDownloadButton() { - const enableAll = this.page.locator('#onetrust-accept-btn-handler'); - await enableAll.waitFor({ state: 'visible' }); - await enableAll.click(); - const shadowHost = await this.page - .locator('search-cards.search-cards-wrapper[data-idx="2"]') - .elementHandle(); - const shadowRoot = await shadowHost.evaluateHandle( - (node) => node.shadowRoot, - ); - - const downloadButton = await shadowRoot.$( - 'sp-action-button[href="https://partners.stage.adobe.com/channelpartnerassets/assets/public/public_1/scanning_documents_into_pdf_files--ar.pdf?download"]', - ); - + const downloadButton = this.page.locator('.button.anchor.hidden').first(); await downloadButton.click(); } diff --git a/nala/blocks/smoke-test/smoke.test.js b/nala/blocks/smoke-test/smoke.test.js index ddabbbf..80609ac 100644 --- a/nala/blocks/smoke-test/smoke.test.js +++ b/nala/blocks/smoke-test/smoke.test.js @@ -108,7 +108,6 @@ test.describe('Smoke Tests', () => { }); await test.step('Find a row in assets list and click on download', async () => { - // await smokeTest.searchFirstAsset.click(); await smokeTest.searchPageDownloadButton(); }); }); @@ -126,7 +125,7 @@ test.describe('Smoke Tests', () => { await test.step('Sing In, verify user redirection', async () => { // entering user email and password await signInSmokeTest.signIn(page, `${features[4].data.partnerLevel}`); - await page.waitForTimeout(10000); + await page.waitForLoadState('networkidle'); const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( @@ -147,7 +146,7 @@ test.describe('Smoke Tests', () => { await test.step('Sing In, verify user redirection', async () => { // entering user email and password await signInSmokeTest.signIn(page, `${features[5].data.partnerLevel}`); - await page.waitForTimeout(10000); + await page.waitForLoadState('networkidle'); const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( @@ -168,7 +167,7 @@ test.describe('Smoke Tests', () => { await test.step('Sing In, verify user redirection', async () => { // entering user email and password await signInSmokeTest.signIn(page, `${features[6].data.partnerLevel}`); - await page.waitForTimeout(10000); + await page.waitForLoadState('networkidle'); const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( features[6].data.expectedPublicPageURL, @@ -188,7 +187,7 @@ test.describe('Smoke Tests', () => { await test.step('Sing In, verify user redirection', async () => { // entering user email and password await signInSmokeTest.signIn(page, `${features[7].data.partnerLevel}`); - await page.waitForTimeout(10000); + await page.waitForLoadState('networkidle'); const currentURL = await page.evaluate(() => window.location.href); await expect(currentURL).toContain( features[7].data.expectedPublicPageURL, From 849eaad9c33b72b0623c6bc0d7f0c1e2e84f7ef2 Mon Sep 17 00:00:00 2001 From: sashaCodeTest Date: Fri, 10 Jan 2025 16:07:05 +0100 Subject: [PATCH 11/13] Implemented requested changes --- nala/blocks/smoke-test/smoke.page.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nala/blocks/smoke-test/smoke.page.js b/nala/blocks/smoke-test/smoke.page.js index 199f86d..f709ae9 100644 --- a/nala/blocks/smoke-test/smoke.page.js +++ b/nala/blocks/smoke-test/smoke.page.js @@ -1,18 +1,16 @@ export default class SmokeTest { constructor(page) { this.page = page; - this.joinNowButton = page.locator( - '#feds-nav-wrapper .feds-cta--primary:has-text("Join Now")', - ); + this.joinNowButton = page.locator('text="Join Now"'); this.signInButton = page.locator('.feds-signIn'); this.GNav = page.locator('.feds-topnav'); this.profileIcon = page.locator('.feds-profile-button'); - this.priceList = page.locator('[daa-ll="Price lists-1"]'); + this.priceList = page.locator('a[href="https://partners.stage.adobe.com/na/channelpartners/home/pricelists/"]'); this.tableSelector = '.table-container'; this.searchGnav = page.locator('.feds-search-trigger'); this.searchGnavField = page.locator('.feds-search-input'); this.searchFieldPage = page.locator('#search'); - this.announcemnts = page.locator('[daa-ll="Announcements-6"]'); + this.announcemnts = page.locator('text="Announcements"'); } async verifyButtonExist() { From 9bc685b89df142f480b2b22e4105423ff148bddb Mon Sep 17 00:00:00 2001 From: sashaCodeTest Date: Mon, 13 Jan 2025 08:40:00 +0100 Subject: [PATCH 12/13] Requested change for price list locator --- nala/blocks/smoke-test/smoke.page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/blocks/smoke-test/smoke.page.js b/nala/blocks/smoke-test/smoke.page.js index f709ae9..6093940 100644 --- a/nala/blocks/smoke-test/smoke.page.js +++ b/nala/blocks/smoke-test/smoke.page.js @@ -5,7 +5,7 @@ export default class SmokeTest { this.signInButton = page.locator('.feds-signIn'); this.GNav = page.locator('.feds-topnav'); this.profileIcon = page.locator('.feds-profile-button'); - this.priceList = page.locator('a[href="https://partners.stage.adobe.com/na/channelpartners/home/pricelists/"]'); + this.priceList = page.locator('a.feds-navLink[href*="pricelists"]'); this.tableSelector = '.table-container'; this.searchGnav = page.locator('.feds-search-trigger'); this.searchGnavField = page.locator('.feds-search-input'); From 077e1eccc916e79dc4e45acf8d533f351c42b715 Mon Sep 17 00:00:00 2001 From: sashaCodeTest Date: Mon, 13 Jan 2025 10:38:53 +0100 Subject: [PATCH 13/13] Change for price list locator --- nala/blocks/smoke-test/smoke.page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/blocks/smoke-test/smoke.page.js b/nala/blocks/smoke-test/smoke.page.js index 6093940..d782bf3 100644 --- a/nala/blocks/smoke-test/smoke.page.js +++ b/nala/blocks/smoke-test/smoke.page.js @@ -5,7 +5,7 @@ export default class SmokeTest { this.signInButton = page.locator('.feds-signIn'); this.GNav = page.locator('.feds-topnav'); this.profileIcon = page.locator('.feds-profile-button'); - this.priceList = page.locator('a.feds-navLink[href*="pricelists"]'); + this.priceList = page.locator('a.feds-navLink:has-text("Price lists")'); this.tableSelector = '.table-container'; this.searchGnav = page.locator('.feds-search-trigger'); this.searchGnavField = page.locator('.feds-search-input');