Exemplo n.º 1
0
 private void setTargetContent(
     final long rowIndex, final String text, final String idFormat, final Plurals plural) {
   WebElement we = readyElement(By.id(String.format(idFormat, rowIndex, plural.index())));
   we.click();
   we.clear();
   we.sendKeys(text);
 }
Exemplo n.º 2
0
 private String getCodeMirrorContent(
     final long rowIndex, final String idFormat, final Plurals plurals) {
   return waitForAMoment()
       .until(
           (Function<WebDriver, String>)
               webDriver -> {
                 // code mirror will turn text into list of <pre>.
                 List<WebElement> cmTextLines =
                     webDriver
                         .findElement(By.id(String.format(idFormat, rowIndex, plurals.index())))
                         .findElements(By.tagName("pre"));
                 List<String> contents = WebElementUtil.elementsToText(cmTextLines);
                 return Joiner.on("\n").skipNulls().join(contents);
               });
 }
Exemplo n.º 3
0
 private String getContentAtRowIndex(
     final long rowIndex, final String idFormat, final Plurals plural) {
   return readyElement(By.id(String.format(idFormat, rowIndex, plural.index())))
       .getAttribute("value");
 }