-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing sign in testcases (#406)
* config file * config file * config file * config file * logout * Fix: eslint errors * test updates * Update: synced dev branches with cod17828/nala repo * New: added login flow test cases * test updates * Fix: refactored function for email extraction from secret * Fix: extracted sign in flow; cleaned up selectors file * Fix: removed unnecessary dialog popup checks * update partners url * remove console logs * Fix: refactored test cases due to changes from archive news page * Fix: extracted functions to selectors file; refactored tests due to archive page changes; * Fix: moved test case data to spec file * function specific for these testcases. Only sign in would be used in other tests * eslint fix * update paths * update paths * include nopr tag * eslint fix * New: mapp signin test cases; Fix: extracted sign in function from news.page.js; * Fix: removed unnecessary selectors from news page * Fix: introduced variables in spec file to avoid hardcoded strings within test * Fix: introduced variables in news spec file to avoid hardcoded strings within test * Refactor: extracted verify function from test file * Refactor: removed test steps from page file --------- Co-authored-by: Kristijan Vizi <[email protected]>
- Loading branch information
Showing
6 changed files
with
457 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.