Skip to content

Commit 4b5b326

Browse files
authored
chore: do not show steps in line reporter without tty (#34529)
1 parent f15171b commit 4b5b326

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/playwright/src/reporters/line.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class LineReporter extends TerminalReporter {
6868
}
6969

7070
onStepBegin(test: TestCase, result: TestResult, step: TestStep) {
71-
if (step.category === 'test.step')
71+
if (this.screen.isTTY && step.category === 'test.step')
7272
this._updateLine(test, result, step);
7373
}
7474

7575
onStepEnd(test: TestCase, result: TestResult, step: TestStep) {
76-
if (step.category === 'test.step')
76+
if (this.screen.isTTY && step.category === 'test.step')
7777
this._updateLine(test, result, step.parent);
7878
}
7979

tests/playwright-test/reporter-line.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ for (const useIntermediateMergeReport of [false, true] as const) {
125125
});
126126
});
127127
`,
128-
}, { reporter: 'line' });
128+
}, { reporter: 'line' }, { PLAYWRIGHT_FORCE_TTY: '1' });
129129
const text = result.output;
130130
expect(text).toContain('[1/1] a.test.ts:3:15 › passes › outer › inner');
131131
expect(result.exitCode).toBe(0);

0 commit comments

Comments
 (0)