- 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.
46 lines
No EOL
1.6 KiB
TypeScript
46 lines
No EOL
1.6 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
import { LogEntry } from './logParser';
|
|
|
|
expect.extend({
|
|
async toContainEventCreation(logs: LogEntry[], eventName: string) {
|
|
const eventCreationLog = logs.find(log =>
|
|
log.level === 'INFO' &&
|
|
log.component === 'EventManager' &&
|
|
log.message.includes(`Event created: ${eventName}`)
|
|
);
|
|
|
|
return {
|
|
pass: !!eventCreationLog,
|
|
message: () =>
|
|
eventCreationLog
|
|
? `Expected logs not to contain event creation for "${eventName}"`
|
|
: `Expected logs to contain event creation for "${eventName}"`
|
|
};
|
|
},
|
|
|
|
async toContainEventModification(logs: LogEntry[], eventName: string) {
|
|
const eventModificationLog = logs.find(log =>
|
|
log.level === 'INFO' &&
|
|
log.component === 'EventManager' &&
|
|
log.message.includes(`Event modified: ${eventName}`)
|
|
);
|
|
|
|
return {
|
|
pass: !!eventModificationLog,
|
|
message: () =>
|
|
eventModificationLog
|
|
? `Expected logs not to contain event modification for "${eventName}"`
|
|
: `Expected logs to contain event modification for "${eventName}"`
|
|
};
|
|
}
|
|
});
|
|
|
|
// Add the custom matchers to the global expect interface
|
|
declare global {
|
|
namespace PlaywrightTest {
|
|
interface Matchers<R> {
|
|
toContainEventCreation(eventName: string): Promise<R>;
|
|
toContainEventModification(eventName: string): Promise<R>;
|
|
}
|
|
}
|
|
} |