Skip to content

Conversation

@mxschmitt
Copy link
Contributor

Addresses the comments from microsoft/playwright-python#2885 (review).

@mxschmitt mxschmitt force-pushed the improve-trace-viewer-tests branch from 229eb3e to e57d0af Compare June 12, 2025 10:10
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the improve-trace-viewer-tests branch from e57d0af to 9afd65f Compare June 12, 2025 12:43
@github-actions

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the improve-trace-viewer-tests branch from 9afd65f to 77533e8 Compare June 12, 2025 21:55
@github-actions

This comment has been minimized.

@mxschmitt mxschmitt requested a review from dgozman June 12, 2025 22:57
@step
async selectAction(title: string, ordinal: number = 0) {
await this.page.locator(`.action-title:has-text("${title}")`).nth(ordinal).click();
await this.actionsTree.getByTitle(title).nth(ordinal).click();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not getByRole('treeitem', { name: title }) as in previous method?

Copy link
Contributor Author

@mxschmitt mxschmitt Jun 13, 2025

Choose a reason for hiding this comment

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

The issue is that we have a nested 'treeitem' - so if we don't make it narrower, it clicks in the middle of the 3 items vs. on the page.goto treeitem which is what we want. Do you have a better alternative in mind?

Screenshot 2025-06-13 at 12 56 04

@github-actions

This comment has been minimized.

@mxschmitt mxschmitt requested a review from dgozman June 13, 2025 12:28
}

stackFrames(selected?: boolean) {
const entry = this.page.getByRole('list', { name: 'Stack trace' }).getByRole('listitem');
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, we pass { selected } into getByRole. Perhaps we are missing aria-selected somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aria-selected is unfortunately not valid on listitems: https://www.w3.org/TR/wai-aria-1.2/#aria-selected

We then throw that its not valid (we add aria-listed on the listitem).

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting 😄 I guess it should be aria-current then, but we don't have an option for this in getByRole().

mxschmitt and others added 2 commits June 16, 2025 16:22
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
Signed-off-by: Max Schmitt <max@schmitt.mx>
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Test results for "tests 1"

2 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104:3 › should work with strict CSP policy @firefox-ubuntu-22.04-node18

39405 passed, 822 skipped
✔️✔️✔️

Merge workflow run.

@mxschmitt mxschmitt merged commit 1072d14 into microsoft:main Jun 16, 2025
29 checks passed
@mxschmitt mxschmitt deleted the improve-trace-viewer-tests branch June 16, 2025 15:24
whazor pushed a commit to whazor/playwright-trace-viewer-plus that referenced this pull request Jan 10, 2026
Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
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