Skip to content

Commit 55715c9

Browse files
alb-i986ddavison
authored andcommitted
java: fix camel case in method name numberOfWindowsToBe
Signed-off-by: Daniel Davison <[email protected]>
1 parent e4917b1 commit 55715c9

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,15 @@ public String toString() {
847847
};
848848
}
849849

850+
/**
851+
* @deprecated please use {@link #numberOfWindowsToBe(int)} instead
852+
*/
853+
@Deprecated
850854
public static ExpectedCondition<Boolean> numberOfwindowsToBe(final int expectedNumberOfWindows) {
855+
return numberOfWindowsToBe(expectedNumberOfWindows);
856+
}
857+
858+
public static ExpectedCondition<Boolean> numberOfWindowsToBe(final int expectedNumberOfWindows) {
851859
return new ExpectedCondition<Boolean>() {
852860
@Override
853861
public Boolean apply(WebDriver driver) {

java/client/test/org/openqa/selenium/support/ui/ExpectedConditionsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
import static org.mockito.Mockito.when;
2828
import static org.openqa.selenium.support.ui.ExpectedConditions.elementSelectionStateToBe;
2929
import static org.openqa.selenium.support.ui.ExpectedConditions.not;
30+
import static org.openqa.selenium.support.ui.ExpectedConditions.numberOfWindowsToBe;
3031
import static org.openqa.selenium.support.ui.ExpectedConditions.textToBePresentInElementLocated;
3132
import static org.openqa.selenium.support.ui.ExpectedConditions.urlContains;
3233
import static org.openqa.selenium.support.ui.ExpectedConditions.urlMatches;
3334
import static org.openqa.selenium.support.ui.ExpectedConditions.urlToBe;
3435
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOf;
3536
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfAllElements;
3637
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfAllElementsLocatedBy;
37-
import static org.openqa.selenium.support.ui.ExpectedConditions.numberOfwindowsToBe;
3838

3939
import com.google.common.collect.Lists;
4040
import com.google.common.collect.Sets;
@@ -451,15 +451,15 @@ public void waitingNumberOfWindowsToBeTwoWhenThereAreTwoWindowsOpen() {
451451
Set<String> twoWindowHandles = Sets.newHashSet("w1", "w2");
452452
when(mockDriver.getWindowHandles()).thenReturn(twoWindowHandles);
453453

454-
assertTrue(wait.until(numberOfwindowsToBe(2)));
454+
assertTrue(wait.until(numberOfWindowsToBe(2)));
455455
}
456456

457457
@Test(expected = TimeoutException.class)
458458
public void waitingNumberOfWindowsToBeTwoThrowsTimeoutExceptionWhenThereAreThreeWindowsOpen() {
459459
Set<String> threeWindowHandles = Sets.newHashSet("w1", "w2", "w3");
460460
when(mockDriver.getWindowHandles()).thenReturn(threeWindowHandles);
461461

462-
wait.until(numberOfwindowsToBe(2));
462+
wait.until(numberOfWindowsToBe(2));
463463

464464
// then TimeoutException is thrown
465465
}
@@ -468,7 +468,7 @@ public void waitingNumberOfWindowsToBeTwoThrowsTimeoutExceptionWhenThereAreThree
468468
public void waitingNumberOfWindowsToBeThrowsTimeoutExceptionWhenGetWindowHandlesThrowsWebDriverException() {
469469
when(mockDriver.getWindowHandles()).thenThrow(WebDriverException.class);
470470

471-
wait.until(numberOfwindowsToBe(2));
471+
wait.until(numberOfWindowsToBe(2));
472472

473473
// then TimeoutException is thrown
474474
}

0 commit comments

Comments
 (0)