diff --git a/packages/playwright/src/worker/testInfo.ts b/packages/playwright/src/worker/testInfo.ts index 139a134965..08e7972fac 100644 --- a/packages/playwright/src/worker/testInfo.ts +++ b/packages/playwright/src/worker/testInfo.ts @@ -32,7 +32,7 @@ import { testInfoError } from './util'; export interface TestStepInternal { complete(result: { error?: Error | unknown, suggestedRebaseline?: string }): void; - attachmentIndexes: number[]; + attachmentIndices: number[]; stepId: string; title: string; category: 'hook' | 'fixture' | 'test.step' | 'expect' | 'attach' | string; @@ -249,7 +249,7 @@ export class TestInfoImpl implements TestInfo { return zones.zoneData('expectZone')?.stepId; } - _addStep(data: Omit, parentStep?: TestStepInternal): TestStepInternal { + _addStep(data: Omit, parentStep?: TestStepInternal): TestStepInternal { const stepId = `${data.category}@${++this._lastStepId}`; if (data.isStage) { @@ -268,12 +268,12 @@ export class TestInfoImpl implements TestInfo { } data.location = data.location || filteredStack[0]; - const attachmentIndexes: number[] = []; + const attachmentIndices: number[] = []; const step: TestStepInternal = { stepId, ...data, steps: [], - attachmentIndexes, + attachmentIndices, complete: result => { if (step.endWallTime) return; @@ -310,7 +310,7 @@ export class TestInfoImpl implements TestInfo { }; this._onStepEnd(payload); const errorForTrace = step.error ? { name: '', message: step.error.message || '', stack: step.error.stack } : undefined; - const attachments = attachmentIndexes.map(i => this.attachments[i]); + const attachments = attachmentIndices.map(i => this.attachments[i]); this._tracing.appendAfterActionForStep(stepId, errorForTrace, attachments); } }; @@ -422,7 +422,7 @@ export class TestInfoImpl implements TestInfo { private _attach(attachment: TestInfo['attachments'][0], stepId: string | undefined) { const index = this._attachmentsPush(attachment) - 1; if (stepId) - this._stepMap.get(stepId)!.attachmentIndexes.push(index); + this._stepMap.get(stepId)!.attachmentIndices.push(index); this._onAttach({ testId: this.testId, name: attachment.name,