diff --git a/selectors/feds/feds.illustratorsanity.page.js b/selectors/feds/feds.illustratorsanity.page.js index 35616aea..6c2ed9e3 100644 --- a/selectors/feds/feds.illustratorsanity.page.js +++ b/selectors/feds/feds.illustratorsanity.page.js @@ -110,17 +110,67 @@ export default class IllustratorPageSanity { this.privacySection = page.locator('.feds-footer-privacySection:nth-child(2)'); } + // U-NAV + async validatingUnavElements(country) { + await this.page.waitForLoadState('domcontentloaded'); + + const elements = [ + this.adobe, this.creativityAndDesign, this.illustrator, this.features, this.comparePlans, + this.freeTrialDetails, this.tryItForFree, this.appSwitcher, this.signInButton, this.signInButtonTwo, + ]; + + await Promise.all(elements.map(async (element) => { + switch (element) { + case this.tryItForFree: + if (country === 'Germany') { + await expect(element).toBeVisible(); + } + break; + case this.appSwitcher: + case this.signInButton: { + const excludedCountries = [ + 'United Kingdom', 'India', 'Canada English', 'Canada French', 'Mexico', 'Australia', 'Indonesia', + 'Indonesia English', 'Thailand English', 'Thailand', 'Singapore', 'Philippines', 'Philippines English', + 'Middle East And North Africa', + ]; + if (excludedCountries.includes(country)) { + await expect(element).not.toBeVisible(); + } + } + break; + case this.signInButtonTwo: { + const includedCountries = [ + 'United Kingdom', 'India', 'Canada English', 'Canada French', 'Mexico', 'Australia', 'Indonesia', + 'Indonesia English', 'Thailand English', 'Thailand', 'Singapore', 'Philippines', 'Philippines English', + 'Middle East And North Africa', + ]; + if (includedCountries.includes(country)) { + await expect(element).toBeVisible(); + } + } + break; + default: + await expect(element).toBeVisible(); + break; + } + })); + } + // Creativity & Design async validatingCreativityAndDesignElements(country) { await this.creativityAndDesign.click(); - await this.page.waitForLoadState('networkidle'); - - const elements = [this.whatIsCC, this.photographers, this.studentsAndTeachers, this.individuals, - this.business, this.schoolsAndUniversities, this.viewPlansAndPricing, this.photoshop, this.adobeExpress, - this.lightroom, this.illustratorCd, this.premierePro, this.adobeStock, this.viewAllProducts, this.photo, - this.graphicDesign, this.Video, this.illustration, this.socialMedia, this.threeDAndAR, this.pdf, - this.aiOverviewCC, this.adobeFirefly, this.adobecom, this.pdfAndESignatures, this.marketingAndCommerce, - this.helpAndSupport, this.seeSpecialOffers, this.adobeFireflyMp]; + await this.page.waitForLoadState('domcontentloaded'); + + const elements = [ + this.whatIsCC, this.photographers, this.studentsAndTeachers, this.individuals, this.business, + this.schoolsAndUniversities, this.viewPlansAndPricing, this.photoshop, this.adobeExpress, + this.lightroom, this.illustratorCd, this.premierePro, this.adobeStock, this.viewAllProducts, + this.photo, this.graphicDesign, this.Video, this.illustration, this.socialMedia, this.threeDAndAR, + this.pdf, this.aiOverviewCC, this.adobeFirefly, this.adobecom, this.pdfAndESignatures, + this.marketingAndCommerce, this.helpAndSupport, this.seeSpecialOffers, this.adobeFireflyMp, + this.governmentAgencies, this.benifitsForCC, this.acrobatPro, this.adobeStockEs, this.seeAllProducts, + this.seePlansAndPricingEs, + ]; await Promise.all(elements.map(async (element) => { switch (element) { @@ -130,62 +180,60 @@ export default class IllustratorPageSanity { } break; case this.adobeFirefly: - if (country !== 'Poland') { - return; + if (country === 'Poland' || country === 'Japan') { + await expect(element).not.toBeVisible(); } - await expect(element).toBeVisible(); break; case this.adobeFireflyMp: - if (country === 'Poland') { + if (country === 'Poland' || country === 'Japan') { + await expect(element).toBeVisible(); + } + break; + case this.individuals: + if (country === 'Germany' || country === 'France' || country === 'Italy') { + await expect(element).not.toBeVisible(); + } + break; + case this.governmentAgencies: + case this.benifitsForCC: + if (country === 'Japan') { await expect(element).toBeVisible(); } break; + case this.aiOverviewCC: + if (country === 'Japan') { + await expect(element).not.toBeVisible(); + } + break; + case this.acrobatPro: + case this.adobeStockEs: + case this.seeAllProducts: + case this.seePlansAndPricingEs: + if (country === 'Spain') { + await expect(element).toBeVisible(); + } + break; + case this.schoolsAndUniversities: + case this.viewPlansAndPricing: + case this.illustratorCd: + case this.viewAllProducts: + case this.lightroom: + case this.adobeStock: + if (country === 'Spain') { + await expect(element).not.toBeVisible(); + } + break; default: await expect(element).toBeVisible(); + break; } })); - await this.creativityAndDesign.click(); } async validatingCreativityAndDesignElementsSecondSet() { await this.creativityAndDesign.click(); - await this.page.waitForLoadState('networkidle'); - - const elements = [this.whatIsCC, this.photographers, this.studentsAndTeachers, this.schoolsAndUniversities, - this.business, this.viewPlansAndPricing, this.photoshop, this.adobeExpress, this.premierePro, - this.illustratorCd, this.lightroom, this.adobeStock, this.viewAllProducts, this.photo, this.graphicDesign, - this.Video, this.illustration, this.socialMedia, this.threeDAndAR, this.pdf, this.aiOverviewCC, - this.adobeFirefly, this.adobecom, this.pdfAndESignatures, this.marketingAndCommerce, this.helpAndSupport]; - - await Promise.all(elements.map(async (element) => { - await expect(element).toBeVisible(); - })); - - await this.creativityAndDesign.click(); - } - - async validatingCreativityAndDesignElementsThirdSet() { - await this.creativityAndDesign.click(); - await this.page.waitForLoadState('networkidle'); - - const elements = [this.whatIsCC, this.photographers, this.studentsAndTeachers, this.individuals, this.business, - this.schoolsAndUniversities, this.governmentAgencies, this.benifitsForCC, this.viewPlansAndPricing, - this.photoshop, this.adobeExpress, this.lightroom, this.illustratorCd, this.premierePro, this.adobeStock, - this.adobeFireflyMp, this.viewAllProducts, this.photo, this.graphicDesign, this.Video, this.illustration, - this.socialMedia, this.threeDAndAR, this.pdf, this.adobeFirefly, this.adobecom, this.pdfAndESignatures, - this.marketingAndCommerce, this.helpAndSupport]; - - await Promise.all(elements.map(async (element) => { - await expect(element).toBeVisible(); - })); - - await this.creativityAndDesign.click(); - } - - async validatingCreativityAndDesignElementsFourthSet() { - await this.creativityAndDesign.click(); - await this.page.waitForLoadState('networkidle'); + await this.page.waitForLoadState('domcontentloaded'); const elements = [this.removeBackground, this.resizeImage, this.covertImageToSVG, this.covertVideoToGIF, this.createQRCode, this.seeAllQuickActions, this.resume, this.posters, this.card, this.instagramPost, @@ -200,57 +248,9 @@ export default class IllustratorPageSanity { await this.creativityAndDesign.click(); } - async validatingCreativityAndDesignElementsFifthSet() { - await this.creativityAndDesign.click(); - await this.page.waitForLoadState('networkidle'); - - const elements = [this.whatIsCC, this.photoshop, this.adobeExpress, this.acrobatPro, this.illustratorCd, - this.premierePro, this.adobeStockEs, this.seeAllProducts, this.individuals, this.photographers, - this.studentsAndTeachers, this.business, this.seePlansAndPricingEs, this.photo, this.graphicDesign, - this.Video, this.illustration, this.socialMedia, this.threeDAndAR, this.pdf, this.aiOverviewCC, - this.adobeFirefly, this.adobecom, this.pdfAndESignatures, this.marketingAndCommerce, this.helpAndSupport]; - - await Promise.all(elements.map(async (element) => { - await expect(element).toBeVisible(); - })); - - await this.creativityAndDesign.click(); - } - - // U-NAV - async validatingunavElements(country) { - await this.page.waitForLoadState('networkidle'); - const elements = [this.adobe, this.creativityAndDesign, this.illustrator, this.features, this.comparePlans, - this.freeTrialDetails, this.tryItForFree, this.appSwitcher, this.signInButton]; - - await Promise.all(elements.map(async (element) => { - switch (element) { - case this.tryItForFree: - if (country === 'Germany') { - await expect(element).toBeVisible(); - } - break; - default: - await expect(element).toBeVisible(); - break; - } - })); - } - - async validatingunavElementsSecondSet() { - await this.page.waitForLoadState('networkidle'); - - const elements = [this.adobe, this.creativityAndDesign, this.illustrator, this.features, - this.comparePlans, this.freeTrialDetails, this.signInButtonTwo]; - - await Promise.all(elements.map(async (element) => { - await expect(element).toBeVisible(); - })); - } - // Footer - async validatingfooterElements(country) { - await this.page.waitForLoadState('networkidle'); + async validatingFooterElements(country) { + await this.changeRegion.scrollIntoViewIfNeeded(); const elements = [this.footerCreativeCloud, this.footerCreativeCloudForBusiness, this.footerdiscountForStudentsAndTeachers, this.footerappsForiOS, this.footerWhatIsExperienceCloud, this.footerDownloadAndInstall, this.footerAdobeBlog, this.footerLoginToYourAccount, this.footerAbout, diff --git a/tests/feds/illustratorSanity.test.js b/tests/feds/illustratorSanity.test.js index bafdb304..d51fe609 100644 --- a/tests/feds/illustratorSanity.test.js +++ b/tests/feds/illustratorSanity.test.js @@ -21,11 +21,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[1].name}, ${features[1].tags}, ${features[1].country}`, async ({ page, baseURL }) => { @@ -36,11 +36,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements - await illustrate.validatingCreativityAndDesignElementsSecondSet(); + await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[2].name}, ${features[2].tags}, ${features[2].country}`, async ({ page, baseURL }) => { @@ -51,11 +51,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements - await illustrate.validatingCreativityAndDesignElementsSecondSet(); + await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[3].name}, ${features[3].tags}, ${features[3].country}`, async ({ page, baseURL }) => { @@ -66,15 +66,14 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements - await illustrate.validatingCreativityAndDesignElementsSecondSet(); + await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[4].name}, ${features[4].tags}, ${features[4].country}`, async ({ page, baseURL }) => { - // const illustrate = new IllustratorPageSanity(page); console.info(`[FEDSInfo] Checking Page: ${baseURL}${features[4].path}`); const pageURL = `${baseURL}${features[4].path}`; @@ -82,27 +81,26 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[5].name}, ${features[5].tags}, ${features[5].country}`, async ({ page, baseURL }) => { console.info(`[FEDSInfo] Checking Page: ${baseURL}${features[5].path}`); - // await test.step(`Validating ${features[5].country} Page`, async () => { const pageURL = `${baseURL}${features[5].path}`; await page.goto(pageURL, { waitUntil: 'domcontentloaded' }); await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[6].name}, ${features[6].tags}, ${features[6].country}`, async ({ page, baseURL }) => { @@ -113,11 +111,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements - await illustrate.validatingCreativityAndDesignElementsThirdSet(); + await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[7].name}, ${features[7].tags}, ${features[7].country}`, async ({ page, baseURL }) => { @@ -128,11 +126,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements - await illustrate.validatingCreativityAndDesignElementsFourthSet(); + await illustrate.validatingCreativityAndDesignElementsSecondSet(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[8].name}, ${features[8].tags}, ${features[8].country}`, async ({ page, baseURL }) => { @@ -143,11 +141,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements - await illustrate.validatingCreativityAndDesignElementsFifthSet(); + await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[9].name}, ${features[9].tags}, ${features[9].country}`, async ({ page, baseURL }) => { @@ -158,11 +156,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[10].name}, ${features[10].tags}, ${features[10].country}`, async ({ page, baseURL }) => { @@ -173,11 +171,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[11].name}, ${features[11].tags}, ${features[11].country}`, async ({ page, baseURL }) => { @@ -188,11 +186,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[12].name}, ${features[12].tags}, , ${features[12].country}`, async ({ page, baseURL }) => { @@ -203,11 +201,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[13].name}, ${features[13].tags}, ${features[13].country}`, async ({ page, baseURL }) => { @@ -218,11 +216,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[14].name}, ${features[14].tags}, ${features[14].country}`, async ({ page, baseURL }) => { @@ -233,11 +231,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[15].name}, ${features[15].tags}, ${features[15].country}`, async ({ page, baseURL }) => { @@ -248,11 +246,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[16].name}, ${features[16].tags}, ${features[16].country}`, async ({ page, baseURL }) => { @@ -263,11 +261,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[17].name}, ${features[17].tags}, ${features[17].country}`, async ({ page, baseURL }) => { @@ -278,11 +276,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElements(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[18].name}, ${features[18].tags}, ${features[18].country}`, async ({ page, baseURL }) => { @@ -293,11 +291,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[19].name}, ${features[19].tags}, ${features[19].country}`, async ({ page, baseURL }) => { @@ -308,11 +306,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[20].name}, ${features[20].tags}, ${features[20].country}`, async ({ page, baseURL }) => { @@ -323,11 +321,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[21].name}, ${features[21].tags}, ${features[21].country}`, async ({ page, baseURL }) => { @@ -338,11 +336,11 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); test(`${features[22].name}, ${features[22].tags}, ${features[22].country}`, async ({ page, baseURL }) => { @@ -353,10 +351,10 @@ test.describe('Test Suite for Illustrator Page Components', () => { await expect(page).toHaveURL(pageURL); // Verifying the visibility of U-NAV Elements - await illustrate.validatingunavElementsSecondSet(); + await illustrate.validatingUnavElements(); // Verifying the Visibility of Creativity & Design Elements await illustrate.validatingCreativityAndDesignElements(); // Verifying the visibility of Footer Elements - await illustrate.validatingfooterElements(); + await illustrate.validatingFooterElements(); }); });