- Add HVAC_Test_User_Factory class with: * User creation with specific roles * Multiple role support * Persona management system * Account cleanup integration - Create comprehensive test suite in HVAC_Test_User_Factory_Test.php - Update testing improvement plan documentation - Add implementation decisions to project memory bank - Restructure .gitignore with: * Whitelist approach for better file management * Explicit backup exclusions * Specific bin directory inclusions Part of the Account Management component from the testing framework improvement plan.
60 lines
No EOL
2.1 KiB
TypeScript
60 lines
No EOL
2.1 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { LoginPage } from './pages/LoginPage';
|
|
import { LogParser } from './utils/logParser';
|
|
|
|
test.describe('Community Login Page Tests', () => {
|
|
let loginPage: LoginPage;
|
|
let logParser: LogParser;
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
loginPage = new LoginPage(page);
|
|
logParser = new LogParser();
|
|
await loginPage.navigate();
|
|
});
|
|
|
|
// Basic login/logout flow
|
|
test('Successful login redirects to dashboard', async ({ page }) => {
|
|
await loginPage.login('valid_user', 'valid_password');
|
|
await loginPage.verifySuccessfulLogin();
|
|
});
|
|
|
|
// Failed login scenarios
|
|
test('Invalid username shows appropriate error', async () => {
|
|
await loginPage.login('invalid_user', 'valid_password');
|
|
await loginPage.verifyLoginError('Invalid username');
|
|
});
|
|
|
|
test('Invalid password shows appropriate error', async () => {
|
|
await loginPage.login('valid_user', 'invalid_password');
|
|
await loginPage.verifyLoginError('The password you entered');
|
|
});
|
|
|
|
// Password reset functionality
|
|
test('Password reset link redirects properly', async ({ page }) => {
|
|
await loginPage.clickResetPassword();
|
|
await expect(page).toHaveURL(/.*\/wp-login\.php\?action=lostpassword/);
|
|
});
|
|
|
|
// Remember me functionality
|
|
test('Remember me sets persistent cookie', async () => {
|
|
await loginPage.login('valid_user', 'valid_password', true);
|
|
await loginPage.verifyRememberMeCookie();
|
|
});
|
|
|
|
// Input validation
|
|
test('Empty username shows error', async () => {
|
|
await loginPage.login('', 'password');
|
|
await loginPage.verifyLoginError('The username field is empty.');
|
|
});
|
|
|
|
test('Empty password shows error', async () => {
|
|
await loginPage.login('user', '');
|
|
await loginPage.verifyLoginError('password field is empty');
|
|
});
|
|
|
|
// Log validation
|
|
// test('Login attempt logged properly', async () => {
|
|
// await loginPage.login('valid_user', 'valid_password');
|
|
// await loginPage.checkLogEntries(logParser);
|
|
// });
|
|
}); |