Skip to content

Commit

Permalink
chore: do not show steps in line reporter without tty (#34529)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman authored Jan 29, 2025
1 parent f15171b commit 4b5b326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/playwright/src/reporters/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ class LineReporter extends TerminalReporter {
}

onStepBegin(test: TestCase, result: TestResult, step: TestStep) {
if (step.category === 'test.step')
if (this.screen.isTTY && step.category === 'test.step')
this._updateLine(test, result, step);
}

onStepEnd(test: TestCase, result: TestResult, step: TestStep) {
if (step.category === 'test.step')
if (this.screen.isTTY && step.category === 'test.step')
this._updateLine(test, result, step.parent);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/playwright-test/reporter-line.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ for (const useIntermediateMergeReport of [false, true] as const) {
});
});
`,
}, { reporter: 'line' });
}, { reporter: 'line' }, { PLAYWRIGHT_FORCE_TTY: '1' });
const text = result.output;
expect(text).toContain('[1/1] a.test.ts:3:15 › passes › outer › inner');
expect(result.exitCode).toBe(0);
Expand Down

0 comments on commit 4b5b326

Please sign in to comment.