Skip to content

Commit

Permalink
Optimized the code based on the review comments given for PR - 381 (#382
Browse files Browse the repository at this point in the history
)

* Illustrator Test Scripts added

* Illustrator Test Scripts updated as discussed

* Delete features/feds/locales/illustratorPage.json

This file no longer required for the new PR.

* Optimized the code as per review comments given

* 'Unav' and 'Creativity & Design Elements' methods updated

* Updated Illustrator methods in Selector Page

* Logics Updated
  • Loading branch information
PavanKumarN8 authored Jun 25, 2024
1 parent ecc77d7 commit d507172
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 153 deletions.
198 changes: 99 additions & 99 deletions selectors/feds/feds.illustratorsanity.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Loading

0 comments on commit d507172

Please sign in to comment.