Skip to content

Conversation

@agg23
Copy link
Contributor

@agg23 agg23 commented Feb 18, 2025

Prints a warning when a Playwright API promise that is expected to always be awaited is never attached to by the end of the test run. This warning is managed via a normal test annotation.

This could follow in a separate PR, but at the time of writing this PR includes changes to the various terminal reporters to display warnings (annotations with type: 'warning'), grouping them by warning type. The HTML reporter doesn't have any special handling; it displays like a normal annotation right now, though we will likely change this in the future.

Screenshot 2025-02-14 at 10 07 17 AM

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

return testInfo._wrapPromiseAPIResult(this._stepInternal(expectation, testInfo, title, body, options));
}

async _stepInternal<T>(expectation: 'pass'|'skip', testInfo: TestInfoImpl, title: string, body: (step: TestStepInfo) => T | Promise<T>, options: {box?: boolean, location?: Location, timeout?: number } = {}): Promise<T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code in /common/* should not accept TestInfoImpl that only exists in /worker/ process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by this statement. We're already directly referencing TestInfoImpl a few lines above: https://github.com/microsoft/playwright/blob/main/packages/playwright/src/common/testType.ts#L251. That doesn't have an explicit type, but the original _step method consumes the type as an argument to body.

@agg23 agg23 requested a review from pavelfeldman February 19, 2025 14:17
@github-actions
Copy link
Contributor

Test results for "tests 1"

10 flaky ⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:403:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › tests/ui-mode-test-ct.spec.ts:188:5 › should watch component @macos-latest-node18-1
⚠️ [playwright-test] › tests/ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node18-1
⚠️ [webkit-library] › tests/library/trace-viewer.spec.ts:413:1 › should filter network requests by url @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/trace-viewer.spec.ts:1191:1 › should open trace-1.31 @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › tests/library/tracing.spec.ts:67:5 › should use the correct apiName for event driven callbacks @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-screenshot.spec.ts:364:5 › page screenshot › path option should work @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-screenshot.spec.ts:372:5 › page screenshot › path option should create subdirectories @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-screenshot.spec.ts:433:5 › page screenshot › should take fullPage screenshots during navigation @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-set-input-files.spec.ts:204:5 › should upload large file with relative path @webkit-ubuntu-22.04-node18

38623 passed, 794 skipped
✔️✔️✔️

Merge workflow run.

@agg23 agg23 merged commit f5b8cca into microsoft:main Feb 19, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants