import type { Reporter, FullConfig, Suite, TestCase, TestResult, FullResult } from '@playwright/test/reporter'; import type { QAStudioReporterOptions } from './types'; /** * QAStudio.dev Reporter for Playwright * * Sends test results to QAStudio.dev test management platform * * @example * ```typescript * // playwright.config.ts * export default defineConfig({ * reporter: [ * ['@qastudio-dev/playwright', { * apiUrl: 'https://qastudio.dev/api', * apiKey: process.env.QA_STUDIO_API_KEY, * projectId: 'abc123', * environment: 'CI', * }] * ], * }); * ``` */ export default class QAStudioReporter implements Reporter { private options; private apiClient; private state; private totalTests; private passedTests; private failedTests; private skippedTests; private flushPromises; private uploadFailures; private testRunReadyPromise; private testRunReadyResolve; private testRunCreationError; private readonly TEST_RUN_CREATION_ERROR_PREFIX; constructor(options: QAStudioReporterOptions); /** * Called once before running tests */ onBegin(_config: FullConfig, _suite: Suite): Promise; /** * Called when a test begins */ onTestBegin(test: TestCase, result: TestResult): void; /** * Called when a test ends */ onTestEnd(test: TestCase, result: TestResult): Promise; /** * Called after all tests have finished */ onEnd(_result: FullResult): Promise; /** * Wait for all pending result submissions to complete and collect failures */ private sendTestResults; /** * Send a single test result to the API */ private sendTestResult; /** * Upload attachments for a test result in parallel */ private uploadAttachments; /** * Get formatted test run creation error message, or null if no error */ private getTestRunCreationErrorMessage; /** * Normalize Playwright test status to one of three categories for reporting */ private normalizeTestStatus; /** * Calculate actual uploaded test counts by subtracting upload failures * * This ensures that the summary sent to the API accurately reflects only the tests * that were successfully uploaded. Each status counter is reduced by the number of * failed uploads for that status, ensuring total = passed + failed + skipped. */ private calculateUploadedCounts; /** * Get unique test ID */ private getTestId; /** * Log message if verbose mode is enabled */ private log; /** * Handle errors based on silent mode */ private handleError; /** * Print summary to console */ printsToStdio(): boolean; } export type { QAStudioReporterOptions } from './types'; //# sourceMappingURL=index.d.ts.map