Skip to content

Commit 7da095c

Browse files
committed
test: update Stack trace locator for new listbox/option roles
Upstream switched ListView's ARIA roles from list/listitem to listbox/option (microsoft/playwright#40393), so the trace viewer's stack-trace sidebar no longer matches the old locator. Also align the async fixture's aria-label casing with the actual 'Stack trace' label.
1 parent 487e4cc commit 7da095c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

tests/async/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def action_titles(self) -> Locator:
153153

154154
@property
155155
def stack_frames(self) -> Locator:
156-
return self.page.get_by_role("list", name="Stack Trace").get_by_role("listitem")
156+
return self.page.get_by_role("listbox", name="Stack trace").get_by_role(
157+
"option"
158+
)
157159

158160
async def select_action(self, title: str, ordinal: int = 0) -> None:
159161
await self.page.locator(".action-title", has_text=title).nth(ordinal).click()

tests/sync/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ def action_titles(self) -> Locator:
143143

144144
@property
145145
def stack_frames(self) -> Locator:
146-
return self.page.get_by_role("list", name="Stack trace").get_by_role("listitem")
146+
return self.page.get_by_role("listbox", name="Stack trace").get_by_role(
147+
"option"
148+
)
147149

148150
def select_action(self, title: str, ordinal: int = 0) -> None:
149151
self.page.locator(".action-title", has_text=title).nth(ordinal).click()

0 commit comments

Comments
 (0)