From 61329a85a7f1cf3470dca36e784e11ab57664d90 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 20 Dec 2024 09:57:51 +0100 Subject: [PATCH] address first part of feedback --- docs/src/test-reporter-api/class-teststep.md | 4 ++-- packages/playwright/src/isomorphic/teleReceiver.ts | 2 +- packages/playwright/src/worker/testInfo.ts | 2 +- packages/playwright/types/testReporter.d.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/test-reporter-api/class-teststep.md b/docs/src/test-reporter-api/class-teststep.md index 4423606498..ef16e4849a 100644 --- a/docs/src/test-reporter-api/class-teststep.md +++ b/docs/src/test-reporter-api/class-teststep.md @@ -51,14 +51,14 @@ Start time of this particular test step. List of steps inside this step. ## property: TestStep.attachments -* since: v1.10 +* since: v1.50 - type: <[Array]<[Object]>> - `name` <[string]> Attachment name. - `contentType` <[string]> Content type of this attachment to properly present in the report, for example `'application/json'` or `'image/png'`. - `path` ?<[string]> Optional path on the filesystem to the attached file. - `body` ?<[Buffer]> Optional attachment body used instead of a file. -The list of files or buffers attached in the step execution through [`property: TestInfo.attachments`]. +The list of files or buffers attached in the step execution through [`method: TestInfo.attach`]. ## property: TestStep.title * since: v1.10 diff --git a/packages/playwright/src/isomorphic/teleReceiver.ts b/packages/playwright/src/isomorphic/teleReceiver.ts index 00e801dd2c..36ef221289 100644 --- a/packages/playwright/src/isomorphic/teleReceiver.ts +++ b/packages/playwright/src/isomorphic/teleReceiver.ts @@ -517,7 +517,7 @@ class TeleTestStep implements reporterTypes.TestStep { duration: number = -1; steps: reporterTypes.TestStep[] = []; attachments: reporterTypes.TestStep['attachments'] = []; - error?: reporterTypes.TestError | undefined; + error: reporterTypes.TestError | undefined; private _startTime: number = 0; _attachmentIndices: number[] = []; diff --git a/packages/playwright/src/worker/testInfo.ts b/packages/playwright/src/worker/testInfo.ts index c45cfc3523..d4fdcb4c9c 100644 --- a/packages/playwright/src/worker/testInfo.ts +++ b/packages/playwright/src/worker/testInfo.ts @@ -239,7 +239,7 @@ export class TestInfoImpl implements TestInfo { } } - _parentStep() { + private _parentStep() { return zones.zoneData('stepZone') ?? this._findLastStageStep(this._steps); // If no parent step on stack, assume the current stage as parent. } diff --git a/packages/playwright/types/testReporter.d.ts b/packages/playwright/types/testReporter.d.ts index d13b297a88..3f3a43984e 100644 --- a/packages/playwright/types/testReporter.d.ts +++ b/packages/playwright/types/testReporter.d.ts @@ -693,7 +693,7 @@ export interface TestStep { /** * The list of files or buffers attached in the step execution through - * [testInfo.attachments](https://playwright.dev/docs/api/class-testinfo#test-info-attachments). + * [testInfo.attach(name[, options])](https://playwright.dev/docs/api/class-testinfo#test-info-attach). */ attachments: Array<{ /**