コード例 #1
0
  public List<String> getProjectNamesOnCurrentPage() {
    if (mainContentDiv.getText().contains("No project exists")) {
      return Collections.emptyList();
    }

    return WebElementUtil.getColumnContents(getDriver(), projectTableBy, PROJECT_NAME_COLUMN);
  }
コード例 #2
0
 public List<String> getRulesByPattern() {
   log.info("Query role rules");
   List<String> ret = new ArrayList<>();
   List<String> names = WebElementUtil.elementsToText(getDriver(), roleTable);
   for (String name : names) {
     ret.add(name.substring(name.lastIndexOf(':') + 1).trim());
   }
   return ret;
 }
コード例 #3
0
ファイル: EditorPage.java プロジェクト: Halcom/zanata-server
 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);
               });
 }
コード例 #4
0
ファイル: EditorPage.java プロジェクト: Halcom/zanata-server
 /**
  * First row is header: SourceTerm, TargetTerm, Action, Details.
  *
  * @return a table representing the searchResultTable
  */
 public List<List<String>> getGlossaryResultTable() {
   log.info("Query glossary results");
   return waitForAMoment()
       .until(
           (Function<WebDriver, List<List<String>>>)
               webDriver -> {
                 if (webDriver.findElements(glossaryNoResult).size() == 1) {
                   return Collections.emptyList();
                 }
                 List<List<String>> resultTable =
                     WebElementUtil.getTwoDimensionList(webDriver, glossaryTable);
                 log.info("glossary result: {}", resultTable);
                 return resultTable;
               });
 }
コード例 #5
0
 /**
  * Enter text into the language search field
  *
  * @param languageQuery text to search for
  * @return new language settings tab
  */
 public ProjectLanguagesTab enterSearchLanguage(String languageQuery) {
   log.info("Enter language search {}", languageQuery);
   WebElementUtil.searchAutocomplete(getDriver(), "languageAutocomplete", languageQuery);
   return new ProjectLanguagesTab(getDriver());
 }
コード例 #6
0
ファイル: EditorPage.java プロジェクト: Halcom/zanata-server
 public List<String> getMessageSources() {
   log.info("Query list of text flow sources");
   return WebElementUtil.elementsToText(
       readyElement(transUnitTable).findElements(By.className("gwt-HTML")));
 }