html-reporter
Version:
Html-reporter and GUI for viewing and managing results of a tests run. Currently supports Testplane and Hermione.
41 lines (40 loc) • 1.94 kB
TypeScript
import { TestStatus } from '../constants';
import type { SqliteClient } from '../sqlite-client';
import { ReporterTestResult } from '../adapters/test-result';
import { ReporterConfig } from '../types';
import { HtmlReporter } from '../plugin-api';
import { TestAttemptManager } from '../test-attempt-manager';
import { RegisterWorkers } from '../workers/create-workers';
import { ImagesInfoSaver } from '../images-info-saver';
export interface StaticReportBuilderOptions {
htmlReporter: HtmlReporter;
reporterConfig: ReporterConfig;
dbClient: SqliteClient;
imagesInfoSaver: ImagesInfoSaver;
}
export declare class StaticReportBuilder {
protected _htmlReporter: HtmlReporter;
protected _reporterConfig: ReporterConfig;
protected _dbClient: SqliteClient;
protected _imagesInfoSaver: ImagesInfoSaver;
protected _testAttemptManager: TestAttemptManager;
private _workers?;
static create<T extends StaticReportBuilder>(this: new (options: StaticReportBuilderOptions) => T, options: StaticReportBuilderOptions): T;
constructor({ htmlReporter, reporterConfig, dbClient, imagesInfoSaver }: StaticReportBuilderOptions);
saveStaticFiles(): Promise<void>;
registerWorkers(workers: RegisterWorkers<['saveDiffTo']>): void;
registerAttempt(testInfo: {
fullName: string;
browserId: string;
}, status: TestStatus): number;
getLatestAttempt(testInfo: {
fullName: string;
browserId: string;
}): number;
/** If passed test result doesn't have attempt, this method registers new attempt and sets attempt number */
provideAttempt(testResultOriginal: ReporterTestResult): ReporterTestResult;
private _saveTestResultData;
addTestResult(formattedResultOriginal: ReporterTestResult): Promise<ReporterTestResult>;
protected _deleteTestResultFromDb(...args: Parameters<typeof this._dbClient.delete>): void;
finalize(): Promise<void>;
}