From c6be391401ed1092f54aeb0b0db42e53cdddbe65 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Date: Thu, 4 Jul 2024 15:44:48 +0530 Subject: [PATCH 1/2] Creative Cloud Business Enterprise Test Scripts --- .../feds/prodSanity/ccepagesanity.spec.js | 166 ++++++++++ selectors/feds/feds.ccepagesanity.page.js | 305 ++++++++++++++++++ tests/feds/ccepagesanity.test.js | 36 +++ 3 files changed, 507 insertions(+) create mode 100644 features/feds/prodSanity/ccepagesanity.spec.js create mode 100644 selectors/feds/feds.ccepagesanity.page.js create mode 100644 tests/feds/ccepagesanity.test.js diff --git a/features/feds/prodSanity/ccepagesanity.spec.js b/features/feds/prodSanity/ccepagesanity.spec.js new file mode 100644 index 00000000..b4c426bb --- /dev/null +++ b/features/feds/prodSanity/ccepagesanity.spec.js @@ -0,0 +1,166 @@ +module.exports = { + name: 'Creative Cloud Enterprise Page', + features: [ + { + tcid: '0', + name: '@UnitedStatesCCEPageCheck', + path: '/creativecloud/business/enterprise.html?georouting=off', + tags: '@ccepagesanity @cceUnitedStatesPage', + country: 'United States', + }, + { + tcid: '1', + name: '@GermanyCCEPageCheck', + path: '/de/creativecloud/business/enterprise.html?georouting=off', + tags: '@ccepagesanity @cceGermany', + country: 'Germany', + }, + { + tcid: '2', + name: '@FranceCCEPageCheck', + path: '/fr/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEFrance', + country: 'France', + }, + { + tcid: '3', + name: '@ItalyCCEPageCheck', + path: '/it/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEItaly', + country: 'Italy', + }, + { + tcid: '4', + name: '@UnitedKingdomCCEPageCheck', + path: '/uk/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEUnitedKingdom', + country: 'United Kingdom', + }, + { + tcid: '5', + name: '@MiddleEastAndNorthAfricaCCEPageCheck', + path: '/mena_ar/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEMiddleEastAndNorthAfrica', + country: 'Middle East And North Africa', + }, + { + tcid: '6', + name: '@JapanCCEPageCheck', + path: '/jp/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEJapan', + country: 'Japan', + }, + { + tcid: '7', + name: '@IndiaCCEPageCheck', + path: '/in/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEIndia', + country: 'India', + }, + { + tcid: '8', + name: '@SpainCCEPageCheck', + path: '/es/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCESpain', + country: 'Spain', + }, + { + tcid: '9', + name: '@CanadaEnglishCCEPageCheck', + path: '/ca/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCECanadaEnglish', + country: 'Canada English', + }, + { + tcid: '10', + name: '@KoreaCCEPageCheck', + path: '/kr/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEKorea', + country: 'Korea', + }, + { + tcid: '11', + name: '@CanadaFrenchCCEPageCheck', + path: '/ca_fr/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCECanadaFrench', + country: 'Canada French', + }, + { + tcid: '12', + name: '@PolandCCEPageCheck', + path: '/pl/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEPoland', + country: 'Poland', + }, + { + tcid: '13', + name: '@MexicoCCEPageCheck', + path: '/mx/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEMexico', + country: 'Mexico', + }, + { + tcid: '14', + name: '@AustraliaCCEPageCheck', + path: '/au/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEAustralia', + country: 'Australia', + }, + { + tcid: '15', + name: '@IndonesiaCCEPageCheck', + path: '/id_id/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEIndonesia', + country: 'Indonesia', + }, + { + tcid: '16', + name: '@IndonesiaEnglishCCEPageCheck', + path: '/id_en/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEIndonesiaEnglish', + country: 'Indonesia English', + }, + { + tcid: '17', + name: '@TurkeyCCEPageCheck', + path: '/tr/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCETurkey', + country: 'Turkey', + }, + { + tcid: '18', + name: '@ThailandEnglishCCEPageCheck', + path: '/th_en/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEThailandEnglish', + country: 'Thailand English', + }, + { + tcid: '19', + name: '@ThailandCCEPageCheck', + path: '/th_th/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEThailand', + country: 'Thailand', + }, + { + tcid: '20', + name: '@SingaporeCCEPageCheck', + path: '/sg/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCESingapore', + country: 'Singapore', + }, + { + tcid: '21', + name: '@PhilippineCCEPageCheck', + path: '/ph_fil/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEPhilippines', + country: 'Philippines', + }, + { + tcid: '22', + name: '@PhilippineEnglishCCEPageCheck', + path: '/ph_fil/creativecloud/business/enterprise.html?georouting=off', + tags: '@CCEPagesanity @CCEPhilippinesEnglish', + country: 'Philippines English', + }, + ], +}; diff --git a/selectors/feds/feds.ccepagesanity.page.js b/selectors/feds/feds.ccepagesanity.page.js new file mode 100644 index 00000000..ec9b23e5 --- /dev/null +++ b/selectors/feds/feds.ccepagesanity.page.js @@ -0,0 +1,305 @@ +import { expect } from '@playwright/test'; + +export default class CreativeCloudEnterpriseSanity { + constructor(page) { + this.page = page; + + // U-Nav Elements + this.adobe = page.locator('.feds-brand'); + this.appSwitcher = page.locator('#unav-app-switcher'); + this.signInButton = page.locator('#unav-profile div'); + + this.creativityAndDesign = page.locator('.feds-navItem:nth-child(1) button'); + this.creativeCloudForBusiness = page.locator('.feds-navItem:nth-child(2) a'); + this.products = page.locator('.feds-navItem:nth-child(3) button'); + this.resources = page.locator('.feds-navItem:nth-child(4) button'); + this.adminConsole = page.locator('.feds-navItem:nth-child(5) a'); + this.comparePlans = page.locator('.feds-navItem:nth-child(6) a'); + this.freeTrial = page.locator('.feds-navItem:nth-child(7) a'); + this.contactSales = page.locator('.feds-navItem:nth-child(8)'); + this.contactNumber = page.locator('.feds-navItem:nth-child(9) a'); + + // Creativity & Design Elements + this.whatIsCC = page.locator('.feds-popup [href*="creativecloud.html"]').nth(0); + this.photographers = page.locator('.feds-popup [href*="photography.html"]').nth(0); + this.studentsAndTeachers = page.locator('.feds-popup [href*="students.html"]'); + this.individuals = page.locator('.feds-popup [href*="creativecloud/all-apps.html"]').nth(0); + this.business = page.locator('.feds-popup [href*="business.html"]'); + this.schoolsAndUniversities = page.locator('.feds-popup [href*="education.html"]'); + this.viewPlansAndPricing = page.locator('.feds-popup [href*="creativecloud/plans.html"]'); + + this.acrobatPro = page.locator('.feds-popup [href*="J7XBWKC4&mv=other"]'); + this.governmentAgencies = page.locator('.feds-popup [href*="government.html"]'); + this.benifitsForCC = page.locator('.feds-popup [href*="cc-paid-member-benefits.html"]'); + this.seeAllProducts = page.locator('.feds-popup [href*="JVLHVXNY&mv=other"]'); + this.adobeExpressEs = page.locator('[href*="promoid=J469WP35&mv=other"]'); + this.adobeStockEs = page.locator('.feds-popup [href*="JQVGW2DZ&mv=other"]'); + + this.photoshop = page.locator('.feds-popup [href*="products/photoshop.html"]'); + this.adobeExpress = page.locator('.feds-popup [href*="Y69SGP43&mv=other"]'); + this.lightroom = page.locator('.feds-popup [href*="photoshop-lightroom.html"]'); + this.illustrator = page.locator('.feds-popup [href*="products/illustrator.html"]'); + this.premierePro = page.locator('.feds-popup [href*="products/premiere.html"]'); + this.adobeStock = page.locator('.feds-popup [href*="stock.adobe.com"]'); + this.viewAllProducts = page.locator('.feds-popup [href*="category=creativity-design"]'); + + this.photo = page.locator('.feds-popup [href*="D8F91JW4&mv=other"]'); + this.graphicDesign = page.locator('.feds-popup [href*="design.html"]'); + this.video = page.locator('.feds-popup [href*="video.html"]'); + this.illustratorEx = page.locator('.feds-popup [href*="illustration.html"]'); + this.socialMedia = page.locator('.feds-popup [href*="social-media.html"]'); + this.threeDAndAR = page.locator('.feds-popup [href*="3d-ar.html"]'); + this.pdf = page.locator('.feds-popup [href$="acrobat-pro-cc.html"]'); + + this.aiOverview = page.locator('.feds-popup [href*="ai/overview.html"]'); + this.adobeFirefly = page.locator('.feds-popup [href*="products/firefly.html"]'); + this.adobeFireFlyTwo = page.locator('.feds-popup [href*="generative-ai/firefly.html"]'); + this.goToSpecialOffers = page.locator('.feds-popup [href*="special-offers.html"]'); + + this.corporateInquiries = page.locator('.feds-popup [href*="tel:"]'); + + this.adobecom = page.locator('.feds-crossCloudMenu-item [href*="/"]').nth(0); + this.pdfAndESignature = page.locator('.feds-crossCloudMenu-item [href*="acrobat.html"]'); + this.marketingAndCommerce = page.locator('.feds-crossCloudMenu-item [href*="business.adobe.com"]'); + this.helpAndSupport = page.locator('.feds-crossCloudMenu-item [href*="support.html"]'); + + this.removeBackground = page.locator('[href*="KCJMVG5Q&mv=other"]'); + this.resizeImage = page.locator('[href*="GVTYXXVD&mv=other"]'); + this.covertImageToSVG = page.locator('[href*="K42KVPMS&mv=other"]'); + this.covertVideoToGIF = page.locator('[href*="JZBJVTCT&mv=other"]'); + this.createQRCode = page.locator('[href*="KH8NVBFP&mv=other"]'); + this.seeAllQuickActions = page.locator('[href*="H822XKN9&mv=other"]'); + + this.resume = page.locator('[href*="GMCWY715&mv=other"]'); + this.posters = page.locator('[href*="FZPQYTPB&mv=other"]'); + this.card = page.locator('[href*="GVTYXYK3&mv=other"]'); + this.instagramPost = page.locator('[href*="7DRZ6CYM&mv=other"]'); + this.youTubeVideo = page.locator('[href*="7JJ1687L&mv=other"]'); + this.createNow = page.locator('[href*="J7XBWKS1&mv=other"]'); + + this.threeDAndARUS = page.locator('.feds-popup [href*="substance3d"]').nth(0); + this.adobeExpressIn = page.locator('[href*="HCS3XGLY&mv=other"]'); + this.seePlansAndPricing = page.locator('.feds-cta-wrapper [href*="WXYGHWCC&mv=other"]'); + + // Product Elements + this.creativeCloudForTeamsPro = page.locator('.feds-popup [href*="business/teams.html"]'); + this.photoshopPro = page.locator('.feds-popup [href*="teams/photoshop.html"]'); + this.substanceThreeDPro = page.locator('.feds-popup [href*="collection-for-teams.html"]'); + + // Resource Elements + this.resourceCenter = page.locator('.feds-popup [href*="resources/main.html"]').nth(0); + this.helpCenter = page.locator('.feds-popup [href*="enterprise/teams.html"]'); + + // Footer + this.footerCreativeCloud = page.locator('.feds-footer-wrapper a[href*="creativecloud.html"]'); + this.footerCreativeCloudForBusiness = page.locator('.feds-footer-wrapper a[href*="creativecloud/business.html"]'); + this.footerdiscountForStudentsAndTeachers = page.locator('.feds-footer-wrapper a[href*="students.html"]'); + this.footerappsForiOS = page.locator('.feds-footer-wrapper a[href*="id852473028"]'); + this.footerWhatIsExperienceCloud = page.locator('.feds-footer-wrapper a[href*="business.adobe.com"]').nth(0); + this.footerWhatIsExperienceCloudTwo = page.locator('.feds-footer-wrapper a[href*="experience-cloud.html"]'); + this.footerDownloadAndInstall = page.locator('.feds-footer-wrapper a[href*="download-install.html"]'); + this.footerAdobeBlog = page.locator('.feds-footer-wrapper a[href*="blog.adobe.com"]'); + this.footerLoginToYourAccount = page.locator('.feds-footer-wrapper a[href*="account.adobe.com"]').nth(0); + this.footerAbout = page.locator('.feds-footer-wrapper a[href*="about-adobe.html"]').nth(0); + + // Featured Products + this.footerAdobeAcrobatReaderlogo = page.locator('a[href$="reader/"]'); + this.footerAdobeExpresslogo = page.locator('a[href$="Z2G1FSYV&mv=other"]:nth-of-type(2)'); + this.footerPhotoshoplogo = page.locator('a[href$="photoshop/free-trial-download.html"]'); + this.footerIllustratorlogo = page.locator('a[href$="illustrator/free-trial-download.html"]'); + + // Change Region and social media + this.changeRegion = page.locator('.feds-regionPicker-wrapper'); + this.facebookLogo = page.locator('a[href*="facebook"]'); + this.instagramLogo = page.locator('a[href*="instagram.com"]'); + this.twitterlogo = page.locator('a[href*="twitter"]'); + this.linkedinLogo = page.locator('a[href*="linkedin"]'); + this.copyright = page.locator('.feds-footer-legalWrapper>p>span'); + this.privacyPolicy = page.locator('.feds-footer-legalWrapper a:nth-of-type(1)'); + this.termsOfUse = page.locator('.feds-footer-legalWrapper a:nth-of-type(2)'); + this.cookies = page.locator('.feds-footer-legalWrapper a:nth-of-type(3)'); + this.protectMyPersonalData = page.locator('.feds-footer-legalWrapper a:nth-of-type(4)'); + this.adChoices = page.locator('.feds-footer-legalWrapper a:nth-of-type(5)'); + } + + // UNAV + async validatingUnavElements(country) { + const elementsToCheck = [ + { element: this.adobe, conditions: { defaultVisibility: true } }, + { element: this.appSwitcher, conditions: { defaultVisibility: true } }, + { element: this.signInButton, conditions: { defaultVisibility: true } }, + { element: this.creativityAndDesign, conditions: { defaultVisibility: true } }, + { element: this.creativeCloudForBusiness, conditions: { defaultVisibility: true } }, + { element: this.products, conditions: { defaultVisibility: true } }, + { element: this.resources, conditions: { defaultVisibility: true } }, + { element: this.adminConsole, conditions: { defaultVisibility: true } }, + { element: this.comparePlans, conditions: { defaultVisibility: true } }, + { element: this.freeTrial, conditions: { defaultVisibility: true } }, + { element: this.contactSales, conditions: { defaultVisibility: true } }, + { element: this.contactNumber, conditions: { defaultVisibility: true, excludeCountries: ['Australia'] } }, + ]; + + await Promise.all(elementsToCheck.map(async ({ element, conditions }) => { + if (conditions.includeCountries && conditions.includeCountries.includes(country)) { + await expect(element).toBeVisible(); + } else if (conditions.excludeCountries && conditions.excludeCountries.includes(country)) { + await expect(element).not.toBeVisible(); + } else if (conditions.defaultVisibility) { + await expect(element).toBeVisible(); + } + })); + } + + // Creativity & Design + async validatingCreativityAndDesignElements(country) { + await this.creativityAndDesign.click(); + const elementsToCheck = [ + { element: this.whatIsCC, conditions: { defaultVisibility: true, includeCountries: ['Germany'] } }, + { element: this.photographers, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.studentsAndTeachers, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { + element: this.individuals, + conditions: { + defaultVisibility: true, + excludeCountries: ['Germany', 'France', 'Thailand', 'Thailand English'], + }, + }, + { element: this.business, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { + element: this.schoolsAndUniversities, + conditions: { + defaultVisibility: true, + excludeCountries: ['Spain', 'India'], + }, + }, + { element: this.viewPlansAndPricing, conditions: { defaultVisibility: true } }, + { element: this.photoshop, conditions: { defaultVisibility: true, includeCountries: ['India'] } }, + { element: this.adobeExpress, conditions: { defaultVisibility: true, excludeCountries: ['Spain', 'India'] } }, + { element: this.lightroom, conditions: { defaultVisibility: true, excludeCountries: ['Spain', 'India'] } }, + { element: this.illustrator, conditions: { defaultVisibility: true, includeCountries: ['India'] } }, + { element: this.premierePro, conditions: { defaultVisibility: true, includeCountries: ['India'] } }, + { element: this.adobeStock, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.viewAllProducts, conditions: { defaultVisibility: true, excludeCountries: ['Spain', 'India'] } }, + { element: this.photo, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.graphicDesign, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.video, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.illustratorEx, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.socialMedia, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { + element: this.threeDAndAR, + conditions: { + defaultVisibility: true, + excludeCountries: ['United States', 'India'], + }, + }, + { element: this.pdf, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { + element: this.aiOverview, + conditions: { + defaultVisibility: true, + excludeCountries: ['Germany', 'France', 'Italy', 'Japan', 'United Kingdom', + 'Middle East And North Africa', 'Spain', 'Canada English', 'Korea', 'Canada French', + 'Poland', 'Indonesia', 'Indonesia English', 'Turkey', 'Thailand English', + 'Thailand', 'Singapore', 'Philippines', 'Philippines English', 'India'], + }, + }, + { + element: this.adobeFirefly, + conditions: { + defaultVisibility: true, + excludeCountries: ['Germany', 'France', 'Italy', 'United Kingdom', 'Middle East And North Africa', + 'Japan', 'Canada English', 'Korea', 'Canada French', 'Poland', 'Indonesia', 'Philippines English', + 'Indonesia English', 'Turkey', 'Thailand English', 'Thailand', 'Singapore', 'Philippines', 'India'], + }, + }, + { + element: this.adobeFireFlyTwo, + conditions: { + includeCountries: ['Germany', 'France', 'Italy', 'United Kingdom', 'Middle East And North Africa', + 'Japan', 'Canada English', 'Korea', 'Canada French', 'Poland', 'Indonesia', 'Philippines English', + 'Indonesia English', 'Turkey', 'Thailand English', 'Thailand', 'Singapore', 'Philippines', 'India'], + }, + }, + { element: this.adobecom, conditions: { includeCountries: ['United States'] } }, + { element: this.pdfAndESignature, conditions: { includeCountries: ['United States'] } }, + { element: this.marketingAndCommerce, conditions: { includeCountries: ['United States'] } }, + { element: this.helpAndSupport, conditions: { includeCountries: ['United States'] } }, + { element: this.acrobatPro, conditions: { includeCountries: ['Spain'] } }, + { element: this.adobeExpressEs, conditions: { includeCountries: ['Spain'] } }, + { element: this.adobeStockEs, conditions: { includeCountries: ['Spain'] } }, + { element: this.benifitsForCC, conditions: { includeCountries: ['Japan'] } }, + { element: this.corporateInquiries, conditions: { includeCountries: ['Japan'] } }, + { + element: this.goToSpecialOffers, + conditions: { + includeCountries: ['Spain', 'Turkey', 'Thailand English', 'Thailand', 'Philippines', + 'Philippines English'], + }, + }, + { element: this.governmentAgencies, conditions: { includeCountries: ['Japan'] } }, + { element: this.seeAllProducts, conditions: { includeCountries: ['Spain'] } }, + { element: this.threeDAndARUS, conditions: { includeCountries: ['United States'] } }, + + { element: this.removeBackground, conditions: { includeCountries: ['India'] } }, + { element: this.resizeImage, conditions: { includeCountries: ['India'] } }, + { element: this.covertImageToSVG, conditions: { includeCountries: ['India'] } }, + { element: this.covertVideoToGIF, conditions: { includeCountries: ['India'] } }, + { element: this.createQRCode, conditions: { includeCountries: ['India'] } }, + { element: this.seeAllQuickActions, conditions: { includeCountries: ['India'] } }, + { element: this.resume, conditions: { includeCountries: ['India'] } }, + { element: this.posters, conditions: { includeCountries: ['India'] } }, + { element: this.card, conditions: { includeCountries: ['India'] } }, + { element: this.instagramPost, conditions: { includeCountries: ['India'] } }, + { element: this.youTubeVideo, conditions: { includeCountries: ['India'] } }, + { element: this.createNow, conditions: { includeCountries: ['India'] } }, + { element: this.whatIsCC, conditions: { includeCountries: ['India'] } }, + { element: this.adobeExpressIn, conditions: { includeCountries: ['India'] } }, + { element: this.seePlansAndPricing, conditions: { includeCountries: ['India'] } }, + ]; + + await Promise.all(elementsToCheck.map(async ({ element, conditions }) => { + if (conditions.includeCountries && conditions.includeCountries.includes(country)) { + await expect(element).toBeVisible(); + } else if (conditions.excludeCountries && conditions.excludeCountries.includes(country)) { + await expect(element).not.toBeVisible(); + } else if (conditions.defaultVisibility) { + await expect(element).toBeVisible(); + } + })); + } + + // Products + async validatingProductElements() { + await this.products.click(); + const elements = [this.creativeCloudForTeamsPro, this.photoshopPro, this.substanceThreeDPro]; + await Promise.all(elements.map(async (element) => { + await expect(element).toBeVisible(); + })); + await this.products.click(); + } + + // Resources + async validatingResourceElements() { + await this.resources.click(); + const elements = [this.resourceCenter, this.helpCenter]; + await Promise.all(elements.map(async (element) => { + await expect(element).toBeVisible(); + })); + await this.resources.click(); + } + + // Footer + async validatingFooterElements() { + await this.changeRegion.scrollIntoViewIfNeeded(); + const elements = [this.footerCreativeCloud, this.footerCreativeCloudForBusiness, + this.footerdiscountForStudentsAndTeachers, this.footerappsForiOS, this.footerWhatIsExperienceCloud, + this.footerDownloadAndInstall, this.footerAdobeBlog, this.footerLoginToYourAccount, this.footerAbout, + this.footerAdobeAcrobatReaderlogo, this.footerAdobeExpresslogo, this.footerPhotoshoplogo, + this.footerIllustratorlogo, this.changeRegion, this.facebookLogo, this.instagramLogo, this.twitterlogo, + this.linkedinLogo, this.copyright, this.privacyPolicy, this.termsOfUse, this.cookies, + this.protectMyPersonalData, this.adChoices]; + await Promise.all(elements.map(async (element) => { + await expect(element).toBeVisible(); + })); + } +} diff --git a/tests/feds/ccepagesanity.test.js b/tests/feds/ccepagesanity.test.js new file mode 100644 index 00000000..08c3ca37 --- /dev/null +++ b/tests/feds/ccepagesanity.test.js @@ -0,0 +1,36 @@ +import { expect, test, beforeEach, afterEach } from '@playwright/test'; +import { features } from '../../features/feds/prodSanity/ccepagesanity.spec.js'; +import CreativeCloudEnterpriseSanity from '../../selectors/feds/feds.ccepagesanity.page.js'; + +test.describe('Test Suite for Creative Cloud Business Enterprise Page Components', () => { + let enterprise; + + beforeEach(async ({ page }) => { + enterprise = new CreativeCloudEnterpriseSanity(page); + }); + + afterEach(async ({ page }) => { + await page.close(); + }); + + features.forEach((props) => { + test(`${props.name}, ${props.tags}, ${props.country}`, async ({ page, baseURL }) => { + console.info(`[FEDSInfo] Checking Page: ${baseURL}${features[props.tcid].path}`); + + const pageURL = `${baseURL}${features[props.tcid].path}`; + await page.goto(pageURL, { waitUntil: 'networkidle' }); + await expect(page).toHaveURL(pageURL); + + // Verifying the visibility of U-NAV Elements + await enterprise.validatingUnavElements(props.country); + // Verifying the visibility of Creativity & Design Elements + await enterprise.validatingCreativityAndDesignElements(props.country); + // Verifying the visibility of Product Elements + await enterprise.validatingProductElements(); + // Verifying the visibility of Resource Elements + await enterprise.validatingResourceElements(); + // Verifying the visibility of Footer Elements + await enterprise.validatingFooterElements(); + }); + }); +}); From 91b0c3837ba89462dad7e43250df99a01784b80f Mon Sep 17 00:00:00 2001 From: Pavan Kumar Date: Mon, 22 Jul 2024 10:22:03 +0530 Subject: [PATCH 2/2] Updated locators for Creative Cloud Business Enterprise page and added mobile, iPad, and tablet test scripts. --- .../feds/prodSanity/ccepagesanity.spec.js | 44 ++-- .../mobileTesting/mobileCCEPageSanity.spec.js | 166 ++++++++++++ selectors/feds/feds.ccepagesanity.page.js | 237 +++++++++++++----- tests/feds/ccepagesanity.test.js | 6 +- tests/feds/mobileCCEPageSanity.test.js | 36 +++ 5 files changed, 404 insertions(+), 85 deletions(-) create mode 100644 features/feds/prodSanity/mobileTesting/mobileCCEPageSanity.spec.js create mode 100644 tests/feds/mobileCCEPageSanity.test.js diff --git a/features/feds/prodSanity/ccepagesanity.spec.js b/features/feds/prodSanity/ccepagesanity.spec.js index b4c426bb..fba2f17b 100644 --- a/features/feds/prodSanity/ccepagesanity.spec.js +++ b/features/feds/prodSanity/ccepagesanity.spec.js @@ -19,147 +19,147 @@ module.exports = { tcid: '2', name: '@FranceCCEPageCheck', path: '/fr/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEFrance', + tags: '@ccepagesanity @CCEFrance', country: 'France', }, { tcid: '3', name: '@ItalyCCEPageCheck', path: '/it/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEItaly', + tags: '@ccepagesanity @CCEItaly', country: 'Italy', }, { tcid: '4', name: '@UnitedKingdomCCEPageCheck', path: '/uk/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEUnitedKingdom', + tags: '@ccepagesanity @CCEUnitedKingdom', country: 'United Kingdom', }, { tcid: '5', name: '@MiddleEastAndNorthAfricaCCEPageCheck', path: '/mena_ar/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEMiddleEastAndNorthAfrica', + tags: '@ccepagesanity @CCEMiddleEastAndNorthAfrica', country: 'Middle East And North Africa', }, { tcid: '6', name: '@JapanCCEPageCheck', path: '/jp/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEJapan', + tags: '@ccepagesanity @CCEJapan', country: 'Japan', }, { tcid: '7', name: '@IndiaCCEPageCheck', path: '/in/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEIndia', + tags: '@ccepagesanity @CCEIndia', country: 'India', }, { tcid: '8', name: '@SpainCCEPageCheck', path: '/es/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCESpain', + tags: '@ccepagesanity @CCESpain', country: 'Spain', }, { tcid: '9', name: '@CanadaEnglishCCEPageCheck', path: '/ca/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCECanadaEnglish', + tags: '@ccepagesanity @CCECanadaEnglish', country: 'Canada English', }, { tcid: '10', name: '@KoreaCCEPageCheck', path: '/kr/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEKorea', + tags: '@ccepagesanity @CCEKorea', country: 'Korea', }, { tcid: '11', name: '@CanadaFrenchCCEPageCheck', path: '/ca_fr/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCECanadaFrench', + tags: '@ccepagesanity @CCECanadaFrench', country: 'Canada French', }, { tcid: '12', name: '@PolandCCEPageCheck', path: '/pl/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEPoland', + tags: '@ccepagesanity @CCEPoland', country: 'Poland', }, { tcid: '13', name: '@MexicoCCEPageCheck', path: '/mx/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEMexico', + tags: '@ccepagesanity @CCEMexico', country: 'Mexico', }, { tcid: '14', name: '@AustraliaCCEPageCheck', path: '/au/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEAustralia', + tags: '@ccepagesanity @CCEAustralia', country: 'Australia', }, { tcid: '15', name: '@IndonesiaCCEPageCheck', path: '/id_id/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEIndonesia', + tags: '@ccepagesanity @CCEIndonesia', country: 'Indonesia', }, { tcid: '16', name: '@IndonesiaEnglishCCEPageCheck', path: '/id_en/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEIndonesiaEnglish', + tags: '@ccepagesanity @CCEIndonesiaEnglish', country: 'Indonesia English', }, { tcid: '17', name: '@TurkeyCCEPageCheck', path: '/tr/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCETurkey', + tags: '@ccepagesanity @CCETurkey', country: 'Turkey', }, { tcid: '18', name: '@ThailandEnglishCCEPageCheck', path: '/th_en/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEThailandEnglish', + tags: '@ccepagesanity @CCEThailandEnglish', country: 'Thailand English', }, { tcid: '19', name: '@ThailandCCEPageCheck', path: '/th_th/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEThailand', + tags: '@ccepagesanity @CCEThailand', country: 'Thailand', }, { tcid: '20', name: '@SingaporeCCEPageCheck', path: '/sg/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCESingapore', + tags: '@ccepagesanity @CCESingapore', country: 'Singapore', }, { tcid: '21', name: '@PhilippineCCEPageCheck', path: '/ph_fil/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEPhilippines', + tags: '@ccepagesanity @CCEPhilippines', country: 'Philippines', }, { tcid: '22', name: '@PhilippineEnglishCCEPageCheck', - path: '/ph_fil/creativecloud/business/enterprise.html?georouting=off', - tags: '@CCEPagesanity @CCEPhilippinesEnglish', + path: '/ph_en/creativecloud/business/enterprise.html?georouting=off', + tags: '@ccepagesanity @CCEPhilippinesEnglish', country: 'Philippines English', }, ], diff --git a/features/feds/prodSanity/mobileTesting/mobileCCEPageSanity.spec.js b/features/feds/prodSanity/mobileTesting/mobileCCEPageSanity.spec.js new file mode 100644 index 00000000..65f741e8 --- /dev/null +++ b/features/feds/prodSanity/mobileTesting/mobileCCEPageSanity.spec.js @@ -0,0 +1,166 @@ +module.exports = { + name: 'Creative Cloud Enterprise Page', + features: [ + { + tcid: '0', + name: '@UnitedStatesMobileCCEPageCheck', + path: '/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEUnitedStatesPage', + country: 'United States', + }, + { + tcid: '1', + name: '@GermanyMobileCCEPageCheck', + path: '/de/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEGermany', + country: 'Germany', + }, + { + tcid: '2', + name: '@FranceMobileCCEPageCheck', + path: '/fr/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEFrance', + country: 'France', + }, + { + tcid: '3', + name: '@ItalyMobileCCEPageCheck', + path: '/it/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEItaly', + country: 'Italy', + }, + { + tcid: '4', + name: '@UnitedKingdomMobileCCEPageCheck', + path: '/uk/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEUnitedKingdom', + country: 'United Kingdom', + }, + { + tcid: '5', + name: '@MiddleEastAndNorthAfricaMobileCCEPageCheck', + path: '/mena_ar/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEMiddleEastAndNorthAfrica', + country: 'Middle East And North Africa', + }, + { + tcid: '6', + name: '@JapanMobileCCEPageCheck', + path: '/jp/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEJapan', + country: 'Japan', + }, + { + tcid: '7', + name: '@IndiaMobileCCEPageCheck', + path: '/in/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEIndia', + country: 'India', + }, + { + tcid: '8', + name: '@SpainMobileCCEPageCheck', + path: '/es/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCESpain', + country: 'Spain', + }, + { + tcid: '9', + name: '@CanadaEnglishMobileCCEPageCheck', + path: '/ca/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCECanadaEnglish', + country: 'Canada English', + }, + { + tcid: '10', + name: '@KoreaMobileCCEPageCheck', + path: '/kr/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEKorea', + country: 'Korea', + }, + { + tcid: '11', + name: '@CanadaFrenchMobileCCEPageCheck', + path: '/ca_fr/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCECanadaFrench', + country: 'Canada French', + }, + { + tcid: '12', + name: '@PolandMobileCCEPageCheck', + path: '/pl/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEPoland', + country: 'Poland', + }, + { + tcid: '13', + name: '@MexicoMobileCCEPageCheck', + path: '/mx/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEMexico', + country: 'Mexico', + }, + { + tcid: '14', + name: '@AustraliaMobileCCEPageCheck', + path: '/au/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEAustralia', + country: 'Australia', + }, + { + tcid: '15', + name: '@IndonesiaMobileCCEPageCheck', + path: '/id_id/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEIndonesia', + country: 'Indonesia', + }, + { + tcid: '16', + name: '@IndonesiaEnglishMobileCCEPageCheck', + path: '/id_en/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEIndonesiaEnglish', + country: 'Indonesia English', + }, + { + tcid: '17', + name: '@TurkeyMobileCCEPageCheck', + path: '/tr/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCETurkey', + country: 'Turkey', + }, + { + tcid: '18', + name: '@ThailandEnglishMobileCCEPageCheck', + path: '/th_en/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEThailandEnglish', + country: 'Thailand English', + }, + { + tcid: '19', + name: '@ThailandMobileCCEPageCheck', + path: '/th_th/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEThailand', + country: 'Thailand', + }, + { + tcid: '20', + name: '@SingaporeMobileCCEPageCheck', + path: '/sg/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCESingapore', + country: 'Singapore', + }, + { + tcid: '21', + name: '@PhilippineMobileCCEPageCheck', + path: '/ph_fil/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEPhilippines', + country: 'Philippines', + }, + { + tcid: '22', + name: '@PhilippineEnglishMobileCCEPageCheck', + path: '/ph_en/creativecloud/business/enterprise.html?georouting=off', + tags: '@mobileCCEPageSanity @mobileCCEPhilippinesEnglish', + country: 'Philippines English', + }, + ], +}; diff --git a/selectors/feds/feds.ccepagesanity.page.js b/selectors/feds/feds.ccepagesanity.page.js index ec9b23e5..36402c6e 100644 --- a/selectors/feds/feds.ccepagesanity.page.js +++ b/selectors/feds/feds.ccepagesanity.page.js @@ -8,6 +8,7 @@ export default class CreativeCloudEnterpriseSanity { this.adobe = page.locator('.feds-brand'); this.appSwitcher = page.locator('#unav-app-switcher'); this.signInButton = page.locator('#unav-profile div'); + this.hamburgerMenu = page.locator('.feds-toggle'); this.creativityAndDesign = page.locator('.feds-navItem:nth-child(1) button'); this.creativeCloudForBusiness = page.locator('.feds-navItem:nth-child(2) a'); @@ -19,6 +20,23 @@ export default class CreativeCloudEnterpriseSanity { this.contactSales = page.locator('.feds-navItem:nth-child(8)'); this.contactNumber = page.locator('.feds-navItem:nth-child(9) a'); + this.solutions = page.locator('.feds-menu-column').nth(5); + this.featuredProducts = page.locator('.feds-menu-column').nth(6); + this.more = page.locator('.feds-menu-column').nth(7); + + this.learn = page.locator('.feds-menu-column').nth(8); + this.support = page.locator('.feds-menu-column').nth(9); + + this.shopForFooter = page.locator('.feds-menu-section').nth(6); + this.forBusinessFooter = page.locator('.feds-menu-section').nth(7); + this.forEducationFooter = page.locator('.feds-menu-section').nth(8); + this.forMobileFooter = page.locator('.feds-menu-section').nth(9); + this.experienceCloudFooter = page.locator('.feds-menu-section').nth(10); + this.supportFooter = page.locator('.feds-menu-section').nth(11); + this.resourcesFooter = page.locator('.feds-menu-section').nth(12); + this.adobeAcrobatFooter = page.locator('.feds-menu-section').nth(13); + this.adobeFooter = page.locator('.feds-menu-section').nth(14); + // Creativity & Design Elements this.whatIsCC = page.locator('.feds-popup [href*="creativecloud.html"]').nth(0); this.photographers = page.locator('.feds-popup [href*="photography.html"]').nth(0); @@ -48,7 +66,7 @@ export default class CreativeCloudEnterpriseSanity { this.video = page.locator('.feds-popup [href*="video.html"]'); this.illustratorEx = page.locator('.feds-popup [href*="illustration.html"]'); this.socialMedia = page.locator('.feds-popup [href*="social-media.html"]'); - this.threeDAndAR = page.locator('.feds-popup [href*="3d-ar.html"]'); + this.threeDAndAR = page.locator('.feds-popup [href*="3d"]').nth(0); this.pdf = page.locator('.feds-popup [href$="acrobat-pro-cc.html"]'); this.aiOverview = page.locator('.feds-popup [href*="ai/overview.html"]'); @@ -81,6 +99,8 @@ export default class CreativeCloudEnterpriseSanity { this.adobeExpressIn = page.locator('[href*="HCS3XGLY&mv=other"]'); this.seePlansAndPricing = page.locator('.feds-cta-wrapper [href*="WXYGHWCC&mv=other"]'); + this.quickActions = page.locator('.feds-menu-headline').nth(0); + // Product Elements this.creativeCloudForTeamsPro = page.locator('.feds-popup [href*="business/teams.html"]'); this.photoshopPro = page.locator('.feds-popup [href*="teams/photoshop.html"]'); @@ -136,14 +156,12 @@ export default class CreativeCloudEnterpriseSanity { { element: this.comparePlans, conditions: { defaultVisibility: true } }, { element: this.freeTrial, conditions: { defaultVisibility: true } }, { element: this.contactSales, conditions: { defaultVisibility: true } }, - { element: this.contactNumber, conditions: { defaultVisibility: true, excludeCountries: ['Australia'] } }, + { element: this.contactNumber, conditions: { includeCountries: ['United States'] } }, ]; await Promise.all(elementsToCheck.map(async ({ element, conditions }) => { if (conditions.includeCountries && conditions.includeCountries.includes(country)) { await expect(element).toBeVisible(); - } else if (conditions.excludeCountries && conditions.excludeCountries.includes(country)) { - await expect(element).not.toBeVisible(); } else if (conditions.defaultVisibility) { await expect(element).toBeVisible(); } @@ -157,20 +175,11 @@ export default class CreativeCloudEnterpriseSanity { { element: this.whatIsCC, conditions: { defaultVisibility: true, includeCountries: ['Germany'] } }, { element: this.photographers, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, { element: this.studentsAndTeachers, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, - { - element: this.individuals, - conditions: { - defaultVisibility: true, - excludeCountries: ['Germany', 'France', 'Thailand', 'Thailand English'], - }, - }, + { element: this.individuals, conditions: { defaultVisibility: true, excludeCountries: ['Germany', 'France'] } }, { element: this.business, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, { element: this.schoolsAndUniversities, - conditions: { - defaultVisibility: true, - excludeCountries: ['Spain', 'India'], - }, + conditions: { defaultVisibility: true, excludeCountries: ['Spain', 'India'] }, }, { element: this.viewPlansAndPricing, conditions: { defaultVisibility: true } }, { element: this.photoshop, conditions: { defaultVisibility: true, includeCountries: ['India'] } }, @@ -185,57 +194,21 @@ export default class CreativeCloudEnterpriseSanity { { element: this.video, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, { element: this.illustratorEx, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, { element: this.socialMedia, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, - { - element: this.threeDAndAR, - conditions: { - defaultVisibility: true, - excludeCountries: ['United States', 'India'], - }, - }, + { element: this.threeDAndAR, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, { element: this.pdf, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, - { - element: this.aiOverview, - conditions: { - defaultVisibility: true, - excludeCountries: ['Germany', 'France', 'Italy', 'Japan', 'United Kingdom', - 'Middle East And North Africa', 'Spain', 'Canada English', 'Korea', 'Canada French', - 'Poland', 'Indonesia', 'Indonesia English', 'Turkey', 'Thailand English', - 'Thailand', 'Singapore', 'Philippines', 'Philippines English', 'India'], - }, - }, - { - element: this.adobeFirefly, - conditions: { - defaultVisibility: true, - excludeCountries: ['Germany', 'France', 'Italy', 'United Kingdom', 'Middle East And North Africa', - 'Japan', 'Canada English', 'Korea', 'Canada French', 'Poland', 'Indonesia', 'Philippines English', - 'Indonesia English', 'Turkey', 'Thailand English', 'Thailand', 'Singapore', 'Philippines', 'India'], - }, - }, - { - element: this.adobeFireFlyTwo, - conditions: { - includeCountries: ['Germany', 'France', 'Italy', 'United Kingdom', 'Middle East And North Africa', - 'Japan', 'Canada English', 'Korea', 'Canada French', 'Poland', 'Indonesia', 'Philippines English', - 'Indonesia English', 'Turkey', 'Thailand English', 'Thailand', 'Singapore', 'Philippines', 'India'], - }, - }, - { element: this.adobecom, conditions: { includeCountries: ['United States'] } }, - { element: this.pdfAndESignature, conditions: { includeCountries: ['United States'] } }, - { element: this.marketingAndCommerce, conditions: { includeCountries: ['United States'] } }, - { element: this.helpAndSupport, conditions: { includeCountries: ['United States'] } }, + { element: this.aiOverview, conditions: { defaultVisibility: true, excludeCountries: ['Japan'] } }, + { element: this.adobeFirefly, conditions: { defaultVisibility: true, excludeCountries: ['Japan'] } }, + { element: this.adobeFireFlyTwo, conditions: { includeCountries: ['Japan'] } }, + { element: this.adobecom, conditions: { defaultVisibility: true } }, + { element: this.pdfAndESignature, conditions: { defaultVisibility: true } }, + { element: this.marketingAndCommerce, conditions: { defaultVisibility: true } }, + { element: this.helpAndSupport, conditions: { defaultVisibility: true } }, { element: this.acrobatPro, conditions: { includeCountries: ['Spain'] } }, { element: this.adobeExpressEs, conditions: { includeCountries: ['Spain'] } }, { element: this.adobeStockEs, conditions: { includeCountries: ['Spain'] } }, { element: this.benifitsForCC, conditions: { includeCountries: ['Japan'] } }, { element: this.corporateInquiries, conditions: { includeCountries: ['Japan'] } }, - { - element: this.goToSpecialOffers, - conditions: { - includeCountries: ['Spain', 'Turkey', 'Thailand English', 'Thailand', 'Philippines', - 'Philippines English'], - }, - }, + { element: this.goToSpecialOffers, conditions: { includeCountries: ['Spain'] } }, { element: this.governmentAgencies, conditions: { includeCountries: ['Japan'] } }, { element: this.seeAllProducts, conditions: { includeCountries: ['Spain'] } }, { element: this.threeDAndARUS, conditions: { includeCountries: ['United States'] } }, @@ -302,4 +275,148 @@ export default class CreativeCloudEnterpriseSanity { await expect(element).toBeVisible(); })); } + + // Mobile, iPad & Tab methods + + // U-Nav + async validatingUnav() { + const elements = [this.hamburgerMenu, this.adobe, this.appSwitcher, this.signInButton]; + await Promise.all(elements.map(async (element) => { + await expect(element).toBeVisible(); + })); + } + + // Creativity & Design + async validatingCreativityAndDesign(country) { + await this.hamburgerMenu.click(); + + const skipCountries = ['United Kingdom', 'India', 'Spain']; + const addCountries = ['United Kingdom', 'India', 'Spain']; + + if (!skipCountries.includes(country)) { + await this.creativityAndDesignElements(country); + } else if (addCountries.includes(country)) { + await this.quickActionsElements(country); + } + + await this.creativityAndDesign.click(); + } + + async creativityAndDesignElements(country) { + await this.creativityAndDesign.click(); + const elementsToCheck = [ + { element: this.whatIsCC, conditions: { defaultVisibility: true } }, + { element: this.photographers, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.studentsAndTeachers, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { + element: this.individuals, + conditions: { defaultVisibility: true, excludeCountries: ['Germany', 'France', 'Italy'] }, + }, + { element: this.business, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { + element: this.schoolsAndUniversities, + conditions: { defaultVisibility: true, excludeCountries: ['India', 'Spain'] }, + }, + { + element: this.viewPlansAndPricing, + conditions: { defaultVisibility: true, excludeCountries: ['India', 'Spain'] }, + }, + ]; + + await Promise.all(elementsToCheck.map(async ({ element, conditions }) => { + if (conditions.excludeCountries && conditions.excludeCountries.includes(country)) { + await expect(element).not.toBeVisible(); + } else if (conditions.defaultVisibility) { + await expect(element).toBeVisible(); + } + })); + } + + async quickActionsElements(country) { + await this.creativityAndDesign.click(); + await this.quickActions.click(); + const elementsToCheck = [ + { element: this.whatIsCC, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.photoshop, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.adobeExpress, conditions: { defaultVisibility: true, excludeCountries: ['India', 'Spain'] } }, + { element: this.lightroom, conditions: { defaultVisibility: true, excludeCountries: ['India', 'Spain'] } }, + { element: this.illustrator, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.premierePro, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.adobeStock, conditions: { defaultVisibility: true, excludeCountries: ['India'] } }, + { element: this.viewPlansAndPricing, conditions: { includeCountries: ['United Kingdom'] } }, + { element: this.acrobatPro, conditions: { includeCountries: ['Spain'] } }, + { element: this.adobeStockEs, conditions: { includeCountries: ['Spain'] } }, + { element: this.seeAllProducts, conditions: { includeCountries: ['Spain'] } }, + { element: this.removeBackground, conditions: { includeCountries: ['India'] } }, + { element: this.resizeImage, conditions: { includeCountries: ['India'] } }, + { element: this.covertImageToSVG, conditions: { includeCountries: ['India'] } }, + { element: this.covertVideoToGIF, conditions: { includeCountries: ['India'] } }, + { element: this.createQRCode, conditions: { includeCountries: ['India'] } }, + { element: this.seeAllQuickActions, conditions: { includeCountries: ['India'] } }, + ]; + + await Promise.all(elementsToCheck.map(async ({ element, conditions }) => { + if (conditions.includeCountries && conditions.includeCountries.includes(country)) { + await expect(element).toBeVisible(); + } else if (conditions.excludeCountries && conditions.excludeCountries.includes(country)) { + await expect(element).not.toBeVisible(); + } else if (conditions.defaultVisibility) { + await expect(element).toBeVisible(); + } + })); + } + + // Products + async validatingProduct() { + await this.products.click(); + await this.solutions.click(); + await expect(this.creativeCloudForTeamsPro).toBeVisible(); + await this.featuredProducts.click(); + await expect(this.photoshopPro).toBeVisible(); + await this.more.click(); + await expect(this.substanceThreeDPro).toBeVisible(); + await this.products.click(); + } + + // Resources + async validatingResources() { + await this.resources.click(); + await this.learn.click(); + await expect(this.resourceCenter).toBeVisible(); + await this.support.click(); + await expect(this.helpCenter).toBeVisible(); + await this.hamburgerMenu.click(); + } + + // Footer + async validatingFooter() { + await this.changeRegion.scrollIntoViewIfNeeded(); + + const elements = [this.changeRegion, this.facebookLogo, this.twitterlogo, + this.linkedinLogo, this.copyright, this.privacyPolicy, this.termsOfUse, this.cookies, + this.protectMyPersonalData, this.adChoices, this.instagramLogo]; + + await Promise.all(elements.map(async (element) => { + expect(element).toBeVisible(); + })); + + await this.shopForFooter.click(); + await expect(this.footerCreativeCloud).toBeVisible(); + await this.forBusinessFooter.click(); + await expect(this.footerCreativeCloudForBusiness).toBeVisible(); + await this.forEducationFooter.click(); + await expect(this.footerdiscountForStudentsAndTeachers).toBeVisible(); + await this.forMobileFooter.click(); + await expect(this.footerappsForiOS).toBeVisible(); + await this.experienceCloudFooter.click(); + await expect(this.footerWhatIsExperienceCloud).toBeVisible(); + await this.supportFooter.click(); + await expect(this.footerDownloadAndInstall).toBeVisible(); + await this.resourcesFooter.click(); + await expect(this.footerAdobeBlog).toBeVisible(); + await this.adobeAcrobatFooter.click(); + await expect(this.footerLoginToYourAccount).toBeVisible(); + await this.adobeFooter.click(); + await expect(this.footerAbout).toBeVisible(); + } } diff --git a/tests/feds/ccepagesanity.test.js b/tests/feds/ccepagesanity.test.js index 08c3ca37..85489503 100644 --- a/tests/feds/ccepagesanity.test.js +++ b/tests/feds/ccepagesanity.test.js @@ -1,15 +1,15 @@ -import { expect, test, beforeEach, afterEach } from '@playwright/test'; +import { expect, test } from '@playwright/test'; import { features } from '../../features/feds/prodSanity/ccepagesanity.spec.js'; import CreativeCloudEnterpriseSanity from '../../selectors/feds/feds.ccepagesanity.page.js'; test.describe('Test Suite for Creative Cloud Business Enterprise Page Components', () => { let enterprise; - beforeEach(async ({ page }) => { + test.beforeEach(async ({ page }) => { enterprise = new CreativeCloudEnterpriseSanity(page); }); - afterEach(async ({ page }) => { + test.afterEach(async ({ page }) => { await page.close(); }); diff --git a/tests/feds/mobileCCEPageSanity.test.js b/tests/feds/mobileCCEPageSanity.test.js new file mode 100644 index 00000000..a8df179c --- /dev/null +++ b/tests/feds/mobileCCEPageSanity.test.js @@ -0,0 +1,36 @@ +import { expect, test } from '@playwright/test'; +import { features } from '../../features/feds/prodSanity/mobileTesting/mobileCCEPageSanity.spec.js'; +import CreativeCloudEnterpriseSanity from '../../selectors/feds/feds.ccepagesanity.page.js'; + +test.describe('Test Suite for Creative Cloud Business Enterprise Page Components', () => { + let enterprise; + + test.beforeEach(async ({ page }) => { + enterprise = new CreativeCloudEnterpriseSanity(page); + }); + + test.afterEach(async ({ page }) => { + await page.close(); + }); + + features.forEach((props) => { + test(`${props.name}, ${props.tags}, ${props.country}`, async ({ page, baseURL }) => { + console.info(`[FEDSInfo] Checking Page: ${baseURL}${features[props.tcid].path}`); + + const pageURL = `${baseURL}${features[props.tcid].path}`; + await page.goto(pageURL, { waitUntil: 'networkidle' }); + await expect(page).toHaveURL(pageURL); + + // Verifying the visibility of U-NAV Elements + await enterprise.validatingUnav(); + // Verifying the visibility of Creativity & Design Elements + await enterprise.validatingCreativityAndDesign(props.country); + // Verifying the visibility of Product Elements + await enterprise.validatingProduct(); + // Verifying the visibility of Resource Elements + await enterprise.validatingResources(); + // Verifying the visibility of Footer Elements + await enterprise.validatingFooter(); + }); + }); +});