Skip to content

Commit 02c4f38

Browse files
committed
[Feature/Add_Relative_Locators] Refactor code
1 parent dd5025d commit 02c4f38

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/main/java/aquality/selenium/locators/RelativeBy.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public RelativeBy toRightOf(By by) {
7777

7878
public RelativeBy near(IElement element) {
7979
by = RelativeLocator.with(by).near(element.getElement());
80-
return new RelativeBy(this.by);
80+
return new RelativeBy(by);
8181
}
8282

8383
public RelativeBy near(WebElement element) {
8484
by = RelativeLocator.with(by).near(element);
85-
return new RelativeBy(this.by);
85+
return new RelativeBy(by);
8686
}
8787

8888
public RelativeBy near(By by) {
@@ -92,12 +92,12 @@ public RelativeBy near(By by) {
9292

9393
public RelativeBy near(IElement element, int atMostDistanceInPixels) {
9494
by = RelativeLocator.with(by).near(element.getElement(), atMostDistanceInPixels);
95-
return new RelativeBy(this.by);
95+
return new RelativeBy(by);
9696
}
9797

9898
public RelativeBy near(WebElement element, int atMostDistanceInPixels) {
9999
by = RelativeLocator.with(by).near(element, atMostDistanceInPixels);
100-
return new RelativeBy(this.by);
100+
return new RelativeBy(by);
101101
}
102102

103103
public RelativeBy near(By by, int atMostDistanceInPixels) {

src/main/java/aquality/selenium/locators/RelativeBySupplier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ public class RelativeBySupplier {
66
public static RelativeBy with(By by) {
77
return new RelativeBy(by);
88
}
9-
}
9+
}

src/test/resources/TestSuite.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<class name="tests.integration.HiddenElementsTests"/>
1313
<class name="aquality.selenium.localization.LocalizationManagerTests"/>
1414
<class name="tests.usecases.TestTimeoutConfiguration"/>
15+
<class name="tests.integration.LocatorTests"/>
1516
</classes>
1617
</test>
1718
<test name="Use cases tests" parallel="methods" thread-count="3">

0 commit comments

Comments
 (0)