Skip to content

Commit b68d023

Browse files
author
travis-ci
committed
Fixing a small defect in tolent radio button
1 parent ef58711 commit b68d023

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ submit an issue ticket.
3838
## Documentation
3939

4040
- A full reference guide is here: https://github.com/digital-delivery-academy/selenium-pom-framework/wiki
41-
- Technical reference documentation (javadocs) are here: https://digital-delivery-academy.github.io/selenium-pom-framework/javadoc-0.0.10
41+
- Technical reference documentation (javadocs) are here: https://digital-delivery-academy.github.io/selenium-pom-framework/javadoc-0.0.11
4242

4343
## Example tests
4444

@@ -52,7 +52,7 @@ Put this in your POM.xml.
5252
<dependency>
5353
<groupId>uk.co.evoco</groupId>
5454
<artifactId>selenium-pom-framework</artifactId>
55-
<version>0.0.10</version>
55+
<version>0.0.11</version>
5656
</dependency>
5757
```
5858

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>uk.co.evoco</groupId>
88
<artifactId>selenium-pom-framework</artifactId>
9-
<version>0.0.10</version>
9+
<version>0.0.11</version>
1010

1111
<contributors>
1212
<contributor>

src/main/java/uk/co/evoco/webdriver/utils/RadioButtonUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public static void selectByLabel(List<WebElement> webElements, String visibleLab
3333
*/
3434
public static void tolerantSelectByLabel(List<WebElement> webElements, String visibleLabelText, int timeout)
3535
throws Throwable {
36-
new RadioButtonUtils().tolerantInteraction(webElements, visibleLabelText, timeout).click();
36+
new RadioButtonUtils().tolerantInteraction(webElements, visibleLabelText, timeout);
3737
}
3838
}

src/main/java/uk/co/evoco/webdriver/utils/SelectBoxUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public static void tolerantItemByVisibleText(WebElement webElement, String visi
7070
webElement, SelectBoxInteractionType.BY_VISIBLE_TEXT,
7171
Optional.of(visibleText), Optional.empty(), timeout);
7272
}
73+
7374
/**
7475
*
7576
* @param webElement active WebElement, already located

src/test/java/uk/co/evoco/webdriver/utils/WebDriverUtilsIT.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
import org.junit.jupiter.api.BeforeEach;
66
import org.junit.jupiter.api.Test;
77
import org.openqa.selenium.By;
8+
import org.openqa.selenium.StaleElementReferenceException;
9+
import org.openqa.selenium.TimeoutException;
810
import org.openqa.selenium.WebElement;
911
import uk.co.evoco.tests.BaseAbstractTest;
1012

1113
import static org.hamcrest.CoreMatchers.is;
1214
import static org.hamcrest.MatcherAssert.assertThat;
15+
import static org.junit.jupiter.api.Assertions.assertThrows;
1316

1417
public class WebDriverUtilsIT extends BaseAbstractTest {
1518

@@ -90,4 +93,12 @@ public void testCanClickOnHrefWithTolerantPollingWaitBeforeClickingHelperWhenEle
9093
ClickUtils.tolerantClick(element, 30);
9194
assertThat(webDriver.getCurrentUrl(), is("http://localhost:4442/hello-passed.html"));
9295
}
96+
97+
@Test
98+
public void testCanClickOnHrefWithTolerantPollingWaitBeforeClickingHelperWhenElementIsDisabledAllTheTime() {
99+
assertThrows(TimeoutException.class, () -> {
100+
WebElement element = webDriver.findElement(By.id("clickutils-href-always-disabled"));
101+
ClickUtils.tolerantClick(element, 5);
102+
});
103+
}
93104
}

src/test/resources/www/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
setTimeout(function() {
88
document.getElementById("clickutils-href-disabled").disabled = false;
99
}, 10000);
10+
setTimeout(function() {
11+
document.getElementById("clickutils-staleelement").innerText("Text value has changed");
12+
}, 1000);
1013
});
1114
</script>
1215
</head>
@@ -40,7 +43,9 @@
4043
</div>
4144
<div id="ClickUtils-elements">
4245
<a href="/hello-passed.html" id="clickutils-href">Click me</a>
43-
<button onclick="window.location.href = '/hello-passed.html';" href="/hello-passed.html" id="clickutils-href-disabled" disabled>Click me</button>
46+
<button onclick="window.location.href = '/hello-passed.html';" id="clickutils-href-disabled" disabled>Click me</button>
47+
<button onclick="window.location.href = '/hello-passed.html';" id="clickutils-href-always-disabled" disabled>Click me</button>
48+
<button onclick="window.location.href = '/hello-passed.html';" id="clickutils-staleelement">Click me</button>
4449
</div>
4550
<div id="WindowUtils-elements">
4651
<a id="out-of-viewport-link" href="hello-passed.html" stype="margin-top:2000px;">Link out of viewport on page load</a>

0 commit comments

Comments
 (0)