Skip to content

Commit

Permalink
Ensure we append text to the end of content editables.
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Aug 17, 2017
1 parent 4be56fb commit e377b92
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common/src/web/content-editable.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Testing content editable</title>
</head>
<body>
<div id="editable" contenteditable="true">
Why <span>hello</span>
</div>
</body>
</html>
9 changes: 9 additions & 0 deletions java/client/test/org/openqa/selenium/TypingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,15 @@ public void canClearNumberInputAfterTypingInvalidInput() {
assertEquals("3", input.getAttribute("value"));
}

@Test
@NotYetImplemented
public void appendsTextToEndOfContentEditableWithMultipleTextNodes() {
driver.get(appServer.whereIs("content-editable.html"));
WebElement input = driver.findElement(By.id("editable"));
input.sendKeys(", world!");
assertEquals("Why hello, world!", input.getText());
}

private static String getValueText(WebElement el) {
// Standardize on \n and strip any trailing whitespace.
return el.getAttribute("value").replace("\r\n", "\n").trim();
Expand Down

0 comments on commit e377b92

Please sign in to comment.