public List<String> getProjectNamesOnCurrentPage() { if (mainContentDiv.getText().contains("No project exists")) { return Collections.emptyList(); } return WebElementUtil.getColumnContents(getDriver(), projectTableBy, PROJECT_NAME_COLUMN); }
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; }
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); }); }
/** * 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; }); }
/** * 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()); }
public List<String> getMessageSources() { log.info("Query list of text flow sources"); return WebElementUtil.elementsToText( readyElement(transUnitTable).findElements(By.className("gwt-HTML"))); }