Skip to content

Conversation

vkepin
Copy link
Contributor

@vkepin vkepin commented Oct 28, 2024

No description provided.

import java.util.regex.Pattern;
import java.util.stream.Stream;

public final class RelativeLocatorUtils
Copy link
Contributor Author

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());
Copy link
Contributor Author

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");
Copy link
Member

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`


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base (1ab7c2a) to head (0d11047).
Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@vkepin vkepin force-pushed the relative_locators branch 3 times, most recently from 6eeb495 to b2d641f Compare November 14, 2024 17:21
@vkepin vkepin marked this pull request as ready for review November 14, 2024 17:52
@vkepin vkepin requested a review from a team as a code owner November 14, 2024 17:52
@vkepin vkepin changed the title [WIP] Init commit Add relative locator type for web elements Nov 15, 2024
@valfirst valfirst requested a review from uarlouski November 22, 2024 15:06
|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)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|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
Copy link
Collaborator

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use constructor-based injection

@vkepin vkepin force-pushed the relative_locators branch from 21c234e to 44aa819 Compare December 2, 2024 14:35
@vkepin vkepin force-pushed the relative_locators branch from 44aa819 to 0d11047 Compare December 3, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants