Skip to content

Commit e377b92

Browse files
committed
Ensure we append text to the end of content editables.
1 parent 4be56fb commit e377b92

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

common/src/web/content-editable.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Testing content editable</title>
5+
</head>
6+
<body>
7+
<div id="editable" contenteditable="true">
8+
Why <span>hello</span>
9+
</div>
10+
</body>
11+
</html>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,15 @@ public void canClearNumberInputAfterTypingInvalidInput() {
670670
assertEquals("3", input.getAttribute("value"));
671671
}
672672

673+
@Test
674+
@NotYetImplemented
675+
public void appendsTextToEndOfContentEditableWithMultipleTextNodes() {
676+
driver.get(appServer.whereIs("content-editable.html"));
677+
WebElement input = driver.findElement(By.id("editable"));
678+
input.sendKeys(", world!");
679+
assertEquals("Why hello, world!", input.getText());
680+
}
681+
673682
private static String getValueText(WebElement el) {
674683
// Standardize on \n and strip any trailing whitespace.
675684
return el.getAttribute("value").replace("\r\n", "\n").trim();

0 commit comments

Comments
 (0)