-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.7.8.x : BO : Close Onboarding Welcome popup
- Loading branch information
Showing
3 changed files
with
61 additions
and
7 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,53 @@ | ||
// Import pages | ||
import type {LoginPageInterface} from '@interfaces/BO/login'; | ||
import {Page} from '@playwright/test'; | ||
import {LoginPage} from '@versions/develop/pages/BO/login'; | ||
|
||
/** | ||
* Order confirmation page, contains functions that can be used on the page | ||
* @class | ||
* @extends OrderConfirmationPage | ||
*/ | ||
class Login extends LoginPage implements LoginPageInterface { | ||
private readonly onboardingCloseButton: string; | ||
|
||
private readonly onboardingStopButton: string; | ||
|
||
/** | ||
* @constructs | ||
* Setting up texts and selectors to use on order confirmation page | ||
*/ | ||
constructor() { | ||
super(); | ||
|
||
// welcome module | ||
this.onboardingCloseButton = 'button.onboarding-button-shut-down'; | ||
this.onboardingStopButton = 'a.onboarding-button-stop'; | ||
} | ||
|
||
/** | ||
* Fill login form and success login | ||
* @param page {Page} Browser tab | ||
* @param email {string} String of employee email | ||
* @param password {string} String of employee password | ||
* @returns {Promise<void>} | ||
*/ | ||
async successLogin(page: Page, email: string, password: string): Promise<void> { | ||
await super.successLogin(page, email, password); | ||
|
||
// closeOnboardingModal | ||
if (await this.elementVisible(page, this.onboardingCloseButton, 3000)) { | ||
// Close popup | ||
await page.locator(this.onboardingCloseButton).click(); | ||
await this.waitForHiddenSelector(page, this.onboardingCloseButton); | ||
|
||
// Close menu block | ||
if (await this.elementVisible(page, this.onboardingStopButton, 3000)) { | ||
await page.locator(this.onboardingStopButton).click(); | ||
await this.waitForHiddenSelector(page, this.onboardingStopButton); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = new Login(); |
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