@chtsinc/ch-playwright-report
Version:
Custom Playwright Reporter that logs test and execution results to MongoDB
23 lines • 985 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionReportUtil = void 0;
const ch_javascript_sdk_1 = require("@chtsinc/ch-javascript-sdk");
class SessionReportUtil {
static createSessionReport(executionContext, sessionId) {
const sessionReport = new ch_javascript_sdk_1.SessionReport(executionContext.executionId, executionContext.subscriptionKey, executionContext.site);
const sessionInfo = new ch_javascript_sdk_1.SessionInfo();
sessionInfo.sessionId = sessionId;
sessionReport.sessionInfo = sessionInfo;
return sessionReport;
}
/**
* Attach a video URL to an existing SessionReport.
* @returns the same SessionReport instance (mutated in place).
*/
static populateSessionReport(videoUrl, report) {
report.sessionInfo.videoUrl = videoUrl;
return report;
}
}
exports.SessionReportUtil = SessionReportUtil;
//# sourceMappingURL=session-report-util.js.map