upskill-event-manager/wordpress-dev/tests/e2e/reporters/reporterFactory.ts
bengizmo d6211ee364 feat(testing): Implement HVAC_Test_User_Factory and update .gitignore
- 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.
2025-04-14 17:41:36 -03:00

30 lines
No EOL
1 KiB
TypeScript

import { Reporter } from '@playwright/test/reporter';
import { HtmlReporter } from './HtmlReporter';
import { MarkdownReporter } from './MarkdownReporter';
export function createCustomReporter(options?: {
htmlDir?: string;
markdownFile?: string;
}): Reporter {
const htmlReporter = new HtmlReporter({
outputDir: options?.htmlDir || 'test-results/custom-html-report'
});
const markdownReporter = new MarkdownReporter({
outputFile: options?.markdownFile || 'test-results/test-report.md'
});
return {
onBegin: async (config, suite) => {
await htmlReporter.onBegin?.(config, suite);
await markdownReporter.onBegin?.(config, suite);
},
onTestEnd: async (test, result) => {
await htmlReporter.onTestEnd?.(test, result);
await markdownReporter.onTestEnd?.(test, result);
},
onEnd: async (result) => {
await htmlReporter.onEnd?.();
await markdownReporter.onEnd?.();
}
};
}