Skip to content

Commit

Permalink
Merge branch 'main' into spec-creativecloudunav
Browse files Browse the repository at this point in the history
  • Loading branch information
PavanKumarN8 authored Jul 31, 2024
2 parents 1c38c2f + 22705df commit e91ca5c
Show file tree
Hide file tree
Showing 19 changed files with 745 additions and 45 deletions.
7 changes: 7 additions & 0 deletions data/dc/sot-basic.yml
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion envs/envs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ module.exports = {
'@local6456': 'http://localhost:6456',
'@helpx_live': 'https://helpx-internal.stage.adobe.com',
'@dx_stage': 'https://stage--dx-partners--adobecom.hlx.live',
'@dme_stage': 'https://partners.stage.adobe.com',
'@dme_stage': 'https://stage--dme-partners--adobecom.hlx.live',
};
40 changes: 40 additions & 0 deletions features/dme/signin.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = {
FeatureName: 'DME sign in flow page',
features: [
{
tcid: '1',
name: '@login-sign-in-sign-out-public-page',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page',
tags: '@dme-signin @regression @login @nopr',
data: {
partnerLevel: 'cpp-spain-platinum:',
expectedProtectedHomeURL: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/protected-home',
expectedPublicPageURL: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page',
},
},
{
tcid: '2',
name: '@login-accessing-public-home-page-with-member-user-logged-in-to-adobe',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/public-page',
baseURL: 'https://www.stage.adobe.com/partners.html',
tags: '@dme-signin @regression @login @nopr',
data: {
partnerLevel: 'cpp-spain-platinum:',
expectedToSeeInURL: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/protected-home',
page: 'public page',
},
},
{
tcid: '3',
name: '@login-accessing-restricted-home-page-with-member-user-logged-in-to-adobe',
path: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/protected-home',
baseURL: 'https://www.stage.adobe.com/partners.html',
tags: '@dme-signin @regression @login @nopr',
data: {
partnerLevel: 'cpp-spain-platinum:',
expectedToSeeInURL: 'https://partners.stage.adobe.com/channelpartners/drafts/automation/regression/protected-home',
page: 'restricted page',
},
},
],
};
7 changes: 7 additions & 0 deletions features/dx/news.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
name: '@desc-regression-news-page-read-article',
path: '/solutionpartners/drafts/automation/regression/partner-news',
tags: '@dx-news @regression @anonymous',
expectedToSeeInURL: '/solutionpartners/drafts/automation/regression/caas-cards/automation-regression-card-no1',
},
{
tcid: '5',
Expand All @@ -36,6 +37,11 @@ module.exports = {
name: '@login-news-page-platinum-user',
path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news',
tags: '@dx-news @regression @login @nopr',
data: {
partnerLevel: 'spp-platinum:',
expectedToSeeInURL: '/solutionpartners/drafts/'
+ 'automation/regression/caas-cards/automation-regression-platinum-card-no1',
},
},
{
tcid: '7',
Expand Down Expand Up @@ -91,6 +97,7 @@ module.exports = {
path: 'https://partners.stage.adobe.com/solutionpartners/drafts/automation/regression/partner-news',
baseURL: 'https://www.stage.adobe.com/partners.html',
tags: '@dx-news @regression @login @nopr',
partnerLevel: 'tpp-platinum:',
},
],
};
129 changes: 129 additions & 0 deletions features/dx/signin.spec.js
Original file line number Diff line number Diff line change
@@ -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',
},
},
],
};
14 changes: 14 additions & 0 deletions features/milo/accordion.block.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
};
13 changes: 13 additions & 0 deletions features/visual/dc/sot.spec.js
Original file line number Diff line number Diff line change
@@ -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',
},
],
};
5 changes: 5 additions & 0 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Options:
-h, --help Display this help message and exit.
--headed Run tests in headed mode.
--headless Run tests in headless mode (default).
--list List all tests found, but doesn't run them.
Examples:
node run.js -p=milo-live-chrome -c=milo
Expand Down Expand Up @@ -96,6 +97,10 @@ function runPlaywrightTests() {
options.push('--headed');
}

if (argv.list) {
options.push('--list');
}

if (argv.project) {
if (argv.project === 'all') {
console.log('Running tests for all projects');
Expand Down
42 changes: 42 additions & 0 deletions selectors/dme/signin.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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.userNameDisplay = page.locator('.user-name');
this.logoutButton = page.locator('[daa-ll="Sign Out"]');

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"]');
}

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 verifyRedirectAfterLogin({
page, expect, newTab, newTabPage, baseURL, partnerLevel, path, expectedToSeeInURL,
}) {
const url = `${baseURL}`;
await page.evaluate((navigationUrl) => {
window.location.href = navigationUrl;
}, url);

await this.signInButtonStageAdobe.click();
await this.signIn(page, `${partnerLevel}`);
await this.userNameDisplay.waitFor({ state: 'visible', timeout: 20000 });
await newTab.goto(`${path}`);
await newTabPage.profileIconButton.waitFor({ state: 'visible', timeout: 20000 });
const pages = await page.context().pages();
await expect(pages[1].url())
.toContain(`${expectedToSeeInURL}`);
}
}
12 changes: 0 additions & 12 deletions selectors/dx/news.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]');
Expand All @@ -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();
}
}
39 changes: 39 additions & 0 deletions selectors/dx/signin.page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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);
}
}
Loading

0 comments on commit e91ca5c

Please sign in to comment.