Skip to content

Commit 9a63b24

Browse files
miraoclaude
andcommitted
test: add acceptance test for locate().at().find() inside within() (#5473)
Adds a Playwright acceptance test that verifies XPath from locate().at().find() is correctly scoped when used inside within(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0397204 commit 9a63b24

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

test/acceptance/within_test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
Feature('within', { retries: 3 })
22

3+
Scenario('within with locate().at().find() should scope XPath @Playwright', async ({ I }) => {
4+
I.amOnPage('/form/bug5473')
5+
await within('#list2', async () => {
6+
await I.see('Second', locate('.item').at(1).find('.label'))
7+
})
8+
})
9+
310
Scenario('within on form @WebDriverIO @Puppeteer @Playwright', async ({ I }) => {
411
I.amOnPage('/form/bug1467')
512
I.see('TEST TEST')
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html>
3+
<head><title>within + locate().at() bug</title></head>
4+
<body>
5+
<div id="outer">
6+
<ul id="list1">
7+
<li class="item"><span class="label">First</span></li>
8+
</ul>
9+
<ul id="list2">
10+
<li class="item"><span class="label">Second</span></li>
11+
</ul>
12+
</div>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)