@estruyf/github-actions-reporter
Version:
GitHub Actions reporter for Playwright
19 lines (18 loc) • 650 B
JavaScript
import { getTotalStatus } from "./getTotalStatus.js";
export const getSummaryDetails = (suite) => {
const totalStatus = getTotalStatus(suite.suites);
const headerText = [`Total tests: ${suite.allTests().length}`];
if (totalStatus.passed > 0) {
headerText.push(`Passed: ${totalStatus.passed}`);
}
if (totalStatus.failed > 0) {
headerText.push(`Failed: ${totalStatus.failed}`);
}
if (totalStatus.skipped > 0) {
headerText.push(`Skipped: ${totalStatus.skipped}`);
}
if (totalStatus.timedOut > 0) {
headerText.push(`Timed Out: ${totalStatus.timedOut}`);
}
return headerText;
};