UNPKG

e2ed

Version:

E2E testing framework over Playwright

37 lines (36 loc) 1.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TestRunDetails = void 0; const assertValueIsDefined_1 = require("../assertValueIsDefined"); const groupLogEvents_1 = require("../groupLogEvents"); const Steps_1 = require("./Steps"); const TestRunDescription_1 = require("./TestRunDescription"); const TestRunError_1 = require("./TestRunError"); const assertValueIsDefined = assertValueIsDefined_1.assertValueIsDefined; const groupLogEvents = groupLogEvents_1.groupLogEvents; const Steps = Steps_1.Steps; const TestRunDescription = TestRunDescription_1.TestRunDescription; const TestRunError = TestRunError_1.TestRunError; /** * Renders test run details for report. * This base client function should not use scope variables (except other base functions). * @internal */ const TestRunDetails = ({ fullTestRun }) => { const { endTimeInMs, filePath, logEvents, name, runError, status } = fullTestRun; const { locator } = reportClientState; const firstStatusString = status[0]; assertValueIsDefined(firstStatusString); const capitalizedStatus = `${firstStatusString.toUpperCase()}${status.slice(1)}`; const logEventsWithChildren = groupLogEvents(logEvents); return (jsx.createElement("article", { class: "test-details" }, jsx.createElement("p", { class: "test-details__path" }, filePath), jsx.createElement("h2", { class: "test-details__title", ...locator('test-details-title', { capitalizedStatus }) }, jsx.createElement("span", { class: "color-cell", "data-status": status }, capitalizedStatus), name), jsx.createElement(TestRunDescription, { fullTestRun: fullTestRun }), jsx.createElement(TestRunError, { runError: runError }), jsx.createElement("h4", { class: "test-details__retry-title" }, "Execution"), jsx.createElement(Steps, { endTimeInMs: endTimeInMs, isRoot: true, logEvents: logEventsWithChildren }))); }; exports.TestRunDetails = TestRunDetails;