Commit d3d1545
authored
feat: improve suggested xpath generation logic (#2733)
* feat: adjjust parent node usage for xpath generation
This is better if the parent can be uniquely identified, but potentially worse if not.
* improve semi-unique xpath logic to use the result with smallest index
* allow specifying scope for xpath uniqueness
* WIP trying to use attributes instead of indices for target node
* use attributes for target node when possible
* adjust one test to its original behavior
* revert custom scope in _determineXpathUniqueness since it is unused
* add back accidentally removed test
* add another test to mirror its single parent version
* additional optimizations and 2 more tests
* change tuples to objects
* remove unused param in jsdoc
* formatting & comments
* reuse base class methods
* few more minor adjustments
* update tests again
* use fully unique attributes whenever possible
* clarify comment
* fix formatting
* address comments
* add another safeguard
* address comment
* address comments1 parent 3b92366 commit d3d1545
File tree
3 files changed
+518
-134
lines changed- app/common/renderer/utils/locator-generation
- test/unit/utils-locator-generation
3 files changed
+518
-134
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | | - | |
22 | | - | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | | - | |
38 | | - | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
0 commit comments