Skip to content

Commit 4e59691

Browse files
committed
Adding a test for click to an element partially (>50%) hidden by overflow
1 parent 18791bd commit 4e59691

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Page with partially hidden element</title>
5+
</head>
6+
<body>
7+
<div style="width:200px; height: 200px; overflow: auto;">
8+
<div style="height: 175px; width: 240px;">Placeholder</div>
9+
<div>
10+
<button type="button" style="height: 40px; box-sizing: border-box" id="btn" onclick="window.location='target_page.html'">Click me!</button>
11+
</div>
12+
</div>
13+
</body>
14+
</html>

java/client/test/org/openqa/selenium/ClickScrollingTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
2929
import static org.openqa.selenium.testing.Driver.ALL;
3030
import static org.openqa.selenium.testing.Driver.CHROME;
31+
import static org.openqa.selenium.testing.Driver.FIREFOX;
3132
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
3233
import static org.openqa.selenium.testing.Driver.IE;
3334
import static org.openqa.selenium.testing.Driver.MARIONETTE;
@@ -105,6 +106,18 @@ public void testShouldBeAbleToClickOnAnElementHiddenByYOverflow() {
105106
wait.until(titleIs("Clicked Successfully!"));
106107
}
107108

109+
@Test
110+
@Ignore(IE)
111+
@Ignore(FIREFOX)
112+
@Ignore(MARIONETTE)
113+
@Ignore(value = SAFARI, reason = "not tested")
114+
public void testShouldBeAbleToClickOnAnElementPartiallyHiddenByOverflow() {
115+
driver.get(appServer.whereIs("scrolling_tests/page_with_partially_hidden_element.html"));
116+
117+
driver.findElement(By.id("btn")).click();
118+
wait.until(titleIs("Clicked Successfully!"));
119+
}
120+
108121
@Test
109122
public void testShouldNotScrollOverflowElementsWhichAreVisible() {
110123
driver.get(appServer.whereIs("scroll2.html"));

0 commit comments

Comments
 (0)