-
-
Notifications
You must be signed in to change notification settings - Fork 90
Add relative locator type for web elements #5468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
import java.util.regex.Pattern; | ||
import java.util.stream.Stream; | ||
|
||
public final class RelativeLocatorUtils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
|
||
for (Map.Entry<String, String> relativeLocator : getRelativeLocators(relativePart).entrySet()) | ||
{ | ||
RelativeElementPosition relativeElementPosition = findRelativePosition(relativeLocator.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic happens here
public By buildBy(String value) | ||
{ | ||
By relativeLocator = RelativeLocatorUtils.convertRelativeStringToBy(value); | ||
return By.xpath("./div"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:O
Then number of elements found by `id(block2)` is = `1` | ||
Then number of elements found by `relative(id(block1)>>toRightOf(id(block2)))` is = `0` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5468 +/- ##
============================================
+ Coverage 97.69% 97.71% +0.01%
- Complexity 7312 7350 +38
============================================
Files 984 986 +2
Lines 20536 20668 +132
Branches 1344 1361 +17
============================================
+ Hits 20062 20195 +133
Misses 362 362
+ Partials 112 111 -1 ☔ View full report in Codecov by Sentry. |
6eeb495
to
b2d641f
Compare
|Locates elements matching xpath `//div` and placed *to the left of* relative element with id = right_block | ||
|
||
|`toRightOf` | ||
|relative(xpath(//div)>>toLeftOf(id(left_block))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|relative(xpath(//div)>>toLeftOf(id(left_block))) | |
|relative(xpath(//div)>>toRightOf(id(right_block))) |
|
||
|`nearXpx` | ||
|relative(xpath(//div)>>near200px(id(distant_block))) | ||
|Provide possibility to configure max distance between near elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow the same to describe examples
</property> | ||
<property name="baseValidations"> | ||
<bean class="org.vividus.steps.ui.validation.BaseValidations" /> | ||
</property> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use constructor-based injection
21c234e
to
44aa819
Compare
44aa819
to
0d11047
Compare
No description provided.