html-reporter
Version:
Html-reporter and GUI for viewing and managing results of a tests run. Currently supports Testplane and Hermione.
58 lines (57 loc) • 3.93 kB
TypeScript
import { AxiosRequestConfig } from 'axios';
import { TestStatus } from './constants';
import { CheckStatus } from './constants/checked-statuses';
import { ImageBase64, ImageBuffer, ImageFile, ImageInfoFull, ImageInfoWithState, TestError } from './types';
import { ImageDiffError, InvalidRefImageError, NoRefImageError } from './errors';
import type { ReporterTestResult } from './adapters/test-result';
export declare const getShortMD5: (str: string) => string;
export declare const logger: Pick<Console, "error" | "log" | "warn">;
export declare const isSuccessStatus: (status: TestStatus) => boolean;
export declare const isFailStatus: (status: TestStatus) => status is TestStatus.FAIL;
export declare const isIdleStatus: (status: TestStatus) => boolean;
export declare const isRunningStatus: (status: TestStatus) => boolean;
export declare const isErrorStatus: (status: TestStatus) => boolean;
export declare const isSkippedStatus: (status: TestStatus) => boolean;
export declare const isUpdatedStatus: (status: TestStatus) => boolean;
export declare const isStagedStatus: (status: TestStatus) => boolean;
export declare const isCommitedStatus: (status: TestStatus) => boolean;
export declare const determineFinalStatus: (statuses: TestStatus[]) => TestStatus | null;
export declare const getUrlWithBase: (url: string | undefined, base: string | undefined) => string;
export declare const getRelativeUrl: (absoluteUrl: string) => string;
export declare const mkTestId: (fullTitle: string, browserId: string) => string;
export declare const isAssertViewError: (error?: unknown) => boolean;
export declare const isImageDiffError: (error?: unknown) => error is ImageDiffError;
export declare const isNoRefImageError: (error?: unknown) => error is NoRefImageError;
export declare const isInvalidRefImageError: (error?: unknown) => error is InvalidRefImageError;
export declare const isImageError: (error?: unknown) => boolean;
export declare const hasNoRefImageErrors: ({ assertViewResults }: {
assertViewResults?: {
name?: string | undefined;
}[] | undefined;
}) => boolean;
export declare const hasFailedImages: (imagesInfo?: ImageInfoFull[]) => boolean;
export declare const hasUnrelatedToScreenshotsErrors: (error: TestError) => boolean;
export declare const getError: (error?: TestError) => undefined | Pick<TestError, 'name' | 'message' | 'stack' | 'stateName' | 'snippet'>;
export declare const hasDiff: (assertViewResults: {
name?: string;
}[]) => boolean;
export declare const determineStatus: (testResult: Pick<ReporterTestResult, 'status' | 'error' | 'imagesInfo'>) => TestStatus;
export declare const isBase64Image: (image: ImageFile | ImageBuffer | ImageBase64 | null | undefined) => image is ImageBase64;
export declare const isUrl: (str: string) => boolean;
export declare const fetchFile: <T = unknown>(url: string, options?: AxiosRequestConfig) => Promise<{
data: T | null;
status: number;
}>;
export declare const normalizeUrls: (urls: string[] | undefined, baseUrl: string) => string[];
export declare const isCheckboxChecked: (status: number) => boolean;
export declare const isCheckboxIndeterminate: (status: number) => boolean;
export declare const isCheckboxUnchecked: (status: number) => boolean;
export declare const getToggledCheckboxState: (status: number) => CheckStatus;
export declare function getDetailsFileName(testId: string, browserId: string, attempt: number): string;
export declare const getTestHash: (testResult: ReporterTestResult) => string;
export declare const isImageBufferData: (imageData: ImageBuffer | ImageFile | ImageBase64 | undefined) => imageData is ImageBuffer;
export declare const isImageInfoWithState: (imageInfo: ImageInfoFull) => imageInfo is ImageInfoWithState;
export declare const trimArray: <T>(array: T[]) => T[];
export declare const mergeSnippetIntoErrorStack: <T extends Error>(error: T & {
snippet?: string | undefined;
}) => T;