mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-5866] authentication playwright tests (#3391)
* viewer action files e2e migration * viewer action files e2e remove comment * review code fix * [ci:force] * [ACS-5650]viewer test with new user * remove commented code * login and logout playwright test * Update error message login.spec.ts
This commit is contained in:
@@ -31,15 +31,18 @@ interface LoginOptions {
|
||||
withNavigation?: boolean;
|
||||
}
|
||||
export class LoginPage extends BasePage {
|
||||
private static pageUrl = 'login';
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page, '');
|
||||
super(page, LoginPage.pageUrl);
|
||||
}
|
||||
|
||||
private username = this.page.locator('#username');
|
||||
private password = this.page.locator('#password');
|
||||
private submitButton = this.page.locator('#login-button');
|
||||
private userProfileButton = this.page.locator('aca-user-menu button');
|
||||
private userLogOutButton = this.page.locator('aca-logout button');
|
||||
public username = this.page.locator('#username');
|
||||
public password = this.page.locator('#password');
|
||||
public submitButton = this.page.locator('#login-button');
|
||||
public userProfileButton = this.page.locator('aca-user-menu button');
|
||||
public userLogOutButton = this.page.locator('aca-logout button');
|
||||
public passwordVisibility = this.page.locator('.adf-login-password-icon');
|
||||
|
||||
async loginUser(userData: { username: string; password: string } | UserModel, options?: LoginOptions): Promise<void> {
|
||||
if (options?.withNavigation) {
|
||||
@@ -58,4 +61,12 @@ export class LoginPage extends BasePage {
|
||||
await this.userProfileButton.click();
|
||||
await this.userLogOutButton.click();
|
||||
}
|
||||
|
||||
async isPasswordDisplayed(): Promise<boolean> {
|
||||
const type = await this.password.getAttribute('type');
|
||||
if (type === 'text') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user