Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoke Tests #176

Merged
merged 16 commits into from
Jan 13, 2025
1 change: 1 addition & 0 deletions nala/blocks/region-selectors/region-selectors.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export default class RegionSelectorsPage {
constructor(page) {
this.page = page;
this.regionSelectorPopUp = page.locator('div.region-nav');

this.profileIconButton = page.locator('.feds-profile-button');

this.oneTrustBanner = page.getByLabel('Cookie banner');
Expand Down
1 change: 1 addition & 0 deletions nala/blocks/region-selectors/region-selectors.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
data: {
changeRegionEng: 'Change region',
localeSwitchUrl: '/latam/channelpartners/',

linkText: 'Latin America',
},
},
Expand Down
84 changes: 84 additions & 0 deletions nala/blocks/smoke-test/smoke.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
export default class SmokeTest {
constructor(page) {
this.page = page;
this.joinNowButton = page.locator(
'#feds-nav-wrapper .feds-cta--primary:has-text("Join Now")',
);
this.signInButton = page.locator('.feds-signIn');
this.GNav = page.locator('.feds-topnav');
this.profileIcon = page.locator('.feds-profile-button');
this.priceList = page.locator('[daa-ll="Price lists-1"]');
this.tableSelector = '.table-container';
this.searchGnav = page.locator('.feds-search-trigger');
this.searchGnavField = page.locator('.feds-search-input');
this.searchFieldPage = page.locator('#search');
this.announcemnts = page.locator('[daa-ll="Announcements-6"]');
}

async verifyButtonExist() {
const joinNowExist = await this.joinNowButton.isVisible();
const signInExists = await this.signInButton.isVisible();

return {
joinNowButton: joinNowExist,
signInButton: signInExists,
};
}

async verifyProtectedGnav() {
const gNavExists = await this.GNav.isVisible();

return { GNav: gNavExists };
}

async verifyProfileIcon() {
const profileIconExists = await this.profileIcon.isVisible();

return { profileIcon: profileIconExists };
}

async getCurrentUrl() {
return this.page.url();
}

async clickDownloadButtonInFirstRow() {
const firstRowWithDownload = this.page
.locator(`${this.tableSelector} tr:has(td[headers="download"])`)
.first();
const downloadButton = firstRowWithDownload.locator('#button');
await downloadButton.click();
}

async searchPageDownloadButton() {
const enableAll = this.page.locator('#onetrust-accept-btn-handler');
await enableAll.waitFor({ state: 'visible' });
await enableAll.click();
const shadowHost = await this.page
.locator('search-cards.search-cards-wrapper[data-idx="2"]')
.elementHandle();
const shadowRoot = await shadowHost.evaluateHandle(
(node) => node.shadowRoot,
);

const downloadButton = await shadowRoot.$(
'sp-action-button[href="https://partners.stage.adobe.com/channelpartnerassets/assets/public/public_1/scanning_documents_into_pdf_files--ar.pdf?download"]',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change selector to find first a element that has download attribute for example

);

await downloadButton.click();
}

async announcmentCardVerification() {
const shadowHostCard = await this.page
.locator(
'announcements-cards.content.announcements-wrapper[data-idx="0"]',
)
.elementHandle();
const shadowRootCard = await shadowHostCard.evaluateHandle(
(node) => node.shadowRoot,
);

const announcementsCrad = await shadowRootCard.$$('.card-wrapper');
const firstCard = announcementsCrad[0];
await firstCard.isVisible();
}
}
121 changes: 121 additions & 0 deletions nala/blocks/smoke-test/smoke.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
export default {
FeatureName: 'Smoke Tests',
features: [
{
tcid: '1',
name: '@lending-page-validation-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
baseURL: 'https://www.stage.adobe.com?akamaiLocale=us',
},

{
tcid: '2',
name: '@home-page-validation-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
baseURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-latin-na-platinum:',
signInButtonInternationalText: 'Sign In',
},
},

{
tcid: '3',
name: '@price-list-validation-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
basedURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-distributor-us:',
signInButtonInternationalText: 'Sign In',
expectedPublicPageURL:
'https://partners.stage.adobe.com/na/channelpartners/home/pricelists/',
},
},

{
tcid: '4',
name: '@search-page-validation-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
basedURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-distributor-us:',
signInButtonInternationalText: 'Sign In',
searchText: 'pdf',
},
},

{
tcid: '5',
name: '@user-redirection-apac-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
basedURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-distributor-india:',
expectedPublicPageURL:
'https://partners.stage.adobe.com/apac/channelpartners/drafts/automation/regression/protected-home#',
signInButtonInternationalText: 'Sign In',
},
},

{
tcid: '6',
name: '@user-redirection-emea-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
basedURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-emea-platinum:',
expectedPublicPageURL:
'https://partners.stage.adobe.com/emea/channelpartners/drafts/automation/regression/protected-home#',
signInButtonInternationalText: 'Sign In',
},
},

{
tcid: '7',
name: '@user-redirection-jp-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
basedURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-distributor-japan:',
expectedPublicPageURL:
'https://partners.stage.adobe.com/jp/channelpartners/drafts/automation/regression/protected-home#',
signInButtonInternationalText: 'Sign In',
},
},

{
tcid: '8',
name: '@user-redirection-latam-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
basedURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-latin-america-na-platinum:',
expectedPublicPageURL:
'https://partners.stage.adobe.com/latam/channelpartners/drafts/automation/regression/protected-home#',
signInButtonInternationalText: 'Sign In',
},
},

{
tcid: '9',
name: '@announcement-page-validation-smoke-test',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page?georouting=off',
tags: '@dme-smoke-test',
baseURL: 'https://www.stage.adobe.com?akamaiLocale=us',
data: {
partnerLevel: 'cpp-na-certified:',
expectedPublicPageURL:
'https://partners.stage.adobe.com/latam/channelpartners/drafts/automation/regression/protected-home#',
signInButtonInternationalText: 'Sign In',
},
},
],
};
Loading
Loading