Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/cli/src/commands/pw-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ export default class PwTestCommand extends AuthCommand {
return
}

const reporters = createReporters(reporterTypes, location, verboseFlag)
const reporters = createReporters(reporterTypes, location, verboseFlag, {
showStreamingHeaders: false,
})
const repoInfo = getGitInformation(project.repoUrl)
const ciInfo = getCiInformation()
// TODO: ADD PROPER RETRY STRATEGY HANDLING
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/reporters/abstract-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ export default abstract class AbstractListReporter implements Reporter {
verbose: boolean
testSessionId?: string
_isSchedulingDelayExceeded?: boolean
showStreamingHeaders: boolean

constructor (
runLocation: RunLocation,
verbose: boolean,
options: { showStreamingHeaders?: boolean } = {},
) {
this.runLocation = runLocation
this.verbose = verbose
this.showStreamingHeaders = options.showStreamingHeaders ?? true
}

onBegin (checks: Array<{ check: any, sequenceId: SequenceId }>, testSessionId?: string): void {
Expand Down Expand Up @@ -114,7 +117,7 @@ export default abstract class AbstractListReporter implements Reporter {
// Display the check title if this is the first time we're streaming logs for this check
const isFirstLogBatch = !checkFile.hasStreamedLogs
checkFile.hasStreamedLogs = true
if (isFirstLogBatch) {
if (isFirstLogBatch && this.showStreamingHeaders) {
// For Playwright tests, we need to create a better display name
const displayCheck = {
...check,
Expand Down
17 changes: 11 additions & 6 deletions packages/cli/src/reporters/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,28 @@ export interface Reporter {

export type ReporterType = 'list' | 'dot' | 'ci' | 'github' | 'json'

export type ReporterOptions = {
showStreamingHeaders?: boolean
}

export const createReporters = (
types: ReporterType[],
runLocation: RunLocation,
verbose: boolean,
options: ReporterOptions = {},
): Reporter[] => types.map(t => {
switch (t) {
case 'dot':
return new DotReporter(runLocation, verbose)
return new DotReporter(runLocation, verbose, options)
case 'list':
return new ListReporter(runLocation, verbose)
return new ListReporter(runLocation, verbose, options)
case 'ci':
return new CiReporter(runLocation, verbose)
return new CiReporter(runLocation, verbose, options)
case 'github':
return new GithubReporter(runLocation, verbose)
return new GithubReporter(runLocation, verbose, options)
case 'json':
return new JsonReporter(runLocation, verbose)
return new JsonReporter(runLocation, verbose, options)
default:
return new ListReporter(runLocation, verbose)
return new ListReporter(runLocation, verbose, options)
}
})