odhin-reports-playwright
Version:
Odhin Reports for Playwright
50 lines (49 loc) • 1.72 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const generate_1 = __importDefault(require("./generate"));
class OdhinPlaywrightReporter {
constructor(execOptions) {
this.generate = new generate_1.default(execOptions);
}
async onBegin(config, suite) {
await this.generate.onBegin(config, suite);
}
async onTestEnd(testCase, result) {
await this.generate.onTestEnd({
id: testCase.id,
title: testCase.title,
filename: testCase["_requireFile"],
projectId: testCase["_projectId"],
projectInfo: testCase.parent.parent !== undefined,
retries: testCase.parent["_entries"][0].retries,
tags: testCase["_tags"],
annotations: testCase.annotations,
titlePath: testCase.titlePath(),
}, {
duration: result.duration,
status: result.status.toString(),
retry: result.retry,
startTime: result.startTime,
parallelIndex: result.parallelIndex,
errors: result.errors,
stderr: result.stderr,
stdout: result.stdout,
steps: result.steps,
attachments: result.attachments,
workerIndex: result.workerIndex,
});
}
async onEnd() {
await this.generate.onEnd();
}
async onStdOut(chunk) {
await this.generate.onStdOut(chunk);
}
async onStdErr(chunk) {
await this.generate.onStdErr(chunk);
}
}
exports.default = OdhinPlaywrightReporter;