Files
myeasycms-v2/apps/e2e/tests/account/account.po.ts
giancarlo 311086d0e7 Update retries in playwright config and refactor account settings
This update changes the number of retries in the Playwright configuration. Additionally, solid improvements have been made in the account settings, including better data semantics for testing, changes to email confirmation, and adding a new E2E test suite for accounts. The sign-up flow was updated and problems with multi-language support logic were fixed.
2024-04-11 18:15:16 +08:00

35 lines
1.1 KiB
TypeScript

import { Page } from '@playwright/test';
import { AuthPageObject } from '../authentication/auth.po';
export class AccountPageObject {
private readonly page: Page;
public auth: AuthPageObject;
constructor(page: Page) {
this.page = page;
this.auth = new AuthPageObject(page);
}
async setup() {
return this.auth.signUpFlow('/home/settings');
}
async updateProfileName(name: string) {
await this.page.locator('[data-test="update-account-name-form"] input').fill(name);
await this.page.locator('[data-test="update-account-name-form"] button').click();
}
async updateProfileEmail(email: string) {
await this.page.locator('[data-test="account-email-form-email-input"]').fill(email);
await this.page.locator('[data-test="account-email-form-repeat-email-input"]').fill(email);
await this.page.locator('[data-test="account-email-form"] button').click();
}
getProfileName() {
return this.page.locator('[data-test="account-dropdown-display-name"]');
}
getProfileEmail() {
return this.page.locator('[data-test="account-dropdown-email"]');
}
}