Commit c61c2e5
fix: make XPath relative in buildLocatorString for within() scope (#5474)
* fix: make XPath relative in buildLocatorString for within() scope (#5473)
Playwright's XPath engine auto-converts "//..." to ".//..." when searching
within an element, but only when the selector starts with "/". Locator methods
like at(), first(), last() wrap XPath in parentheses (e.g. "(//...)[position()=1]"),
bypassing that auto-conversion and causing XPath to search from the document root
instead of the within() scope.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* 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>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent aec3876 commit c61c2e5
File tree
4 files changed
+78
-2
lines changed- lib/helper
- test
- acceptance
- data/app/view/form
- unit/helper
4 files changed
+78
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4157 | 4157 | | |
4158 | 4158 | | |
4159 | 4159 | | |
4160 | | - | |
| 4160 | + | |
4161 | 4161 | | |
4162 | | - | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
4163 | 4169 | | |
4164 | 4170 | | |
4165 | 4171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
0 commit comments