import { Reporter, TestCase, TestResult } from '@playwright/test/reporter'; import { HtmlReporter } from './HtmlReporter'; import { MarkdownReporter } from './MarkdownReporter'; // Factory function for HTML reporter export function createHtmlReporter(options: { outputDir: string }): Reporter { const reporter = new HtmlReporter(options); return { onBegin: (config, suite) => reporter.onBegin(config, suite), onTestEnd: (test, result) => reporter.onTestEnd(test, result), onEnd: () => reporter.onEnd() }; } // Factory function for Markdown reporter export function createMarkdownReporter(options: { outputFile: string }): Reporter { const reporter = new MarkdownReporter(options); return { onBegin: (config, suite) => reporter.onBegin(config, suite), onTestEnd: (test, result) => reporter.onTestEnd(test, result), onEnd: () => reporter.onEnd() }; }