@estruyf/github-actions-reporter
Advanced tools
@@ -5,2 +5,6 @@ # Changelog | ||
## [1.5.0] | ||
- [#6](https://github.com/estruyf/playwright-github-actions-reporter/issues/6): Included logic to retrieve status from the test case when no results are available | ||
## [1.4.0] | ||
@@ -7,0 +11,0 @@ |
@@ -41,3 +41,2 @@ "use strict"; | ||
const summary_1 = require("@actions/core/lib/summary"); | ||
const path_2 = require("path"); | ||
const fs_1 = require("fs"); | ||
@@ -60,3 +59,3 @@ const getTotalStatus_1 = require("./utils/getTotalStatus"); | ||
if (process.env.NODE_ENV === "development") { | ||
const summaryFile = (0, path_2.join)(__dirname, "../summary.html"); | ||
const summaryFile = (0, path_1.join)(__dirname, "../summary.html"); | ||
if ((0, fs_1.existsSync)(summaryFile)) { | ||
@@ -84,2 +83,5 @@ (0, fs_1.unlinkSync)(summaryFile); | ||
} | ||
if (totalStatus.timedOut > 0) { | ||
headerText.push(`Timed Out: ${totalStatus.timedOut}`); | ||
} | ||
summary.addRaw(headerText.join(` - `)); | ||
@@ -86,0 +88,0 @@ if (this.options.useDetails) { |
@@ -31,3 +31,3 @@ "use strict"; | ||
content.push(`<td>${test.title}</td>`); | ||
content.push(`<td>${(0, getTestStatus_1.getTestStatus)(result)}</td>`); | ||
content.push(`<td>${(0, getTestStatus_1.getTestStatus)(test, result)}</td>`); | ||
content.push(`<td>${result.duration / 1000}s</td>`); | ||
@@ -34,0 +34,0 @@ content.push(`<td>${result.retry}</td>`); |
@@ -10,2 +10,3 @@ "use strict"; | ||
const getTableRows = (tests, showError) => { | ||
var _a; | ||
const convert = new ansi_to_html_1.default(); | ||
@@ -46,11 +47,11 @@ const tableHeaders = [ | ||
{ | ||
data: (0, getTestStatus_1.getTestStatus)(result), | ||
data: (0, getTestStatus_1.getTestStatus)(test, result), | ||
header: false, | ||
}, | ||
{ | ||
data: `${result.duration / 1000}s`, | ||
data: (result === null || result === void 0 ? void 0 : result.duration) ? `${result.duration / 1000}s` : "", | ||
header: false, | ||
}, | ||
{ | ||
data: `${result.retry}`, | ||
data: `${(result === null || result === void 0 ? void 0 : result.retry) || ""}`, | ||
header: false, | ||
@@ -61,3 +62,3 @@ }, | ||
tableRow.push({ | ||
data: result.error && result.error.message | ||
data: (result === null || result === void 0 ? void 0 : result.error) && ((_a = result.error) === null || _a === void 0 ? void 0 : _a.message) | ||
? convert.toHtml(result.error.message) | ||
@@ -64,0 +65,0 @@ : "", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTestStatus = void 0; | ||
const getTestStatus = (result) => { | ||
const getTestOutcome_1 = require("./getTestOutcome"); | ||
const getTestStatus = (test, result) => { | ||
let value = ""; | ||
if (result.status === "passed" && result.retry > 0) { | ||
let status = (0, getTestOutcome_1.getTestOutcome)(test, result); | ||
if (status === "passed" && result.retry > 0) { | ||
value = `⚠️ Pass`; | ||
} | ||
else if (result.status === "passed") { | ||
else if (status === "passed") { | ||
value = "✅ Pass"; | ||
} | ||
else if (result.status === "skipped") { | ||
else if (status === "skipped") { | ||
value = `⚠️ Skipped`; | ||
@@ -14,0 +16,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTotalStatus = void 0; | ||
const getTestOutcome_1 = require("./getTestOutcome"); | ||
const getTotalStatus = (suites) => { | ||
@@ -9,2 +10,3 @@ let total = { | ||
skipped: 0, | ||
timedOut: 0, | ||
}; | ||
@@ -14,3 +16,3 @@ for (const suite of suites) { | ||
const lastResult = test.results[test.results.length - 1]; | ||
return lastResult.status; | ||
return (0, getTestOutcome_1.getTestOutcome)(test, lastResult); | ||
}); | ||
@@ -27,2 +29,5 @@ for (const outcome of testOutcome) { | ||
} | ||
else if (outcome === "timedOut") { | ||
total.timedOut++; | ||
} | ||
} | ||
@@ -29,0 +34,0 @@ } |
{ | ||
"name": "@estruyf/github-actions-reporter", | ||
"version": "1.4.0", | ||
"version": "1.5.0-beta.7972167", | ||
"description": "GitHub Actions reporter for Playwright", | ||
@@ -33,4 +33,5 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@playwright/test": "^1.37.0", | ||
"@playwright/test": "^1.41.2", | ||
"@tsconfig/recommended": "^1.0.2", | ||
"@types/node": "^18.19.17", | ||
"typescript": "^5.1.6" | ||
@@ -43,4 +44,4 @@ }, | ||
"peerDependencies": { | ||
"@playwright/test": "^1.37.0" | ||
"@playwright/test": "^1.41.2" | ||
} | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17719
8.95%11
10%339
9.35%4
33.33%1
Infinity%