diff --git a/src/reporters/utils/helpers.js b/src/reporters/utils/helpers.js index 45b595a6b..8496997d1 100644 --- a/src/reporters/utils/helpers.js +++ b/src/reporters/utils/helpers.js @@ -23,10 +23,11 @@ exports.formatTestInfo = test => { const suiteName = test.fullTitle().replace(test.title, ""); const sessionId = test.sessionId ? `:${test.sessionId}` : ""; const reason = test.pending && ` reason: ${chalk.red(getSkipReason(test) || "no comment")}`; + const pid = test.meta?.pid ? `, pid:${test.meta.pid}` : ""; return ( ` ${suiteName}${chalk.underline(test.title)} [${chalk.yellow(test.browserId)}` + - `${sessionId}] - ${chalk.cyan(test.duration || 0)}ms${reason || ""}` + `${sessionId}${pid}] - ${chalk.cyan(test.duration || 0)}ms${reason || ""}` ); }; diff --git a/test/src/reporters/flat.js b/test/src/reporters/flat.js index aeb6e9c07..946eec32f 100644 --- a/test/src/reporters/flat.js +++ b/test/src/reporters/flat.js @@ -102,15 +102,26 @@ describe("Flat reporter", () => { TEST_FAIL: "failed", }; - it("should correctly do the rendering", async () => { - test = mkTestStub_({ sessionId: "test_session" }); + it("should render session id", async () => { + test = mkTestStub_({ sessionId: "500100" }); await createFlatReporter(); emit(RunnerEvents.TEST_PASS, test); const result = getDeserializedResult(informer.log.firstCall.args[0]); - assert.equal(result, "suite test [chrome:test_session] - 100500ms"); + assert.equal(result, "suite test [chrome:500100] - 100500ms"); + }); + + it("should render pid", async () => { + test = mkTestStub_({ meta: { pid: "12345" } }); + + await createFlatReporter(); + emit(RunnerEvents.TEST_PASS, test); + + const result = getDeserializedResult(informer.log.firstCall.args[0]); + + assert.equal(result, "suite test [chrome, pid:12345] - 100500ms"); }); describe("skipped tests report", () => {