UNPKG

@alphabin/trx

Version:

TRX reporter for Playwright tests with Azure Blob Storage upload support

98 lines (97 loc) 2.74 kB
export interface ReporterConfig { name: string; options?: Record<string, any>; outputDir?: string; } export interface PlaywrightConfigInfo { hasHtmlReporter: boolean; hasJsonReporter: boolean; hasBlobReporter: boolean; htmlOutputDir?: string; jsonOutputFile?: string; blobOutputDir?: string; globalOutputDir?: string; configPath?: string; reporters: ReporterConfig[]; } /** * Enhanced utility for parsing Playwright configuration files with static analysis */ export declare class PlaywrightConfigParser { private rootDir; constructor(rootDir?: string); /** * Analyzes Playwright configuration with enhanced parsing */ analyzeConfig(): Promise<PlaywrightConfigInfo>; /** * Executes TypeScript config using child process */ private executeTypescriptConfig; /** * Enhanced static parsing for complex TypeScript configs */ private parseConfigContent; /** * Advanced reporter array parsing with better TypeScript support */ private parseReporterArrayAdvanced; /** * Fallback method using regex extraction for config parsing */ private extractConfigUsingRegex; /** * Parse reporter configuration from raw content string */ private parseReporterFromRawContent; /** * Split reporter array content while respecting nested structures */ private splitReporterArray; /** * Parse options object from string representation */ private parseOptionsObject; /** * Split options string while respecting quotes */ private splitOptionsString; /** * Parses reporter array from string representation */ private parseReporterArray; /** * Extracts reporter configurations from parsed config */ private extractReporterConfigs; /** * Resolves output path with environment variable substitution */ private resolveOutputPath; /** * Finds Playwright configuration file */ private findConfigFile; /** * Gets all possible report output directories */ getReportDirectories(): string[]; /** * Validates if a reporter is configured correctly */ validateReporterConfig(reporterName: string, config: PlaywrightConfigInfo): boolean; /** * Checks if traces are likely enabled */ isTracingEnabled(config: any): boolean; /** * Gets expected trace directory */ getTraceDirectory(config: any): string | null; /** * Legacy method for backward compatibility * @deprecated Use analyzeConfig() instead */ isHtmlReporter(reporter: any): Promise<boolean>; } export default PlaywrightConfigParser;