playwright-bdd
Version:
BDD Testing with Playwright runner
42 lines • 1.86 kB
TypeScript
import { Transform } from 'node:stream';
import * as messages from '@cucumber/messages';
import { CucumberHtmlStream } from '@cucumber/html-formatter';
import BaseReporter, { InternalOptions } from '../base';
import { AttachmentEnvelope } from '../messagesBuilder/types';
import { SkipAttachments } from '../attachments/skip';
type HtmlReporterOptions = {
outputFile?: string;
skipAttachments?: SkipAttachments;
externalAttachments?: boolean;
attachmentsBaseURL?: string;
};
export default class HtmlReporter extends BaseReporter {
protected userOptions: HtmlReporterOptions;
protected htmlStream: CucumberHtmlStream;
protected attachmentsDir: string;
protected attachmentsBaseURL: string;
protected hasTraces: boolean;
protected transformStream: Transform;
protected receivedTestRunFinished: boolean;
constructor(internalOptions: InternalOptions, userOptions?: HtmlReporterOptions);
finished(): Promise<void>;
protected handleAttachment(envelope: AttachmentEnvelope): void;
protected writeEnvelope(envelope: messages.Envelope): void;
/**
* If there is trace attachment, copy trace-viewer to the report
* and create additional attachment with trace view link.
* - implementation in PW: https://github.com/microsoft/playwright/blob/release-1.50/packages/playwright/src/reporters/html.ts#L434
* - attachmentsBaseURL should start with http(s) to be able to show traces.
*/
protected handleTraceAttachment(attachment: messages.Attachment): void;
protected setupAttachmentsDir(): void;
protected setupAttachmentsBaseURL(): void;
private handlePromptAttachment;
/**
* Special transform stream to inject custom script into the HTML.
*/
private createTransformStream;
private injectCustomAssets;
}
export {};
//# sourceMappingURL=index.d.ts.map