@chtsinc/ch-playwright-report
Version:
Custom Playwright Reporter that logs test and execution results to MongoDB
26 lines (25 loc) • 1.73 kB
TypeScript
import { AttachmentOption } from "@chtsinc/ch-emailer";
import { ExecutionReport } from "@chtsinc/ch-javascript-sdk";
import { TestStatusSummaryUtil } from "./test-status-summary-util";
import { ServiceConfig } from "src/reporter-setup/service-config-loader";
export declare class EmailUtil {
static sendEmail(serviceConfig: ServiceConfig, testStatusSummary: TestStatusSummaryUtil, executionReport: ExecutionReport, reportUrl: string, filePaths?: string | string[] | null): Promise<void>;
static emailSubjectWithCurrentDate(report: ExecutionReport | null): string | null;
static formatCurrentDateToTimezone(timezone: string, pattern?: string): string;
static composeEmailSubject(applicationName?: string, _project?: string, suiteName?: string, _siteName?: string, environment?: string, os?: string, browserName?: string, suffix?: string): string;
static emailBody(report: ExecutionReport, testStatusSummary: TestStatusSummaryUtil, reportUrl: string): string | null;
private static composeEmailBody;
static testStatusDistribution(total: number, pass: number, fail: number, skip: number, other: number): Record<string, number>;
static capitalize(word?: string): string | undefined;
static getHeadTag(): string;
static getTopContainerTag(): string;
static getFooterTag(reportUrlTr: string): string;
/**
* Synchronously build an array of AttachmentOption from one or more file paths.
* If no paths are provided, returns an empty array.
*
* @param filePaths - A single file path, an array of file paths, or undefined/null.
* @returns AttachmentOption[]
*/
static attachmentsFromPaths(filePaths?: string | string[] | null): Promise<AttachmentOption[]>;
}