UNPKG

@allurereport/plugin-classic

Version:

The classic version of Allure HTML report

51 lines (50 loc) 1.24 kB
const mapLabelsByName = (labels) => { return labels.reduce((acc, { name, value }) => { acc[name] = acc[name] || []; if (value) { acc[name].push(value); } return acc; }, {}); }; export const convertTestResult = (tr) => { return { id: tr.id, name: tr.name, start: tr.start, stop: tr.stop, duration: tr.duration, status: tr.status, fullName: tr.fullName, historyId: tr.historyId, flaky: tr.flaky, muted: tr.muted, known: tr.known, hidden: tr.hidden, labels: tr.labels, groupedLabels: mapLabelsByName(tr.labels), parameters: tr.parameters, links: tr.links, steps: tr.steps, error: tr.error, setup: [], teardown: [], history: [], retries: [], breadcrumbs: [], retry: false, }; }; export const convertTestStepResult = (tsr) => { return tsr; }; export const convertFixtureResult = (fr) => { return { id: fr.id, type: fr.type, name: fr.name, status: fr.status, steps: fr.steps.map(convertTestStepResult), duration: fr.duration, }; };