diff --git a/configs/dme.config.js b/configs/dme.config.js index 2ed055fe..dd6e9141 100644 --- a/configs/dme.config.js +++ b/configs/dme.config.js @@ -37,16 +37,21 @@ const config = { actionTimeout: 60000, trace: 'on-first-retry', - baseURL: process.env.PR_BRANCH_LIVE_URL_GH - && !process.env.PR_BRANCH_LIVE_URL_GH.includes('stage--dme-partners') - ? process.env.PR_BRANCH_LIVE_URL_GH : envs['@dme_stage'], +// baseURL: 'https://tijana-test--dme-partners--adobecom.hlx.live', + baseURL: process.env.PR_BRANCH_LIVE_URL_GH ? process.env.PR_BRANCH_LIVE_URL_GH : envs['@dme_stage'], }, /* Configure projects for major browsers */ projects: [ { name: 'dme-live-chromium', - use: { ...devices['Desktop Chrome'] }, + use: { + ...devices['Desktop Chrome'], + bypassCSP: true, + launchOptions: { + args: ['--disable-web-security', '--disable-gpu'], + }, + }, }, { diff --git a/configs/dx.config.js b/configs/dx.config.js index 98bebb47..e57db688 100644 --- a/configs/dx.config.js +++ b/configs/dx.config.js @@ -35,6 +35,8 @@ const config = { use: { /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ actionTimeout: 60000, + headless: true, + screenshot: 'only-on-failure', trace: 'on-first-retry', baseURL: process.env.PR_BRANCH_LIVE_URL_GH diff --git a/data/dc/sot-basic.yml b/data/dc/sot-basic.yml new file mode 100644 index 00000000..01e95e2d --- /dev/null +++ b/data/dc/sot-basic.yml @@ -0,0 +1,7 @@ +--- +'Homepage': 'https://www.stage.adobe.com/documentcloud.html' +'AcrobatPro': 'https://www.stage.adobe.com/acrobat/business/acrobat-pro.html' +'Pricing': 'https://www.stage.adobe.com/acrobat/pricing.html' +'PricingBusiness': 'https://www.stage.adobe.com/acrobat/pricing/business.html' +'Word2PDF': 'https://www.stage.adobe.com/acrobat/online/word-to-pdf.html' +'AIChatPDF': 'https://www.stage.adobe.com/acrobat/online/ai-chat-pdf.html' diff --git a/features/dme/announcements.spec.js b/features/dme/announcements.spec.js index f27046d4..c7c6c511 100644 --- a/features/dme/announcements.spec.js +++ b/features/dme/announcements.spec.js @@ -3,9 +3,337 @@ module.exports = { features: [ { tcid: '1', - name: '@desc-regression-announcements', + name: '@desc-regression-announcements-page-search', + path: '/channelpartners/drafts/automation/regression/announcements?akamaiLocale=na', + tags: '@dme-announcements @regression @anonymous @login', + data: { + numberOfPublicCards: 7, + numberOfMatchingDescCards: 6, + numberOfMatchingTitleCards: 1, + firstCardTitle: 'Automation regression announcements card worldwide no1', + secondCardTitle: 'Automation regression announcements card worldwide no2', + searchCards: 'Automation regression', + }, + }, + { + tcid: '2', + name: '@desc-regression-announcements-page-load-more-sort', + path: '/channelpartners/drafts/automation/regression/announcements?akamaiLocale=na', + tags: '@dme-announcements @regression @anonymous', + data: { + numberOfPublicCards: 7, + numberOfMatchingDescCards: 6, + searchCards: 'Automation regression', + firstLoadResult: '2 of 6 results', + secondLoadResult: '4 of 6 results', + thirdLoadResult: '6 of 6 results', + }, + }, + { + tcid: '3', + name: '@desc-regression-announcements-page-pagination', + path: '/channelpartners/drafts/automation/regression/announcements-paginated', + tags: '@dme-announcements @regression @anonymous', + data: { + numberOfPublicCards: 7, + numberOfMatchingDescCards: 6, + searchCards: 'Automation regression', + firstPageResult: '1 - 2 of 6 results', + secondPageResult: '3 - 4 of 6 results', + thirdPageResult: '5 - 6 of 6 results', + pageButtonNumber: 2, + totalPageCount: 3, + }, + }, + { + tcid: '4', + name: '@desc-regression-announcements-page-filters', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + numberOfPublicCards: 7, + filterDate: 'Date', + filterProduct: 'Product', + filterSales: 'Sales', + filterMarketing: 'Marketing', + filterSolutions: 'Solutions', + filterAdvertising: 'Advertising', + filterAudience: 'Audience', + filterPracticeLead: 'Practice Lead', + filterLastNinetyDays: 'Last 90 days', + cardsWithSalesAndPracticeLead: 2, + cardsWithAdvertisingAndSolutions: 2, + cardsWithAdvertising: 1, + cardsWithLastNinetyDays: 1, + cardsWithProduct: 2, + cardsWithSales: 1, + titleOfDateFilteredCard: 'Automation regression announcements card Worldwide no4', + numberOfAudienceFiltersSelected: 2, + }, + }, + { + tcid: '5', + name: '@desc-regression-announcements-page-read-article', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + searchCardTitle: 'Automation regression announcements card worldwide no1', + numberOfMatchingTitleCards: 1, + expectedToSeeInURL: '/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no1', + }, + }, + { + tcid: '6', + name: '@desc-announcements-page-edge-cases', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + numberOfPublicCards: 7, + specialCharsTitleSearch: '? ! | <> * !@#$%^&*()_+~`<>?\\’|”{}][ уљађз', + cardsWithSpecialChars: 1, + dateInPastTitleSearch: 'Automation regression announcements card worldwide date in past', + cardsWithDateInPast: 0, + eventEndedTitleSearch: 'Automation regression announcements card worldwide event ended', + cardsWithEventEnded: 0, + tooLongTitleSearch: 'Automation regression announcements card worldwide too long title', + cardsWithTooLongTitle: 1, + noCollectionTagTitleSearch: 'Automation regression announcements card worldwide without collection tag', + cardsWithoutCollectionTag: 0, + noTitleSearch: 'Without card title', + cardsWithoutTitle: 0, + }, + }, + { + tcid: '7', + name: '@desc-regression-announcements-distributor-north-america', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Distributor', + permissionRegion: 'North America', + announcementCardTitle: 'CPP Distributor North America Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '8', + name: '@desc-regression-announcements-distributor-japan', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Distributor', + permissionRegion: 'Japan', + announcementCardTitle: 'CPP Distributor Japan Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '9', + name: '@desc-regression-announcements-distributor-india', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Distributor', + permissionRegion: 'Asia Pacific', + announcementCardTitle: 'CPP Distributor India Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '10', + name: '@desc-regression-announcements-platinum-spain', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Platinum', + permissionRegion: 'Europe West', + announcementCardTitle: 'CPP Platinum Spain Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '11', + name: '@desc-regression-announcements-platinum-latin-america-na-based', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Platinum', + permissionRegion: 'Latin America NA based', + announcementCardTitle: 'CPP Platinum Latin America-North America based Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '12', + name: '@desc-regression-announcements-platinum-emea', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Platinum', + permissionRegion: 'EMEA', + announcementCardTitle: 'CPP Platinum EMEA Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '13', + name: '@desc-regression-announcements-gold-latin-america', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Gold', + permissionRegion: 'Latin America', + announcementCardTitle: 'CPP Gold Latin America Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '14', + name: '@desc-regression-announcements-gold-uk-europe-west', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Gold', + permissionRegion: 'United Kingdom%2CEurope West', + announcementCardTitle: 'CPP Gold UK, Europe West Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '15', + name: '@desc-regression-announcements-certified-europe-east', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Certified', + permissionRegion: 'Europe East', + announcementCardTitle: 'CPP Certified Europe East Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '16', + name: '@desc-regression-announcements-certified-pacific', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Certified', + permissionRegion: 'Pacific', + announcementCardTitle: 'CPP Certified Pacific Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '17', + name: '@desc-regression-announcements-registered-china', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Registered', + permissionRegion: 'China', + announcementCardTitle: 'CPP Registered China Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '18', + name: '@desc-regression-announcements-registered-middle-east-and-africa', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Registered', + permissionRegion: 'Middle East and Africa', + announcementCardTitle: 'CPP Registered Middle East & Africa Announcement', + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '19', + name: '@desc-regression-worldwide-cards-not-visible-for-logged-in-users', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Distributor', + permissionRegion: 'North America', + announcementCardTitle: 'Worldwide', + numberOfMatchingTitleCardsNonLoggedIn: 6, + numberOfMatchingTitleCardsLoggedIn: 0, + }, + }, + { + tcid: '20', + name: '@desc-regression-logged-in-platinum-user', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Platinum', + permissionRegion: 'Europe West', + platinumCardTitle: 'CPP Platinum Spain Announcement', + totalNumberOfCards: 4, + numberOfMatchingTitleCards: 1, + }, + }, + { + tcid: '21', + name: '@desc-regression-logged-in-gold-user', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Gold', + permissionRegion: 'Latin America', + higherPartnerLevelCardTitle: 'CPP Platinum Latin America Announcement', + partnerLevelCardTitle: 'CPP Gold Latin America Announcement', + totalNumberOfCards: 3, + numberOfHigherPartnerLevelCards: 0, + numberOfPartnerLevelCards: 1, + }, + }, + { + tcid: '22', + name: '@desc-regression-logged-in-certified-user', + path: '/channelpartners/drafts/automation/regression/announcements', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Certified', + permissionRegion: 'Europe East', + higherPartnerLevelCardTitle: 'CPP Gold Europe East Announcement', + partnerLevelCardTitle: 'CPP Certified Europe East Announcement', + totalNumberOfCards: 2, + numberOfHigherPartnerLevelCards: 0, + numberOfPartnerLevelCards: 1, + }, + }, + { + tcid: '23', + name: '@desc-regression-logged-in-registered-user', path: '/channelpartners/drafts/automation/regression/announcements', - tags: '@dme @regression', + tags: '@dme-announcements @regression @anonymous', + data: { + partnerPortal: 'CPP', + partnerLevel: 'Registered', + permissionRegion: 'China', + higherPartnerLevelCardTitle: 'CPP Certified China Announcement', + partnerLevelCardTitle: 'CPP Registered China Announcement', + totalNumberOfCards: 1, + numberOfHigherPartnerLevelCards: 0, + numberOfPartnerLevelCards: 1, + }, }, ], }; diff --git a/features/dme/announcments.json b/features/dme/announcments.json new file mode 100644 index 00000000..c56f1c32 --- /dev/null +++ b/features/dme/announcments.json @@ -0,0 +1,915 @@ +{ + "cards": [ + { + "id": "eaec91c2-daad-54a6-9689-653e9f6b0521", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide event ended", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide event ended", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-event-ended", + "description": "Description of the Automation regression announcements card Worldwide event ended card.", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + }, + { + "type": "date-interval", + "startTime": "2024-07-20T22:00:00.000Z", + "endTime": "2024-07-27T22:00:00.000Z" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-event-ended" + } + ] + } + ], + "search": {}, + "cardDate": "2024-07-06T22:00:00.000Z", + "createdDate": "2024-07-06T22:00:00.000Z", + "modifiedDate": "2024-07-31T11:04:54.000Z", + "startDate": "2024-07-20T22:00:00.000Z", + "endDate": "2024-07-27T22:00:00.000Z", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-event-ended", + "arbitrary": [], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-event-ended", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "01bd96eb-7b8c-521d-8c11-ad98b92a1a80", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide date in past", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide date in past", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-date-in-past", + "description": "Description of the Automation regression announcements card Worldwide date in past card.", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-date-in-past" + } + ] + } + ], + "search": {}, + "cardDate": "2023-06-30T22:00:00.000Z", + "createdDate": "2023-06-30T22:00:00.000Z", + "modifiedDate": "2024-07-31T11:01:47.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-date-in-past", + "arbitrary": [], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-date-in-past", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "2292c1ee-beec-563f-a1ab-5c6a58bf1f46", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card worldwide with special characters ? ! | <> * !@#$%^&*()_+~`<>?\\’|”{}][ уљађз", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card worldwide with special characters ? ! | <> * !@#$%^&*()_+~`<>?\\’|”{}][ уљађз", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-special-chars", + "description": "Description of Automation regression announcements card worldwide with special characters ? ! | <> * !@#$%^&*()_+~`<>?\\’|”{}][ уљађз card.", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-special-chars" + } + ] + } + ], + "search": {}, + "cardDate": "2034-07-05T22:00:00.000Z", + "createdDate": "2034-07-05T22:00:00.000Z", + "modifiedDate": "2024-07-31T10:41:49.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-special-chars", + "arbitrary": [], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-special-chars", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "b73dc35a-c6a6-55e2-9eaf-063436fb6559", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "card-metadata", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no-title", + "description": "", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no-title" + } + ] + } + ], + "search": {}, + "cardDate": "2035-06-30T22:00:00.000Z", + "createdDate": "2035-06-30T22:00:00.000Z", + "modifiedDate": "2024-07-31T10:30:21.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no-title", + "arbitrary": [], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no-title", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "baf50c09-e329-5740-af9c-998af542c7bb", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title too long title", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-too-long-title", + "description": "Description of the Automation regression announcements card Worldwide too long title too long title too long title too long title too long title too long title too long title too…", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-too-long-title" + } + ] + } + ], + "search": {}, + "cardDate": "2034-07-04T22:00:00.000Z", + "createdDate": "2034-07-04T22:00:00.000Z", + "modifiedDate": "2024-07-31T10:34:34.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-too-long-title", + "arbitrary": [], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-too-long-title", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "390dab54-c852-5ae9-825c-55d6c36a95b6", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide no1", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide no1", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no1", + "description": "Description of the Automation regression announcements card Worldwide no1 card.", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no1" + } + ] + } + ], + "search": { + "key": "audience" + }, + "cardDate": "2034-06-30T22:00:00.000Z", + "createdDate": "2034-06-30T22:00:00.000Z", + "modifiedDate": "2024-08-01T13:01:00.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no1", + "arbitrary": [ + { + "key": "marketing", + "value": "product" + }, + { + "key": "audience", + "value": "practice-lead" + } + ], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no1", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "22f68eb0-a9ce-5501-b4e2-7e9553b23c39", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide no4", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide no4", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no4", + "description": "Description of the Automation regression announcements card Worldwide no4 card.Created within LAST 90 DAYS.", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no4" + } + ] + } + ], + "search": { + "key": "audience" + }, + "cardDate": "2024-07-31T22:00:00.000Z", + "createdDate": "2024-07-31T22:00:00.000Z", + "modifiedDate": "2024-08-01T13:04:06.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no4", + "arbitrary": [ + { + "key": "marketing", + "value": "solutions" + }, + { + "key": "audience", + "value": "technical" + } + ], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no4", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "cd0cd83d-7bf0-5224-a7f3-fe5aeb257875", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide no2", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide no2", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no2", + "description": "Description of the Automation regression announcements card Worldwide no2 card.", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no2" + } + ] + } + ], + "search": { + "key": "audience" + }, + "cardDate": "2034-07-01T22:00:00.000Z", + "createdDate": "2034-07-01T22:00:00.000Z", + "modifiedDate": "2024-08-01T13:02:10.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no2", + "arbitrary": [ + { + "key": "marketing", + "value": "product" + }, + { + "key": "audience", + "value": "sales" + } + ], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no2", + "lang": "en", + "country": "us", + "origin": "dme-partners" + }, + { + "id": "bdcc0558-3ddd-5d94-b4da-495de622ca30", + "showCard": { + "from": "", + "until": "" + }, + "styles": { + "typeOverride": "default", + "backgroundImage": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/media_17e7090b334966ec40f5d3a198638e2b7eb6d6b91.jpeg", + "backgroundAltText": "Automation regression announcements card Worldwide no3", + "mnemonic": "", + "icon": "", + "iconAlt": "" + }, + "overlays": { + "banner": { + "backgroundColor": "#EAEAEA", + "fontColor": "#323232", + "description": "", + "icon": "" + }, + "logo": { + "src": "" + }, + "label": { + "description": "" + }, + "videoButton": { + "url": "" + } + }, + "tags": [ + { + "id": "caas:adobe-partners/qa-content" + }, + { + "id": "caas:adobe-partners/cpp/partner-level/public" + }, + { + "id": "caas:adobe-partners/cpp" + }, + { + "id": "caas:adobe-partners/collections/announcements" + }, + { + "id": "caas:adobe-partners/cpp/region/worldwide" + } + ], + "contentArea": { + "detailText": "", + "title": "Automation regression announcements card Worldwide no3", + "url": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no3", + "description": "\n Description of the Automation regression announcements card Worldwide no3 card. Description of the Automation regression announcements card Worldwide no3 card.\n …", + "dateDetailText": { + "type": "date-interval", + "startTime": "", + "endTime": "" + } + }, + "footer": [ + { + "divider": false, + "left": [ + { + "type": "bookmark", + "saveCardIcon": "", + "unsaveCardIcon": "", + "cardSaveText": "", + "unsaveCardText": "" + } + ], + "center": [], + "right": [ + { + "type": "button", + "style": "", + "text": "Read now", + "href": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no3" + } + ] + } + ], + "search": { + "key": "audience" + }, + "cardDate": "2034-07-02T22:00:00.000Z", + "createdDate": "2034-07-02T22:00:00.000Z", + "modifiedDate": "2024-08-01T13:03:15.000Z", + "startDate": "", + "endDate": "", + "ctaLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no3", + "arbitrary": [ + { + "key": "marketing", + "value": "advertising-cloud" + }, + { + "key": "audience", + "value": "technical" + } + ], + "overlayLink": "https://main--dme-partners--adobecom.hlx.live/channelpartners/drafts/automation/regression/Cards/cpp-worldwide-no3", + "lang": "en", + "country": "us", + "origin": "dme-partners" + } + ], + "filters": [], + "debug": [ + { + "missingIds": [] + } + ], + "isHashed": false +} diff --git a/features/dx/news.spec.js b/features/dx/news.spec.js index db50ee7b..19f57d03 100644 --- a/features/dx/news.spec.js +++ b/features/dx/news.spec.js @@ -5,12 +5,28 @@ module.exports = { tcid: '1', name: '@desc-regression-news-page-search', path: '/solutionpartners/drafts/automation/regression/partner-news', + data: { + publicCard1: 'Automation regression news card SPP Public no1', + publicCard2: 'Automation regression news card SPP Public no2', + cardDescription: 'This is automation', + numberOfPublicCards: 9, + numberOfMatchingDescCards: 7, + numberOfMatchingTitleCards: 1, + }, tags: '@dx-news @regression @anonymous', }, { tcid: '2', name: '@desc-regression-news-page-pagination-sort', path: '/solutionpartners/drafts/automation/regression/partner-news', + data: { + cardTitle: 'Automation regression news card SPP', + firstLoadResult: '3 of 8 results', + secondLoadResult: '6 of 8 results', + thirdLoadResult: '8 of 8 results', + numberOfCardsWithTitle: 8, + numberOfPublicCards: 9, + }, tags: '@dx-news @regression @anonymous', }, { @@ -18,79 +34,145 @@ module.exports = { name: '@desc-regression-news-page-filters', path: '/solutionpartners/drafts/automation/regression/partner-news', tags: '@dx-news @regression @anonymous', + data: { + filterApplication: 'Applications', + filterCampaign: 'Campaign', + filterAnalytics: 'Analytics', + filterAudience: 'Audience', + filterTechnical: 'Technical', + filterRegion: 'Region', + filterAmericas: 'Americas', + filterJapan: 'Japan', + filterTopic: 'Topic', + filterSolutions: 'Solutions', + numberOfPublicCards: 9, + cardsWithCampaign: 1, + cardsWithCampaignAndAnalytics: 2, + cardsWithTechnical: 1, + cardsWithAmericasAndJapan: 3, + cardsWithJapan: 1, + cardsWithSolutions: 1, + }, }, { tcid: '4', name: '@desc-regression-news-page-read-article', path: '/solutionpartners/drafts/automation/regression/partner-news', + data: { + cardTitle: 'Automation regression news card SPP Public no1', + expectedToSeeInURL: '/solutionpartners/drafts/automation/regression/caas-cards/automation-regression-card-no1', + cardsWithTitle: 1, + }, tags: '@dx-news @regression @anonymous', }, { tcid: '5', name: '@desc-news-page-edge-cases', path: '/solutionpartners/drafts/automation/regression/partner-news', + data: { + dateInPast: 'Automation regression news card SPP with a date in the past', + publicCard6: 'Automation regression news card SPP Public card no6', + cardWithoutNewsCollection: 'Automation regression news card SPP Public without news collection tag', + cardWithoutTitle: 'Without card title', + cardWithSpecialChars: '? ! | <> * !@#$%^&*()_+~`<>?\\’|”{}][ уљађз', + numberOfPublicCards: 9, + noCards: 0, + oneCard: 1, + }, tags: '@dx-news @regression @anonymous', }, { tcid: '6', name: '@login-news-page-platinum-user', - path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', - tags: '@dx-news @regression @login @nopr', + path: '/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-news @regression @anonymous', + data: { + platinumCard: 'Automation regression news card spp platinum no1', + partnerLevel: 'Platinum', + partnerPortal: 'SPP', + expectedToSeeInURL: '/solutionpartners/drafts/' + + 'automation/regression/caas-cards/automation-regression-platinum-card-no1', + numberOfPublicCards: 9, + noCards: 0, + numberOfAllCards: 14, + numberOfPlatinumCards: 1, + }, }, { tcid: '7', name: '@login-news-page-gold-user', - path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', - tags: '@dx-news @regression @login @nopr', + path: '/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-news @regression @anonymous', data: { - partnerLevel: 'spp-gold:', + partnerLevel: 'Gold', + partnerPortal: 'SPP', resultTotal: 13, cardPartnerLevel: 'Automation regression news card SPP Gold no1', cardLevelAbove: 'Automation regression news card spp platinum no1', + numberOfPublicCards: 9, + partnerLevelCard: 1, + noCards: 0, }, }, { tcid: '8', name: '@login-news-page-silver-user', - path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', - tags: '@dx-news @regression @login @nopr', + path: '/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-news @regression @anonymous', data: { - partnerLevel: 'spp-silver:', + partnerLevel: 'Silver', + partnerPortal: 'SPP', resultTotal: 12, cardPartnerLevel: 'Automation regression news card SPP Silver no1', cardLevelAbove: 'Automation regression news card spp gold no1', + numberOfPublicCards: 9, + partnerLevelCard: 1, + noCards: 0, }, }, { tcid: '9', name: '@login-news-page-bronze-user', - path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', - tags: '@dx-news @regression @login @nopr', + path: '/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-news @regression @anonymous', data: { - partnerLevel: 'spp-bronze:', + partnerLevel: 'Bronze', + partnerPortal: 'SPP', resultTotal: 11, cardPartnerLevel: 'Automation regression news card SPP Bronze no1', cardLevelAbove: 'Automation regression news card spp silver no1', + numberOfPublicCards: 9, + partnerLevelCard: 1, + noCards: 0, }, }, { tcid: '10', name: '@login-news-page-community-user', - path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', - tags: '@dx-news @regression @login @nopr', + path: '/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-news @regression @anonymous', data: { - partnerLevel: 'spp-community:', + partnerLevel: 'Community', + partnerPortal: 'SPP', resultTotal: 10, cardPartnerLevel: 'Automation regression news card SPP Community no1', cardLevelAbove: 'Automation regression news card spp bronze no1', + numberOfPublicCards: 9, + partnerLevelCard: 1, + noCards: 0, }, }, { tcid: '11', name: '@login-news-page-non-member-of-spp-user', - path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', + path: '/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-news @regression @anonymous', baseURL: 'https://www.stage.adobe.com/partners.html', - tags: '@dx-news @regression @login @nopr', + data: { + partnerLevel: 'Platinum', + partnerPortal: 'TPP', + numberOfPublicCards: 9, + }, }, ], }; diff --git a/features/dx/signin.spec.js b/features/dx/signin.spec.js new file mode 100644 index 00000000..82ef593e --- /dev/null +++ b/features/dx/signin.spec.js @@ -0,0 +1,129 @@ +module.exports = { + FeatureName: 'DX Sign In Flow', + features: [ + { + tcid: '1', + name: '@login-redirect-to-protected-home', + testId: '@MWPW-140197', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-platinum:', + expectedProtectedURL: '/solutionpartners/drafts/automation/regression/protected-home', + expectedPublicURL: '/solutionpartners/drafts/automation/regression/public-page', + }, + }, + { + tcid: '2', + name: '@login-no-redirection-public-news', + testId: '@MWPW-140198 @MWPW-140201', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-gold:', + expectedToSeeInURL: '/solutionpartners/drafts/automation/regression/partner-news', + }, + }, + { + tcid: '3', + name: '@login-accessing-public-home-page-with-member-user-logged-in-to-adobe', + testId: '@MWPW-140202', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + baseURL: 'https://www.stage.adobe.com/partners.html', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-community:', + expectedProtectedURL: '/solutionpartners/drafts/automation/regression/protected-home', + }, + }, + { + tcid: '4', + name: '@login-accessing-restricted-home-page-with-member-user-logged-in-to-adobe', + testId: '@MWPW-140203', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + baseURL: 'https://www.stage.adobe.com/partners.html', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-platinum:', + expectedProtectedURL: '/solutionpartners/drafts/automation/regression/protected-home', + }, + }, + { + tcid: '5', + name: '@login-public-page-sign-in-with-non-member', + testId: '@MWPW-140207', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + newsPath: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'tpp-platinum:', + expectedToSeeInURL: '/solutionpartners/error/contact-not-found', + }, + }, + { + tcid: '6', + name: '@login-accessing-restricted-home-page-with-non-member-user-logged-in-to-adobe', + testId: '@MWPW-140202', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/protected-home', + baseURL: 'https://www.stage.adobe.com/partners.html', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'tpp-platinum:', + expectedToSeeInURL: '/solutionpartners/error/contact-not-found', + }, + }, + { + tcid: '7', + name: '@login-accessing-public-page-with-non-member-user-logged-in-to-adobe', + testId: '@MWPW-140212', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + baseURL: 'https://www.stage.adobe.com/partners.html', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'tpp-platinum:', + expectedToSeeInURL: '/solutionpartners/error/contact-not-found', + }, + }, + { + tcid: '8', + name: '@login-accessing-restricted-home-page-with-non-logged-in-user', + testId: '@MWPW-140213', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/protected-home', + tags: '@dx-signin @regression @login @nopr', + expectedToSeeInURL: 'https://auth-stg1.services.adobe.com/', + }, + { + tcid: '9', + name: '@login-with-submitted-in-review-spp-user', + testId: '@MWPW-140214', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-submitted-in-review:', + expectedLandingPageURL: 'https://partners.stage.adobe.com/solutionpartners/error/submitted-in-review', + }, + }, + { + tcid: '10', + name: '@login-with-deactivated-spp-user', + testId: '@MWPW-140224', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-deactivated:', + expectedLandingPageURL: 'https://partners.stage.adobe.com/solutionpartners/error/contact-inactive', + }, + }, + { + tcid: '11', + name: '@login-with-expired-spp-user', + testId: 'MWPW-140215', + path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/public-page', + tags: '@dx-signin @regression @login @nopr', + data: { + partnerLevel: 'spp-expired:', + expectedLandingPageURL: 'https://partners.stage.adobe.com/solutionpartners/error/account-expired', + }, + }, + ], +}; diff --git a/features/milo/accordion.block.spec.js b/features/milo/accordion.block.spec.js index bb08e709..3277894f 100644 --- a/features/milo/accordion.block.spec.js +++ b/features/milo/accordion.block.spec.js @@ -37,5 +37,19 @@ module.exports = { }, tags: '@accordion @accordion-quiet-max @smoke @regression @milo', }, + { + tcid: '3', + name: '@Accordion (seo editorial)', + path: '/drafts/nala/blocks/accordion/accordion-seo-editorial', + data: { + headers: 3, + heading0: 'How do I compress a PDF without losing quality?', + heading1: 'What size PDFs can I compress?', + heading2: 'How do I check my PDF file size?', + outlineButtonText: 'Lorem ipsum', + blueButtonText: 'Learn more', + }, + tags: '@accordion @accordion-seo-editorial @smoke @regression @milo', + }, ], }; diff --git a/features/visual/dc/sot.spec.js b/features/visual/dc/sot.spec.js new file mode 100644 index 00000000..8474c174 --- /dev/null +++ b/features/visual/dc/sot.spec.js @@ -0,0 +1,13 @@ +module.exports = { + name: 'DC SOT Visual Comparison', + features: [ + { + tcid: '0', + name: '@dc-visual', + stable: '@adobe_prod', + beta: '@adobe_stage', + tags: '@dc-visual @visual @dc-screenshots', + data: 'data/dc/sot-basic.yml', + }, + ], +}; diff --git a/selectors/dme/announcements.page.js b/selectors/dme/announcements.page.js index d3707181..12817c85 100644 --- a/selectors/dme/announcements.page.js +++ b/selectors/dme/announcements.page.js @@ -1,5 +1,47 @@ export default class AnnouncementsPage { constructor(page) { this.page = page; + this.signInButton = page.locator('button[daa-ll="Sign In"].feds-signIn'); + this.resultNumber = page.locator('.partner-cards-cards-results').nth(0); + this.searchField = page.locator('.input'); + this.clearSearchSelector = page.locator('[aria-label="Reset"]'); + this.clearAllSelector = page.locator('[aria-label="Clear all"]'); + this.firstCardTitle = page.locator('.card-title').nth(0); + this.firstCardDate = page.locator('.card-date').nth(0); + this.lastCardDate = page.locator('.card-date').nth(5); + this.sortBtn = page.locator('.sort-btn'); + this.oldestOption = page.getByRole('button', { name: 'oldest' }); + this.paginationText = page.locator('.pagination-total-results'); + this.loadMore = page.locator('[aria-label="Load more"]'); + this.cardCount = page.locator('.card-wrapper'); + this.pageCount = page.locator('.page-btn'); + this.readCard = page.locator('.card-btn'); + this.paginationPrevButton = page.locator('button.pagination-prev-btn'); + this.paginationNextButton = page.locator('button.pagination-next-btn'); + this.pageNumButton = page.locator('button.page-btn'); + } + + async clickPageNumButton(pageNum) { + await this.page.locator(`button[aria-label="Page ${pageNum}"]`).click(); + } + + async expandFilterOptions(filterSection) { + await this.page.locator(`[aria-label="${filterSection}"]`).click(); + } + + async clickFilterOptions(filterOption) { + await this.page.locator(`sp-checkbox:text-is("${filterOption}")`).click(); + } + + async clickDateFilterOptions(dateFilterOption) { + await this.page.locator(`button[aria-label="${dateFilterOption}"]`).click(); + } + + async clearSideBarFilterButton(filterButton) { + await this.page.locator(`[aria-label="${filterButton}"]`).click(); + } + + async clearFilter(filter, number) { + await this.page.locator(`[aria-label="${filter}"] + [aria-label="${number}"]`).click(); } } diff --git a/selectors/dme/signin.page.js b/selectors/dme/signin.page.js index f92b5ef7..384df3c2 100644 --- a/selectors/dme/signin.page.js +++ b/selectors/dme/signin.page.js @@ -39,4 +39,14 @@ export default class SignInPage { await expect(pages[1].url()) .toContain(`${expectedToSeeInURL}`); } + + async addCookie(partnerPortal, partnerLevel, permissionRegion, page, context) { + this.context = context; + await this.context.addCookies([{ + name: 'partner_data', + value: `{"${partnerPortal}":{"company":"Company"%2C"firstName":"Name"%2C"lastName":"LastName"%2C"level":` + + `"${partnerLevel}"%2C"permissionRegion":"${permissionRegion}"%2C"status":"MEMBER"}}`, + url: `${page}`, + }]); + } } diff --git a/selectors/dx/news.page.js b/selectors/dx/news.page.js index 3717ca5d..8414f408 100644 --- a/selectors/dx/news.page.js +++ b/selectors/dx/news.page.js @@ -15,10 +15,6 @@ export default class NewsPage { this.lastCardDate = page.locator('.card-date').nth(5); this.signInButton = page.locator('button[daa-ll="Sign In"].feds-signIn'); - this.emailField = page.locator('#EmailPage-EmailField'); - this.emailPageContinueButton = page.locator('//button[@data-id="EmailPage-ContinueButton"]'); - this.passwordField = page.locator('#PasswordPage-PasswordField'); - this.passwordPageContinueButton = page.locator('//button[@data-id="PasswordPage-ContinueButton"]'); this.profileIconButton = page.locator('.feds-profile-button'); this.profileName = page.locator('.feds-profile-name'); this.logoutButton = page.locator('[daa-ll="Sign Out"]'); @@ -42,12 +38,4 @@ export default class NewsPage { async clearFilter(filter, number) { await this.page.locator(`[aria-label="${filter}"] + [aria-label="${number}"]`).click(); } - - async signIn(partnerLevel) { - const email = process.env.IMS_EMAIL.split(partnerLevel)[1].split(';')[0]; - await this.emailField.fill(email); - await this.emailPageContinueButton.click(); - await this.passwordField.fill(process.env.IMS_PASS); - await this.passwordPageContinueButton.click(); - } } diff --git a/selectors/dx/signin.page.js b/selectors/dx/signin.page.js new file mode 100644 index 00000000..29810174 --- /dev/null +++ b/selectors/dx/signin.page.js @@ -0,0 +1,49 @@ +export default class SignInPage { + constructor(page) { + this.page = page; + this.signInButton = page.locator('button[daa-ll="Sign In"].feds-signIn'); + this.signInButtonStageAdobe = page.locator('.profile-comp.secondary-button'); + this.profileIconButton = page.locator('.feds-profile-button'); + this.joinNowButton = page.locator('a:has-text("Join now")'); + this.explorePastArticles = page.locator('a:has-text("Explore past articles")'); + this.newsletterLink = page.locator('a:has-text("product newsletter")'); + this.logoutButton = page.locator('[daa-ll="Sign Out"]'); + this.userNameDisplay = page.locator('.user-name'); + + this.IMSEmailPage = page.locator('form#EmailForm'); + this.emailField = page.locator('#EmailPage-EmailField'); + this.emailPageContinueButton = page.locator('//button[@data-id="EmailPage-ContinueButton"]'); + this.IMSPasswordPage = page.locator('form#PasswordForm'); + this.passwordField = page.locator('#PasswordPage-PasswordField'); + this.passwordPageContinueButton = page.locator('//button[@data-id="PasswordPage-ContinueButton"]'); + } + + async signIn(page, partnerLevel) { + const email = process.env.IMS_EMAIL.split(partnerLevel)[1].split(';')[0]; + await page.waitForLoadState('domcontentloaded'); + await this.emailField.fill(email); + await this.emailPageContinueButton.click(); + await this.passwordField.fill(process.env.IMS_PASS); + await this.passwordPageContinueButton.click(); + } + + async verifyLandingPageAfterLogin({ page, expect, path, partnerLevel, expectedLandingPageURL }) { + await page.goto(path); + await page.waitForLoadState('domcontentloaded'); + await this.signInButton.click(); + await this.signIn(page, partnerLevel); + await this.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()).toContain(expectedLandingPageURL); + } + + async addCookie(partnerPortal, partnerLevel, page, context) { + this.context = context; + await this.context.addCookies([{ + name: 'partner_data', + value: `{"${partnerPortal}":{"company":"Company"%2C"firstName":"Name"%2C"lastName"` + + `:"LastName"%2C"level":"${partnerLevel}"%2C"status":"MEMBER"}}`, + url: page, + }]); + } +} diff --git a/selectors/milo/accordion.block.page.js b/selectors/milo/accordion.block.page.js index 1fb31129..0ef5142b 100644 --- a/selectors/milo/accordion.block.page.js +++ b/selectors/milo/accordion.block.page.js @@ -1,5 +1,5 @@ export default class Accordion { - constructor(page, nth=0) { + constructor(page, nth = 0) { this.page = page; // accordion locators @@ -8,29 +8,20 @@ export default class Accordion { this.accordionHeaders = this.accordion.locator('dt[role=heading]'); this.accordionButtons = this.accordion.locator('dt button'); this.accordionButtonIcons = this.accordion.locator('.accordion-icon'); + this.outlineButton = this.accordion.locator('.con-button.outline').nth(nth); + this.blueButton = this.accordion.locator('.con-button.blue').nth(nth); + this.textLink = this.accordion.locator('//a[contains(text(), "Text link")]').nth(nth); // accordion blocks attributes this.attributes = { - 'accordion-container': { - 'class': 'accordion-container con-block max-width-10-desktop', + 'accordion-container': { class: 'accordion-container con-block max-width-10-desktop' }, + 'accordion-container.seo': { class: 'accordion-container seo con-block max-width-10-desktop' }, + 'accordion-container-quiet-large': { class: 'accordion-container quiet max-width-12-desktop-large con-block' }, + analytics: { + 'accordion.daa-lh': { 'daa-lh': /b[1-9]|accordion-container|default|default/ }, + 'section.daa-lh': { 'daa-lh': /s[1-9]/ }, + 'content.daa-lh': { 'daa-lh': /b[1-9]|content|default|default/ }, }, - 'accordion-container.seo': { - 'class': 'accordion-container seo con-block max-width-10-desktop', - }, - 'accordion-container-quiet-large': { - 'class': 'accordion-container quiet max-width-12-desktop-large con-block', - }, - 'analytics': { - 'accordion.daa-lh': { - 'daa-lh': /b[1-9]|accordion-container|default|default/, - }, - 'section.daa-lh': { - 'daa-lh': /s[1-9]/, - }, - 'content.daa-lh': { - 'daa-lh': /b[1-9]|content|default|default/, - }, - }, - } + }; } } diff --git a/tests/dme/announcements.test.js b/tests/dme/announcements.test.js index b996e7fe..a99996ac 100644 --- a/tests/dme/announcements.test.js +++ b/tests/dme/announcements.test.js @@ -1,15 +1,401 @@ import { test, expect } from '@playwright/test'; +import AnnouncementsPage from '../../selectors/dme/announcements.page.js'; +import SignInPage from '../../selectors/dme/signin.page.js'; +let announcementsPage; +let singInPage; const Announcements = require('../../features/dme/announcements.spec.js'); const { features } = Announcements; +const regionCases = features.slice(6, 18); +const partnerLevelCases = features.slice(20, 23); + +const chimeraApi = '**/chimera-api/collection?**'; test.describe('Validate announcements block', () => { + test.beforeEach(async ({ page }) => { + announcementsPage = new AnnouncementsPage(page); + singInPage = new SignInPage(page); + }); + test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + const { data } = features[0]; await test.step('Go to Announcements page', async () => { - await page.goto(`${baseURL}${features[0].path}`); - await expect(page.url()) - .toContain('/channelpartners/drafts/automation/regression/announcements'); + page.on('console', msg => console.log(msg.text())); + console.log('before', new Date(), baseURL); + await page.goto(`${baseURL}${features[0].path}`); + console.log('after', new Date()); + + await page.evaluate(() => { + console.log('second', new Date()); + if (document.querySelector('.card-title')) { + window.cardsLoaded = true; + } else { + document.addEventListener('partner-cards-loaded', () => { + window.cardsLoaded = true; + console.log('third'); + }); + } + + }); + try { + await page.waitForFunction(() => { + return window.cardsLoaded; + }); + } catch { + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + console.log('catch block', result); + } + + +// await page.route(chimeraApi, async route => { +// const json = require('../../features/dme/announcments.json'); +// await route.fulfill({ json }); +// }); +// await page.goto(`${baseURL}${features[0].path}`); + + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + + }); + + await test.step('Enter Automation regression announcements card worldwide no1 in search field', async () => { + await announcementsPage.searchField.fill(data.firstCardTitle); + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCards); + }); + + await test.step('Clear search field on X', async () => { + await announcementsPage.clearSearchSelector.click(); + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + }); + + await test.step('Enter Automation regression announcements card worldwide no2 in search field', async () => { + await announcementsPage.searchField.fill(data.secondCardTitle); + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCards); + }); + + await test.step('Clear all', async () => { + await announcementsPage.clearAllSelector.click(); + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + }); + + await test.step('Enter Automation regression in search field', async () => { + await announcementsPage.searchField.fill(data.searchCards); + const result = await announcementsPage.resultNumber.textContent(); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingDescCards); }); }); + +// test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { +// const { data } = features[1]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${features[1].path}`); +// await page.on('partner-cards-loaded', () => { +// const result = announcementsPage.resultNumber.textContent(); +// expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// }); +// +// await test.step('Select Oldest sort option', async () => { +// await announcementsPage.searchField.fill(data.searchCards); +// const result = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingDescCards); +// await announcementsPage.sortBtn.click(); +// await announcementsPage.oldestOption.click(); +// const paginationText = await announcementsPage.paginationText.textContent(); +// await expect(paginationText.toLowerCase()).toBe(data.firstLoadResult); +// }); +// +// await test.step('Load more cards', async () => { +// await announcementsPage.loadMore.click(); +// let paginationText = await announcementsPage.paginationText.textContent(); +// await expect(paginationText.toLowerCase()).toBe(data.secondLoadResult); +// await announcementsPage.loadMore.click(); +// paginationText = await announcementsPage.paginationText.textContent(); +// await expect(paginationText.toLowerCase()).toBe(data.thirdLoadResult); +// await expect(await announcementsPage.loadMore).not.toBeVisible(); +// const firstCardDate = new Date(await announcementsPage.firstCardDate.textContent()).getTime(); +// const lastCardDate = new Date(await announcementsPage.lastCardDate.textContent()).getTime(); +// await expect(firstCardDate).toBeLessThan(lastCardDate); +// await expect(await announcementsPage.cardCount.count()).toBe(data.numberOfMatchingDescCards); +// }); +// }); + +// test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { +// const { data } = features[2]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${features[2].path}`); +// await page.on('partner-cards-loaded', () => { +// const result = announcementsPage.resultNumber.textContent(); +// expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// await announcementsPage.searchField.fill(data.searchCards); +// const filteredCards = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(filteredCards.split(' ')[0], 10)).toBe(data.numberOfMatchingDescCards); +// }); +// +// await test.step('Verify pagination buttons', async () => { +// let paginationText = await announcementsPage.paginationText.textContent(); +// await expect(paginationText.toLowerCase()).toBe(data.firstPageResult); +// const paginationPrevButton = await announcementsPage.paginationPrevButton; +// await expect(paginationPrevButton).toHaveClass(/disabled/); +// const paginationNextButton = await announcementsPage.paginationNextButton; +// await expect(paginationNextButton).not.toHaveClass(/disabled/); +// await expect(await announcementsPage.pageCount.count()).toBe(data.totalPageCount); +// await announcementsPage.clickPageNumButton(data.pageButtonNumber); +// paginationText = await announcementsPage.paginationText.textContent(); +// await expect(paginationText.toLowerCase()).toBe(data.secondPageResult); +// await expect(paginationPrevButton).not.toHaveClass(/disabled/); +// await expect(paginationNextButton).not.toHaveClass(/disabled/); +// await paginationNextButton.click(); +// paginationText = await announcementsPage.paginationText.textContent(); +// await expect(paginationText.toLowerCase()).toBe(data.thirdPageResult); +// await expect(paginationPrevButton).not.toHaveClass(/disabled/); +// await expect(paginationNextButton).toHaveClass(/disabled/); +// }); +// }); +// +// test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { +// const { data } = features[3]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${features[3].path}`); +// await page.on('partner-cards-loaded', () => { +// const result = announcementsPage.resultNumber.textContent(); +// expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// }); +// +// await test.step('Test audience filter', async () => { +// await announcementsPage.expandFilterOptions(data.filterAudience); +// await announcementsPage.clickFilterOptions(data.filterSales); +// const resultAfterSalesFilterApplied = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterSalesFilterApplied.split(' ')[0], 10)).toBe(data.cardsWithSales); +// await announcementsPage.clickFilterOptions(data.filterPracticeLead); +// const resultAfterPracticeLeadFilterApplied = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterPracticeLeadFilterApplied.split(' ')[0], 10)).toBe(data.cardsWithSalesAndPracticeLead); +// await announcementsPage.clearFilter(data.filterAudience, data.numberOfAudienceFiltersSelected); +// const resultAfterClearingAudienceFilter = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterClearingAudienceFilter.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// +// await test.step('Test marketing filter', async () => { +// await announcementsPage.expandFilterOptions(data.filterMarketing); +// await announcementsPage.clickFilterOptions(data.filterAdvertising); +// await announcementsPage.clickFilterOptions(data.filterSolutions); +// const resultAfterMarketingFilter = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterMarketingFilter.split(' ')[0], 10)).toBe(data.cardsWithAdvertisingAndSolutions); +// await announcementsPage.clickFilterOptions(data.filterSolutions); +// const resultAfterClearingFilter = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterClearingFilter.split(' ')[0], 10)).toBe(data.cardsWithAdvertising); +// await announcementsPage.clearSideBarFilterButton(data.filterAdvertising); +// const resultAfterClearingAllFilters = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterClearingAllFilters.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// +// await test.step('Test different filter combinations', async () => { +// await announcementsPage.clickFilterOptions(data.filterProduct); +// const resultAfterProductFilter = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterProductFilter.split(' ')[0], 10)).toBe(data.cardsWithProduct); +// await announcementsPage.clickFilterOptions(data.filterSales); +// const resultAfterSalesFilters = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterSalesFilters.split(' ')[0], 10)).toBe(data.cardsWithSales); +// await announcementsPage.clearAllSelector.click(); +// const resultAfterClearingAllFilters = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterClearingAllFilters.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// +// await test.step('Test date filter', async () => { +// await announcementsPage.expandFilterOptions(data.filterDate); +// await announcementsPage.clickDateFilterOptions(data.filterLastNinetyDays); +// const resultAfterDateFilter = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultAfterDateFilter.split(' ')[0], 10)).toBe(data.cardsWithLastNinetyDays); +// const firstCardTitle = await announcementsPage.firstCardTitle.textContent(); +// await expect(firstCardTitle).toBe(data.titleOfDateFilteredCard); +// }); +// }); +// +// test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { +// const { data } = features[4]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${features[4].path}`); +// await page.on('partner-cards-loaded', () => { +// announcementsPage.searchField.fill(data.searchCardTitle); +// const resultAfterSearch = announcementsPage.resultNumber.textContent(); +// expect(parseInt(resultAfterSearch.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCards); +// console.log('sss', resultAfterSearch); +// }); +// }); +// +// await test.step('Read now', async () => { +// await announcementsPage.readCard.click(); +// const pages = await page.context().pages(); +// await expect(pages[0].url()) +// .toContain(data.expectedToSeeInURL); +// }); +// }); +// +// test(`${features[5].name},${features[5].tags}`, async ({ page, baseURL }) => { +// const { data } = features[5]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${features[5].path}`); +// await page.on('partner-cards-loaded', () => { +// const result = announcementsPage.resultNumber.textContent(); +// expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); +// }); +// }); +// +// await test.step('Edge cases search bar', async () => { +// await announcementsPage.searchField.fill(data.specialCharsTitleSearch); +// const resultSpecialCharsCard = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultSpecialCharsCard.split(' ')[0], 10)).toBe(data.cardsWithSpecialChars); +// await announcementsPage.searchField.fill(data.dateInPastTitleSearch); +// const resultDateInPastCard = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultDateInPastCard.split(' ')[0], 10)).toBe(data.cardsWithDateInPast); +// await announcementsPage.searchField.fill(data.eventEndedTitleSearch); +// const resultEventEndedCard = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultEventEndedCard.split(' ')[0], 10)).toBe(data.cardsWithEventEnded); +// await announcementsPage.searchField.fill(data.tooLongTitleSearch); +// const resultWorldwideLongTitleCard = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultWorldwideLongTitleCard.split(' ')[0], 10)).toBe(data.cardsWithTooLongTitle); +// await announcementsPage.searchField.fill(data.noCollectionTagTitleSearch); +// const resultWithoutCollectionTagCard = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultWithoutCollectionTagCard.split(' ')[0], 10)).toBe(data.cardsWithoutCollectionTag); +// await announcementsPage.clearAllSelector.click(); +// const firstCardTitle = await announcementsPage.firstCardTitle; +// await expect(firstCardTitle).toBeEmpty(); +// await announcementsPage.searchField.fill(data.noTitleSearch); +// const resultWithoutTitleCard = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultWithoutTitleCard.split(' ')[0], 10)).toBe(data.cardsWithoutTitle); +// }); +// }); +// +// regionCases.forEach((feature) => { +// test(`${feature.name},${feature.tags}`, async ({ page, context, baseURL }) => { +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${feature.path}`); +// await page.waitForLoadState('domcontentloaded'); +// }); +// +// await test.step('Sign in', async () => { +// await singInPage.addCookie( +// feature.data.partnerPortal, +// feature.data.partnerLevel, +// feature.data.permissionRegion, +// `${baseURL}${feature.path}`, +// context, +// ); +// await page.reload(); +// await page.on('partner-cards-loaded', () => {}); +// }); +// +// await test.step(`Verify card titled ${feature.data.announcementCardTitle} is present on page`, async () => { +// await announcementsPage.searchField.fill(`${feature.data.announcementCardTitle}`); +// await announcementsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 15000 }); +// const result = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(result.split(' ')[0], 10)).toBe(feature.data.numberOfMatchingTitleCards); +// }); +// }); +// }); +// +// test(`${features[18].name},${features[18].tags}`, async ({ page, context, baseURL }) => { +// const { data, path } = features[18]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${path}`); +// await page.waitForLoadState('domcontentloaded'); +// await page.on('partner-cards-loaded', () => {}); +// }); +// +// await test.step(`Verify card titled ${data.announcementCardTitle} is present on page`, async () => { +// await announcementsPage.searchField.fill(`${data.announcementCardTitle}`); +// await announcementsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); +// const result = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCardsNonLoggedIn); +// }); +// +// await test.step('Sign in', async () => { +// await singInPage.addCookie( +// data.partnerPortal, +// data.partnerLevel, +// data.permissionRegion, +// `${baseURL}${path}`, +// context, +// ); +// await page.reload(); +// await page.waitForLoadState('domcontentloaded'); +// }); +// +// await test.step(`Verify card titled ${data.announcementCardTitle} is not present on page after login`, async () => { +// await announcementsPage.searchField.fill(`${data.announcementCardTitle}`); +// const result = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCardsLoggedIn); +// }); +// }); +// +// test(`${features[19].name},${features[19].tags}`, async ({ page, context, baseURL }) => { +// const { data, path } = features[19]; +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${path}`); +// await page.waitForLoadState('domcontentloaded'); +// }); +// +// await test.step('Sign in', async () => { +// await singInPage.addCookie( +// data.partnerPortal, +// data.partnerLevel, +// data.permissionRegion, +// `${baseURL}${path}`, +// context, +// ); +// await page.reload(); +// await page.on('partner-cards-loaded', () => {}); +// }); +// +// await test.step(`Verify card titled ${data.platinumCardTitle} is present on page`, async () => { +// const resultTotal = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultTotal.split(' ')[0], 10)).toBe(data.totalNumberOfCards); +// await announcementsPage.searchField.fill(`${data.platinumCardTitle}`); +// const resultSearch = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultSearch.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCards); +// }); +// }); +// +// partnerLevelCases.forEach((feature) => { +// test(`${feature.name},${feature.tags}`, async ({ page, context, baseURL }) => { +// await test.step('Go to Announcements page', async () => { +// await page.goto(`${baseURL}${feature.path}`); +// await page.waitForLoadState('domcontentloaded'); +// }); +// +// await test.step('Sign in', async () => { +// await singInPage.addCookie( +// feature.data.partnerPortal, +// feature.data.partnerLevel, +// feature.data.permissionRegion, +// `${baseURL}${feature.path}`, +// context, +// ); +// await page.reload(); +// await page.on('partner-cards-loaded', () => {}); +// }); +// +// await test.step(`Verify card titled ${feature.data.partnerLevelCardTitle} is present on page`, async () => { +// const resultTotal = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultTotal.split(' ')[0], 10)).toBe(feature.data.totalNumberOfCards); +// await announcementsPage.searchField.fill(`${feature.data.partnerLevelCardTitle}`); +// const resultSearch = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultSearch.split(' ')[0], 10)).toBe(feature.data.numberOfPartnerLevelCards); +// }); +// +// await test.step(`Verify card titled ${feature.data.higherPartnerLevelCardTitle} is not present on page`, async () => { +// await announcementsPage.searchField.fill(`${feature.data.higherPartnerLevelCardTitle}`); +// const resultSearch = await announcementsPage.resultNumber.textContent(); +// await expect(parseInt(resultSearch.split(' ')[0], 10)).toBe(feature.data.numberOfHigherPartnerLevelCards); +// }); +// }); +// }); }); diff --git a/tests/dme/signin.test.js b/tests/dme/signin.test.js index 53871dc8..4f43cbeb 100644 --- a/tests/dme/signin.test.js +++ b/tests/dme/signin.test.js @@ -12,50 +12,96 @@ test.describe('MAPC sign in flow', () => { signInPage = new SignInPage(page); }); - test(`${features[0].name},${features[0].tags}`, async ({ page }) => { - await test.step('Go to the home page', async () => { - await page.goto(`${features[0].path}`); - await page.waitForLoadState('domcontentloaded'); - await signInPage.signInButton.click(); - }); - - await test.step('Sign in', async () => { - await signInPage.signIn(page, `${features[0].data.partnerLevel}`); - }); - - await test.step('Verify redirection to restricted home after successful login', async () => { - await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); - const pages = await page.context().pages(); - await expect(pages[0].url()).toContain(`${features[0].data.expectedProtectedHomeURL}`); - }); - - await test.step('Logout', async () => { - await signInPage.profileIconButton.click(); - await signInPage.logoutButton.click(); - }); - - await test.step('Verify redirection to public page after logout', async () => { - await signInPage.signInButton.waitFor({ state: 'visible', timeout: 10000 }); - const pages = await page.context().pages(); - await expect(pages[0].url()) - .toContain(`${features[0].data.expectedPublicPageURL}`); - }); - }); - - redirectionFeatures.forEach((feature) => { - test(`${feature.name},${feature.tags}`, async ({ page, context }) => { - const newTab = await context.newPage(); - const newTabPage = new SignInPage(newTab); - await signInPage.verifyRedirectAfterLogin({ - page, - expect, - newTab, - newTabPage, - baseURL: feature.baseURL, - partnerLevel: feature.data.partnerLevel, - path: feature.path, - expectedToSeeInURL: feature.data.expectedToSeeInURL, - }); - }); - }); +// test(`${features[0].name},${features[0].tags}`, async ({ page }) => { +// await test.step('Go to the home page', async () => { +// await page.goto(`${features[0].path}`); +// await page.waitForLoadState('domcontentloaded'); +// await signInPage.signInButton.click(); +// }); +// +// await test.step('Sign in', async () => { +// await signInPage.signIn(page, `${features[0].data.partnerLevel}`); +// }); +// +// await test.step('Verify redirection to restricted home after successful login', async () => { +// await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); +// const pages = await page.context().pages(); +// await expect(pages[0].url()).toContain(`${features[0].data.expectedProtectedHomeURL}`); +// }); +// +// await test.step('Logout', async () => { +// await signInPage.profileIconButton.click(); +// await signInPage.logoutButton.click(); +// }); +// +// await test.step('Verify redirection to public page after logout', async () => { +// await signInPage.signInButton.waitFor({ state: 'visible', timeout: 10000 }); +// const pages = await page.context().pages(); +// await expect(pages[0].url()) +// .toContain(`${features[0].data.expectedPublicPageURL}`); +// }); +// }); +// +// redirectionFeatures.forEach((feature) => { +// test(`${feature.name},${feature.tags}`, async ({ page, context }) => { +// const newTab = await context.newPage(); +// const newTabPage = new SignInPage(newTab); +// await signInPage.verifyRedirectAfterLogin({ +// page, +// expect, +// newTab, +// newTabPage, +// baseURL: feature.baseURL, +// partnerLevel: feature.data.partnerLevel, +// path: feature.path, +// expectedToSeeInURL: feature.data.expectedToSeeInURL, +// }); +// }); +// }); +// test(`${features[0].name},${features[0].tags}`, async ({ page }) => { +// await test.step('Go to the home page', async () => { +// await page.goto(`${features[0].path}`); +// await page.waitForLoadState('domcontentloaded'); +// await signInPage.signInButton.click(); +// }); +// +// await test.step('Sign in', async () => { +// await signInPage.signIn(page, `${features[0].data.partnerLevel}`); +// }); +// +// await test.step('Verify redirection to restricted home after successful login', async () => { +// await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); +// const pages = await page.context().pages(); +// await expect(pages[0].url()).toContain(`${features[0].data.expectedProtectedHomeURL}`); +// }); +// +// await test.step('Logout', async () => { +// await signInPage.profileIconButton.click(); +// await signInPage.logoutButton.click(); +// }); +// +// await test.step('Verify redirection to public page after logout', async () => { +// await signInPage.signInButton.waitFor({ state: 'visible', timeout: 10000 }); +// const pages = await page.context().pages(); +// await expect(pages[0].url()) +// .toContain(`${features[0].data.expectedPublicPageURL}`); +// }); +// }); +// +// redirectionFeatures.forEach((feature) => { +// test(`${feature.name},${feature.tags}`, async ({ page, context }) => { +// const newTab = await context.newPage(); +// const newTabPage = new SignInPage(newTab); +// await signInPage.verifyRedirectAfterLogin({ +// page, +// expect, +// newTab, +// newTabPage, +// baseURL: feature.baseURL, +// partnerLevel: feature.data.partnerLevel, +// path: feature.path, +// expectedToSeeInURL: feature.data.expectedToSeeInURL, +// }); +// }); +// }); }); diff --git a/tests/dx/news.test.js b/tests/dx/news.test.js index 24c035ae..8561c0eb 100644 --- a/tests/dx/news.test.js +++ b/tests/dx/news.test.js @@ -1,322 +1,321 @@ import { test, expect } from '@playwright/test'; import NewsPage from '../../selectors/dx/news.page.js'; +import SignInPage from '../../selectors/dx/signin.page.js'; let newsPage; +let signInPage; const News = require('../../features/dx/news.spec.js'); const { features } = News; +const chimeraApi = '**/chimera-api/collection?**'; test.describe('Validate news block', () => { test.beforeEach(async ({ page }) => { newsPage = new NewsPage(page); + signInPage = new SignInPage(page); }); - async function findCardsForPartnerLevel(page, path, cardPartnerLevel, partnerLevel, resultTotal, cardLevelAbove) { + async function findCardsForPartnerLevel(page, path, data, context) { await test.step('Click Sign In', async () => { await page.goto(path); - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); + await page.waitForResponse(chimeraApi); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); - await newsPage.searchField.fill(cardPartnerLevel); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + await newsPage.searchField.fill(data.cardPartnerLevel); const resultCardPartnerLevel = await newsPage.resultNumber.textContent(); await expect(parseInt(resultCardPartnerLevel.split(' ')[0], 10)).toBe(0); - await newsPage.signInButton.click(); - await page.waitForLoadState('domcontentloaded'); - }); - - await test.step('I load the news page', async () => { - await newsPage.signIn(partnerLevel); + await signInPage.addCookie(data.partnerPortal, data.partnerLevel, path, context); + await page.reload(); + await page.waitForResponse(chimeraApi); }); await test.step('Find automation regression cards for current partner level', async () => { - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); const resultAll = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAll.split(' ')[0], 10)).toBe(resultTotal); - await newsPage.searchField.fill(cardPartnerLevel); + await expect(parseInt(resultAll.split(' ')[0], 10)).toBe(data.resultTotal); + await newsPage.searchField.fill(data.cardPartnerLevel); const resultCardPartnerLevel = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultCardPartnerLevel.split(' ')[0], 10)).toBe(1); - await newsPage.searchField.fill(cardLevelAbove); + await expect(parseInt(resultCardPartnerLevel.split(' ')[0], 10)).toBe(data.partnerLevelCard); + await newsPage.searchField.fill(data.cardLevelAbove); const resultCardPartnerLevelAbove = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultCardPartnerLevelAbove.split(' ')[0], 10)).toBe(0); + await expect(parseInt(resultCardPartnerLevelAbove.split(' ')[0], 10)).toBe(data.noCards); }); } test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + const { data } = features[0]; await test.step('Go to News page', async () => { console.log('url: ', baseURL + features[0].path); await page.goto(`${baseURL}${features[0].path}`); - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); + await page.waitForResponse(chimeraApi); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); await test.step('Enter Automation regression news card SPP Public no1 in search field', async () => { - await newsPage.searchField.fill('Automation regression news card SPP Public no1'); + await newsPage.searchField.fill(data.publicCard1); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(1); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCards); }); await test.step('Clear search field on X', async () => { await newsPage.clearSearchSelector.click(); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); await test.step('Enter Automation regression news card SPP Public no2 in search field', async () => { - await newsPage.searchField.fill('Automation regression news card SPP Public no2'); + await newsPage.searchField.fill(data.publicCard2); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(1); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingTitleCards); }); await test.step('Clear all', async () => { await newsPage.clearAllSelector.click(); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); await test.step('Enter This is automation in search field', async () => { - await newsPage.searchField.fill('This is automation'); + await newsPage.searchField.fill(data.cardDescription); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(7); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfMatchingDescCards); }); }); test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { + const { data } = features[1]; await test.step('Go to News page', async () => { await page.goto(`${baseURL}${features[1].path}`); - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); + await page.waitForResponse(chimeraApi); + await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 20000 }); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); await test.step('Select Oldest sort option', async () => { - await newsPage.searchField.fill('Automation regression news card SPP'); + await newsPage.searchField.fill(data.cardTitle); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(8); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfCardsWithTitle); await newsPage.sortBtn.click(); await newsPage.oldestOption.click(); const paginationText = await newsPage.paginationText.textContent(); - await expect(paginationText.toLowerCase()).toBe('3 of 8 results'); + await expect(paginationText.toLowerCase()).toBe(data.firstLoadResult); }); await test.step('Load more cards', async () => { await newsPage.loadMore.click(); let paginationText = await newsPage.paginationText.textContent(); - await expect(paginationText.toLowerCase()).toBe('6 of 8 results'); + await expect(paginationText.toLowerCase()).toBe(data.secondLoadResult); await newsPage.loadMore.click(); paginationText = await newsPage.paginationText.textContent(); - await expect(paginationText.toLowerCase()).toBe('8 of 8 results'); + await expect(paginationText.toLowerCase()).toBe(data.thirdLoadResult); await expect(await newsPage.loadMore).not.toBeVisible(); const firstCardDate = new Date(await newsPage.firstCardDate.textContent()).getTime(); const lastCardDate = new Date(await newsPage.lastCardDate.textContent()).getTime(); await expect(firstCardDate).toBeLessThan(lastCardDate); - await expect(await newsPage.cardCount.count()).toBe(8); + await expect(await newsPage.cardCount.count()).toBe(data.numberOfCardsWithTitle); }); }); test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { + const { data } = features[2]; await test.step('Go to News page', async () => { await page.goto(`${baseURL}${features[2].path}`); - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 10000 }); + await page.waitForResponse(chimeraApi); + await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 20000 }); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); await test.step('Test applications filter', async () => { - await newsPage.expandFilterOptions('Applications'); - await newsPage.clickFilterOptions('Campaign'); + await newsPage.expandFilterOptions(data.filterApplication); + await newsPage.clickFilterOptions(data.filterCampaign); const resultAfterCampaignFilterApplied = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterCampaignFilterApplied.split(' ')[0], 10)).toBe(1); - await newsPage.clickFilterOptions('Analytics'); + await expect(parseInt(resultAfterCampaignFilterApplied.split(' ')[0], 10)).toBe(data.cardsWithCampaign); + await newsPage.clickFilterOptions(data.filterAnalytics); const resultAfterAnalyticsFilterApplied = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterAnalyticsFilterApplied.split(' ')[0], 10)).toBe(2); - await newsPage.clearFilter('Applications', '2'); + await expect(parseInt(resultAfterAnalyticsFilterApplied.split(' ')[0], 10)).toBe(data.cardsWithCampaignAndAnalytics); + await newsPage.clearFilter(data.filterApplication, '2'); const resultAfterClearingApplicationsFilter = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterClearingApplicationsFilter.split(' ')[0], 10)).toBe(9); - await newsPage.expandFilterOptions('Applications'); + await expect(parseInt(resultAfterClearingApplicationsFilter.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + await newsPage.expandFilterOptions(data.filterApplication); }); await test.step('Test audience filter', async () => { - await newsPage.expandFilterOptions('Audience'); - await newsPage.clickFilterOptions('Technical'); + await newsPage.expandFilterOptions(data.filterAudience); + await newsPage.clickFilterOptions(data.filterTechnical); const resultAfterTechnical = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterTechnical.split(' ')[0], 10)).toBe(1); - await newsPage.clearSideBarFilterButton('Technical'); + await expect(parseInt(resultAfterTechnical.split(' ')[0], 10)).toBe(data.cardsWithTechnical); + await newsPage.clearSideBarFilterButton(data.filterTechnical); const resultAfterClearingFilter = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterClearingFilter.split(' ')[0], 10)).toBe(9); - await newsPage.expandFilterOptions('Audience'); + await expect(parseInt(resultAfterClearingFilter.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + await newsPage.expandFilterOptions(data.filterAudience); }); await test.step('Test region filter', async () => { - await newsPage.expandFilterOptions('Region'); - await newsPage.clickFilterOptions('Americas'); - await newsPage.clickFilterOptions('Japan'); + await newsPage.expandFilterOptions(data.filterRegion); + await newsPage.clickFilterOptions(data.filterAmericas); + await newsPage.clickFilterOptions(data.filterJapan); const resultAfterRegionFilters = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterRegionFilters.split(' ')[0], 10)).toBe(3); - await newsPage.clickFilterOptions('Americas'); + await expect(parseInt(resultAfterRegionFilters.split(' ')[0], 10)).toBe(data.cardsWithAmericasAndJapan); + await newsPage.clickFilterOptions(data.filterAmericas); const resultAfterUncheckingAmericas = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterUncheckingAmericas.split(' ')[0], 10)).toBe(1); + await expect(parseInt(resultAfterUncheckingAmericas.split(' ')[0], 10)).toBe(data.cardsWithJapan); }); await test.step('Test topic filter', async () => { - await newsPage.expandFilterOptions('Topic'); - await newsPage.clickFilterOptions('Solutions'); + await newsPage.expandFilterOptions(data.filterTopic); + await newsPage.clickFilterOptions(data.filterSolutions); const resultAfterTopicFilter = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterTopicFilter.split(' ')[0], 10)).toBe(1); + await expect(parseInt(resultAfterTopicFilter.split(' ')[0], 10)).toBe(data.cardsWithSolutions); await newsPage.clearAllSelector.click(); const resultAfterClearingAllFilters = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterClearingAllFilters.split(' ')[0], 10)).toBe(9); + await expect(parseInt(resultAfterClearingAllFilters.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); }); test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { + const { data } = features[3]; await test.step('Go to News page', async () => { await page.goto(`${baseURL}${features[3].path}`); - await newsPage.searchField.fill('Automation regression news card SPP Public no1'); + await page.waitForLoadState('domcontentloaded'); + await newsPage.searchField.fill(data.cardTitle); + await newsPage.firstCardTitle.waitFor({ state: 'visible', timeout: 10000 }); const resultAfterSearch = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAfterSearch.split(' ')[0], 10)).toBe(1); + await expect(parseInt(resultAfterSearch.split(' ')[0], 10)).toBe(data.cardsWithTitle); }); await test.step('Read now', async () => { await newsPage.readCard.click(); const pages = await page.context().pages(); await expect(pages[0].url()) - .toContain('/solutionpartners/drafts/automation/regression/caas-cards/automation-regression-card-no1'); + .toContain(`${data.expectedToSeeInURL}`); }); }); test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { + const { data } = features[4]; await test.step('Go to News page', async () => { await page.goto(`${baseURL}${features[4].path}`); - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); + await page.waitForResponse(chimeraApi); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); await test.step('Edge cases search bar', async () => { - await newsPage.searchField.fill('Automation regression news card SPP with a date in the past'); + await newsPage.searchField.fill(data.dateInPast); const resultDateInPastCard = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultDateInPastCard.split(' ')[0], 10)).toBe(1); - await newsPage.searchField.fill('Automation regression news card SPP Public card no6'); + await expect(parseInt(resultDateInPastCard.split(' ')[0], 10)).toBe(data.oneCard); + await newsPage.searchField.fill(data.publicCard6); const resultSppPublicCardNo6 = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultSppPublicCardNo6.split(' ')[0], 10)).toBe(1); - await newsPage.searchField.fill('? ! | <> * !@#$%^&*()_+~`<>?\\’|”{}][ уљађз'); + await expect(parseInt(resultSppPublicCardNo6.split(' ')[0], 10)).toBe(data.oneCard); + await newsPage.searchField.fill(data.cardWithSpecialChars); const resultSpecialCharsCard = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultSpecialCharsCard.split(' ')[0], 10)).toBe(1); - await newsPage.searchField.fill('Automation regression news card SPP Public without news collection tag'); + await expect(parseInt(resultSpecialCharsCard.split(' ')[0], 10)).toBe(data.oneCard); + await newsPage.searchField.fill(data.cardWithoutNewsCollection); const resultWithoutNewsTagCard = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultWithoutNewsTagCard.split(' ')[0], 10)).toBe(0); + await expect(parseInt(resultWithoutNewsTagCard.split(' ')[0], 10)).toBe(data.noCards); await newsPage.clearAllSelector.click(); const firstCardTitle = await newsPage.firstCardTitle; await expect(firstCardTitle).toBeEmpty(); - await newsPage.searchField.fill('Without card title'); + await newsPage.searchField.fill(data.cardWithoutTitle); const resultWithoutTitleCard = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultWithoutTitleCard.split(' ')[0], 10)).toBe(0); + await expect(parseInt(resultWithoutTitleCard.split(' ')[0], 10)).toBe(data.noCards); }); }); - test(`${features[5].name},${features[5].tags}`, async ({ page }) => { + test(`${features[5].name},${features[5].tags}`, async ({ page, context, baseURL }) => { + const { data } = features[5]; await test.step('Click Sign In', async () => { - await page.goto(`${features[5].path}`); - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 10000 }); + await page.goto(`${baseURL}${features[5].path}`); + await page.waitForLoadState('domcontentloaded'); + await page.waitForResponse(chimeraApi); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(9); - await newsPage.searchField.fill('Automation regression news card spp platinum no1'); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPublicCards); + await newsPage.searchField.fill(data.platinumCard); const resultPlatinum = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultPlatinum.split(' ')[0], 10)).toBe(0); - await newsPage.signInButton.click(); - await page.waitForLoadState('domcontentloaded'); - }); + await expect(parseInt(resultPlatinum.split(' ')[0], 10)).toBe(data.noCards); + await signInPage.addCookie(data.partnerPortal, data.partnerLevel, baseURL + features[5].path, context); - await test.step('I load the news page', async () => { - await newsPage.signIn('spp-platinum:'); + await page.reload(); + await page.waitForLoadState('domcontentloaded'); + await page.waitForResponse(chimeraApi); }); await test.step('Find platinum automation regression cards', async () => { - await newsPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); const resultAll = await newsPage.resultNumber.textContent(); - await expect(parseInt(resultAll.split(' ')[0], 10)).toBe(14); - await newsPage.searchField.fill('Automation regression news card spp platinum no1'); + await expect(parseInt(resultAll.split(' ')[0], 10)).toBe(data.numberOfAllCards); + await newsPage.searchField.fill(data.platinumCard); const result = await newsPage.resultNumber.textContent(); - await expect(parseInt(result.split(' ')[0], 10)).toBe(1); + await expect(parseInt(result.split(' ')[0], 10)).toBe(data.numberOfPlatinumCards); }); await test.step('Read now', async () => { await newsPage.readCard.click(); const pages = await page.context().pages(); await expect(pages[0].url()) - .toContain('/solutionpartners/drafts/automation/regression/caas-cards/automation-regression-platinum-card-no1'); + .toContain(`${data.expectedToSeeInURL}`); }); }); - test(`${features[6].name},${features[6].tags}`, async ({ page }) => { + test(`${features[6].name},${features[6].tags}`, async ({ page, context, baseURL }) => { + const { data } = features[6]; await findCardsForPartnerLevel( page, - features[6].path, - features[6].data.cardPartnerLevel, - features[6].data.partnerLevel, - features[6].data.resultTotal, - features[6].data.cardLevelAbove, + baseURL + features[6].path, + data, + context, ); }); - test(`${features[7].name},${features[7].tags}`, async ({ page }) => { + test(`${features[7].name},${features[7].tags}`, async ({ page, context, baseURL }) => { + const { data } = features[7]; await findCardsForPartnerLevel( page, - features[7].path, - features[7].data.cardPartnerLevel, - features[7].data.partnerLevel, - features[7].data.resultTotal, - features[7].data.cardLevelAbove, + baseURL + features[7].path, + data, + context, ); }); - test(`${features[8].name},${features[8].tags}`, async ({ page }) => { + test(`${features[8].name},${features[8].tags}`, async ({ page, context, baseURL }) => { + const { data } = features[8]; await findCardsForPartnerLevel( page, - features[8].path, - features[8].data.cardPartnerLevel, - features[8].data.partnerLevel, - features[8].data.resultTotal, - features[8].data.cardLevelAbove, + baseURL + features[8].path, + data, + context, ); }); - test(`${features[9].name},${features[9].tags}`, async ({ page }) => { + test(`${features[9].name},${features[9].tags}`, async ({ page, context, baseURL }) => { + const { data } = features[9]; await test.step('Click Sign In', async () => { await findCardsForPartnerLevel( page, - features[9].path, - features[9].data.cardPartnerLevel, - features[9].data.partnerLevel, - features[9].data.resultTotal, - features[9].data.cardLevelAbove, + baseURL + features[9].path, + data, + context, ); }); }); - test(`${features[10].name},${features[10].tags}`, async ({ page, context }) => { + test(`${features[10].name},${features[10].tags}`, async ({ page, context, baseURL }) => { + const { data } = features[10]; await test.step('Go to stage.adobe.com', async () => { - const url = `${features[10].path}`; - await page.evaluate((navigationUrl) => { - window.location.href = navigationUrl; - }, url); - - await newsPage.signInButtonStageAdobe.click(); + await page.goto(`${baseURL}${features[10].path}`); + await signInPage.addCookie(data.partnerPortal, data.partnerLevel, baseURL + features[10].path, context); + await page.reload(); await page.waitForLoadState('domcontentloaded'); }); - await test.step('Sign in with non spp member', async () => { - await newsPage.signIn('tpp-platinum:'); - }); - await test.step(`Open ${features[10].path} in a new tab`, async () => { const newTab = await context.newPage(); await newTab.goto(`${features[10].path}`); const newTabPage = new NewsPage(newTab); - await newTabPage.firstCardDate.waitFor({ state: 'visible', timeout: 15000 }); + await newTab.waitForResponse(chimeraApi); const resultCards = await newTabPage.resultNumber.textContent(); - await expect(parseInt(resultCards.split(' ')[0], 10)).toBe(9); + await expect(parseInt(resultCards.split(' ')[0], 10)).toBe(data.numberOfPublicCards); }); }); }); diff --git a/tests/dx/signin.test.js b/tests/dx/signin.test.js new file mode 100644 index 00000000..585d888c --- /dev/null +++ b/tests/dx/signin.test.js @@ -0,0 +1,272 @@ +import { test, expect } from '@playwright/test'; +import SignInPage from '../../selectors/dx/signin.page.js'; + +let signInPage; +const signin = require('../../features/dx/signin.spec.js'); + +const { features } = signin; +const uniqueFeatures = features.slice(8, 11); + +test.describe('MAPP sign in flow', () => { + test.beforeEach(async ({ page }) => { + signInPage = new SignInPage(page); + }); + + test(`${features[0].name},${features[0].tags}`, async ({ page }) => { + await test.step('Go to public home page', async () => { + await page.goto(`${features[0].path}`); + await page.waitForLoadState('domcontentloaded'); + await signInPage.signInButton.click(); + }); + + await test.step('Sign in', async () => { + await signInPage.signIn(page, `${features[0].data.partnerLevel}`); + }); + + await test.step('Verify redirection to protected home page after successful login', async () => { + await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[0].data.expectedProtectedURL}`); + }); + + await test.step('Logout', async () => { + await signInPage.profileIconButton.click(); + await signInPage.logoutButton.click(); + }); + + await test.step('Verify redirection to public home page after logout', async () => { + await signInPage.signInButton.waitFor({ state: 'visible', timeout: 10000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[0].data.expectedPublicURL}`); + }); + }); + + test(`${features[1].name},${features[1].tags}`, async ({ page }) => { + await test.step('Go to public home page', async () => { + await page.goto(`${features[1].path}`); + await page.waitForLoadState('domcontentloaded'); + const joinNowButton = await signInPage.joinNowButton; + await expect(joinNowButton).toBeVisible(); + const explorePastArticlesButton = await signInPage.explorePastArticles; + await expect(explorePastArticlesButton).toBeVisible(); + const newsletterLink = await signInPage.newsletterLink; + await expect(newsletterLink).toBeHidden(); + await signInPage.signInButton.click(); + }); + + await test.step('Sign in', async () => { + await signInPage.signIn(page, `${features[1].data.partnerLevel}`); + }); + + await test.step('Verify restricted news after successful login', async () => { + await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[1].data.expectedToSeeInURL}`); + const joinNowButton = await signInPage.joinNowButton; + await expect(joinNowButton).toBeHidden(); + const explorePastArticlesButton = await signInPage.explorePastArticles; + await expect(explorePastArticlesButton).toBeVisible(); + const newsletterLink = await signInPage.newsletterLink; + await expect(newsletterLink).toBeVisible(); + }); + + await test.step('Logout', async () => { + await signInPage.profileIconButton.click(); + await signInPage.logoutButton.click(); + }); + + await test.step('Verify public news page after logout', async () => { + await signInPage.signInButton.waitFor({ state: 'visible', timeout: 10000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[1].data.expectedToSeeInURL}`); + const joinNowButton = await signInPage.joinNowButton; + await expect(joinNowButton).toBeVisible(); + const explorePastArticlesButton = await signInPage.explorePastArticles; + await expect(explorePastArticlesButton).toBeVisible(); + const newsletterLink = await signInPage.newsletterLink; + await expect(newsletterLink).toBeHidden(); + }); + }); + + test(`${features[2].name},${features[2].tags}`, async ({ page, context }) => { + await test.step('Go to stage.adobe.com', async () => { + const url = `${features[2].baseURL}`; + await page.evaluate((navigationUrl) => { + window.location.href = navigationUrl; + }, url); + + await signInPage.signInButtonStageAdobe.click(); + await page.waitForLoadState('domcontentloaded'); + }); + + await test.step('Sign in with spp community user', async () => { + await signInPage.signIn(page, `${features[2].data.partnerLevel}`); + await signInPage.userNameDisplay.waitFor({ state: 'visible', timeout: 15000 }); + }); + + await test.step('Open public page in a new tab', async () => { + const newTab = await context.newPage(); + await newTab.goto(`${features[2].path}`); + const newTabPage = new SignInPage(newTab); + await newTabPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[1].url()) + .toContain(`${features[2].data.expectedProtectedURL}`); + }); + }); + + test(`${features[3].name},${features[3].tags}`, async ({ page, context }) => { + await test.step('Go to stage.adobe.com', async () => { + const url = `${features[3].baseURL}`; + await page.evaluate((navigationUrl) => { + window.location.href = navigationUrl; + }, url); + + await signInPage.signInButtonStageAdobe.click(); + await page.waitForLoadState('domcontentloaded'); + }); + + await test.step('Sign in with spp platinum user', async () => { + await signInPage.signIn(page, `${features[3].data.partnerLevel}`); + await signInPage.userNameDisplay.waitFor({ state: 'visible', timeout: 15000 }); + }); + + await test.step('Open restricted page in a new tab', async () => { + const newTab = await context.newPage(); + await newTab.goto(`${features[3].path}`); + const newTabPage = new SignInPage(newTab); + await newTabPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[1].url()) + .toContain(`${features[3].data.expectedProtectedURL}`); + }); + }); + + test(`${features[4].name},${features[4].tags}`, async ({ page }) => { + await test.step('Go to public home page', async () => { + await page.goto(`${features[4].path}`); + await page.waitForLoadState('domcontentloaded'); + await signInPage.signInButton.click(); + }); + + await test.step('Sign in', async () => { + await signInPage.signIn(page, `${features[4].data.partnerLevel}`); + }); + + await test.step('Verify redirection to contact not found page after successful login', async () => { + await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[4].data.expectedToSeeInURL}`); + }); + + await test.step('Logout', async () => { + await signInPage.profileIconButton.click(); + await signInPage.logoutButton.click(); + }); + + await test.step('Go to public news page', async () => { + await page.goto(`${features[4].newsPath}`); + await page.waitForLoadState('domcontentloaded'); + await signInPage.signInButton.click(); + }); + + await test.step('Sign in', async () => { + await signInPage.signIn(page, `${features[4].data.partnerLevel}`); + }); + + await test.step('Verify redirection to contact not found page after successful login', async () => { + await signInPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[4].data.expectedToSeeInURL}`); + }); + }); + + test(`${features[5].name},${features[5].tags}`, async ({ page, context }) => { + await test.step('Go to stage.adobe.com', async () => { + const url = `${features[5].baseURL}`; + await page.evaluate((navigationUrl) => { + window.location.href = navigationUrl; + }, url); + + await signInPage.signInButtonStageAdobe.click(); + await page.waitForLoadState('domcontentloaded'); + }); + + await test.step('Sign in with tpp platinum user', async () => { + await signInPage.signIn(page, `${features[5].data.partnerLevel}`); + await signInPage.userNameDisplay.waitFor({ state: 'visible', timeout: 15000 }); + }); + + await test.step('Open protected home page in a new tab', async () => { + const newTab = await context.newPage(); + await newTab.goto(`${features[5].path}`); + const newTabPage = new SignInPage(newTab); + await newTabPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[1].url()) + .toContain(`${features[5].data.expectedToSeeInURL}`); + const signInButton = await signInPage.signInButton; + await expect(signInButton).toBeHidden(); + }); + }); + + test(`${features[6].name},${features[6].tags}`, async ({ page, context }) => { + await test.step('Go to stage.adobe.com', async () => { + const url = `${features[6].baseURL}`; + await page.evaluate((navigationUrl) => { + window.location.href = navigationUrl; + }, url); + + await signInPage.signInButtonStageAdobe.click(); + await page.waitForLoadState('domcontentloaded'); + }); + + await test.step('Sign in with tpp platinum user', async () => { + await signInPage.signIn(page, `${features[6].data.partnerLevel}`); + await signInPage.userNameDisplay.waitFor({ state: 'visible', timeout: 15000 }); + }); + + await test.step('Open public page in a new tab', async () => { + const newTab = await context.newPage(); + await newTab.goto(`${features[6].path}`); + const newTabPage = new SignInPage(newTab); + await newTabPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 }); + const pages = await page.context().pages(); + await expect(pages[1].url()) + .toContain(`${features[6].data.expectedToSeeInURL}`); + const signInButton = await newTabPage.signInButton; + await expect(signInButton).toBeHidden(); + const joinNowButton = await newTabPage.joinNowButton; + await expect(joinNowButton).toBeVisible(); + }); + }); + + test(`${features[7].name},${features[7].tags}`, async ({ page }) => { + await test.step('Go to protected home page', async () => { + await page.goto(`${features[7].path}`); + const pages = await page.context().pages(); + await expect(pages[0].url()) + .toContain(`${features[7].expectedToSeeInURL}`); + }); + }); + + uniqueFeatures.forEach((feature) => { + test(`${feature.name},${feature.tags}`, async ({ page }) => { + await test.step('Verify landing page after successful login', async () => { + await signInPage.verifyLandingPageAfterLogin({ + page, + expect, + path: feature.path, + partnerLevel: feature.data.partnerLevel, + expectedLandingPageURL: feature.data.expectedLandingPageURL, + }); + }); + }); + }); +}); diff --git a/tests/milo/accordion.block.test.js b/tests/milo/accordion.block.test.js index 5b53894c..552bc78e 100644 --- a/tests/milo/accordion.block.test.js +++ b/tests/milo/accordion.block.test.js @@ -110,4 +110,49 @@ test.describe('Milo Accordion Block test suite', () => { expect(await webUtil.verifyAttributes_(accordion.accordion, accordion.attributes.analytics['accordion.daa-lh'])).toBeTruthy(); }); }); + + // Test 3 : Accordion (seo editorial) + test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); + const { data } = features[3]; + + await test.step('step-1: Go to Accordion block test page', async () => { + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Accrodion block content/specs', async () => { + await expect(await accordion.accordion).toBeVisible(); + + // verify accordion headers, buttons, and icons count + await expect(await accordion.accordionHeaders).toHaveCount(data.headers); + await expect(await accordion.accordionButtons).toHaveCount(data.headers); + await expect(await accordion.accordionButtonIcons).toHaveCount(data.headers); + + // verify accordion headers text content + await expect(await accordion.accordionHeaders.nth(0)).toContainText(data.heading0); + await expect(await accordion.accordionHeaders.nth(1)).toContainText(data.heading1); + await expect(await accordion.accordionHeaders.nth(2)).toContainText(data.heading2); + + // verify accordion nth(0) buttons is open by default + await expect(await accordion.accordionButtons.nth(0)).toHaveAttribute('aria-expanded', 'true'); + + // verify action area buttons, links and text + await expect(await accordion.outlineButton).toBeVisible(); + await expect(await accordion.blueButton).toBeVisible(); + await expect(await accordion.textLink).toBeVisible(); + + await expect(await accordion.outlineButton).toContainText(data.outlineButtonText); + await expect(await accordion.blueButton).toContainText(data.blueButtonText); + + // verify accordion buttons open close clicks + await accordion.accordionButtonIcons.nth(0).click(); + await expect(await accordion.accordionButtons.nth(0)).toHaveAttribute('aria-expanded', 'false'); + }); + + await test.step('step-3: Verify analytics attributes', async () => { + expect(await webUtil.verifyAttributes_(accordion.accordion, accordion.attributes.analytics['accordion.daa-lh'])).toBeTruthy(); + }); + }); }); diff --git a/tests/milo/table.block.test.js b/tests/milo/table.block.test.js index bd8046d8..476e4eca 100644 --- a/tests/milo/table.block.test.js +++ b/tests/milo/table.block.test.js @@ -130,10 +130,8 @@ test.describe('Milo Table block feature test suite', () => { await test.step('step-2: Verify table content/specs', async () => { // verify sticky table header and attributes await expect(await table.collapseStickyTable).toBeVisible(); - - expect(await table.highlightRow).toHaveAttribute('class', 'row row-1 row-highlight'); - - expect(await table.stickyRow.getAttribute('class')).toContain('row row-2 row-heading'); + await expect(table.highlightRow).toHaveClass(/row.*row-1.*row-highlight/); + await expect(table.stickyRow).toHaveClass(/row.*row-2.*row-heading/); // verify table row, column count await expect(await table.rows).toHaveCount(data.rowsCount); diff --git a/tests/visual/dc/sot.test.js b/tests/visual/dc/sot.test.js new file mode 100644 index 00000000..0dbbfe66 --- /dev/null +++ b/tests/visual/dc/sot.test.js @@ -0,0 +1,45 @@ +/* eslint-disable no-restricted-syntax */ +/* eslint-disable import/named */ +import { test } from '@playwright/test'; +import { features } from '../../../features/visual/dc/sot.spec.js'; +import { takeTwo } from '../../../libs/screenshot/take.js'; +import { writeResultsToFile } from '../../../libs/screenshot/utils.js'; + +const { WebUtil } = require('../../../libs/webutil.js'); + +const folderPath = 'screenshots/dc'; +const results = {}; + +test.describe('DC SOT visual comparison test suite', () => { + // reset timeout because we use this to run all test data + test.setTimeout(10 * 60 * 1000); + for (const feature of features) { + // eslint-disable-next-line no-loop-func + test(`${feature.name},${feature.tags}`, async ({ page }, testInfo) => { + // load test data from static files + const testdata = await WebUtil.loadTestData(`${feature.data}`); + + for (const key of Object.keys(testdata)) { + const stableURL = testdata[key].replace('.stage.', '.'); + console.info(stableURL); + const betaURL = testdata[key]; + console.info(betaURL); + + const name = `${feature.name}-${key}-${testInfo.project.name}`; + // eslint-disable-next-line no-await-in-loop + const result = await takeTwo( + page, + stableURL, + async () => { await page.waitForTimeout(3000); }, + betaURL, + async () => { await page.waitForTimeout(3000); }, + folderPath, + name, + { fullPage: true }, + ); + results[name] = [result]; + } + writeResultsToFile(folderPath, testInfo, results); + }); + } +});