- Add comprehensive trainer journey test implementation - Cover login, dashboard access, event creation, modification, and deletion - Fix TinyMCE editor interaction issues - Handle venue and organizer form fields - Add proper waits and error handling - Update documentation with test findings - Document event persistence issues in staging Test Status: All trainer journey steps (1-5) are now passing Key Finding: Events persist to My Events page but not main dashboard Co-authored-by: Ben Reed <ben@tealmaker.com>
47 lines
No EOL
1.5 KiB
TypeScript
47 lines
No EOL
1.5 KiB
TypeScript
import { Page } from '@playwright/test';
|
|
import { BasePage } from './BasePage';
|
|
|
|
export class LoginPage extends BasePage {
|
|
private readonly usernameField = '#user_login';
|
|
private readonly passwordField = '#user_pass';
|
|
private readonly loginButton = '#wp-submit';
|
|
private readonly rememberMeCheckbox = '#rememberme';
|
|
private readonly errorMessage = '.hvac-login-error';
|
|
private readonly forgotPasswordLink = 'a:has-text("Lost your password")';
|
|
|
|
constructor(page: Page) {
|
|
super(page);
|
|
}
|
|
|
|
async navigateToLogin(): Promise<void> {
|
|
await this.navigate('/community-login/');
|
|
}
|
|
|
|
async login(username: string, password: string, rememberMe: boolean = false): Promise<void> {
|
|
await this.fill(this.usernameField, username);
|
|
await this.fill(this.passwordField, password);
|
|
|
|
if (rememberMe) {
|
|
await this.click(this.rememberMeCheckbox);
|
|
}
|
|
|
|
await this.click(this.loginButton);
|
|
await this.waitForNavigation();
|
|
}
|
|
|
|
async getErrorMessage(): Promise<string> {
|
|
if (await this.isVisible(this.errorMessage)) {
|
|
return await this.getText(this.errorMessage);
|
|
}
|
|
return '';
|
|
}
|
|
|
|
async isLoginFormVisible(): Promise<boolean> {
|
|
return await this.isVisible(this.usernameField) &&
|
|
await this.isVisible(this.passwordField);
|
|
}
|
|
|
|
async clickForgotPassword(): Promise<void> {
|
|
await this.click(this.forgotPasswordLink);
|
|
}
|
|
} |