public TimedQuery<Iterable<JobDetailsRow>> getJobDetails(final String runnerId) { return Queries.forSupplier(timeouts, new Supplier<Iterable<JobDetailsRow>>() { @Override public Iterable<JobDetailsRow> get() { return PageElements.transform(pageBinder, runnersTable.findAll(By.cssSelector("tr.job-details[data-runner-id='" + runnerId + "']")), JobDetailsRow.class); } }); }
private TimedQuery<Integer> parseIntValue(final PageElement cell) { return Queries.forSupplier(timeouts, new Supplier<Integer>() { @Override public Integer get() { return Integer.parseInt(cell.getText().trim()); } }); }
public TimedQuery<String> getResponse() { return forSupplier(timeouts, new Supplier<String>() { public String get() { return driver.getPageSource(); } }); } }
public TimedQuery<Iterable<AuiMessage>> getMessagesOfType(final AuiMessage.Type type) { return Queries.forSupplier(timeouts, new Supplier<Iterable<AuiMessage>>() { @Override public Iterable<AuiMessage> get() { return Iterables.filter(getAllMessages().now(), AuiMessages.isOfType(type)); } }); }
public TimedQuery<MODE> getModeTimed() { Supplier<MODE> supplier = this::getMode; return Queries.forSupplier(timeouts, supplier); } }
/** * Check if non-inline macro exists in editor panel or not */ public TimedQuery<Boolean> hasMacro(final String macroName, final List<String> macroParameters) { return Queries.forSupplier(timeouts, () -> macroExists(macroName, macroParameters)); }
/** * @since 2.4.0 */ public TimedQuery<Iterable<String>> getVisibleModules() { return Queries.forSupplier(timeouts, () -> { List<WebElement> headers = driver.findElements( By.cssSelector(getSelectorForCurrentPanel() + " .mod-header h3")); return transform(headers, WebElement::getText); }); }
/** * Get attribute by locator */ public TimedQuery<String> getAttribute(final By locator, final String attributeName) { return Queries.forSupplier(timeouts, () -> execute.onTinyMceIFrame(() -> page.find(locator).getAttribute(attributeName).trim())); }
/** * @return a list of links in the current editor. There is no guaranteed ordering and may not appear in page order. * @since 5.8.0 */ public TimedQuery<List<EditorEmbeddedLink>> getAllLinks() { return Queries.forSupplier(timeouts, () -> execute.onTinyMceIFrame(() -> { final Iterable<PageElement> allLinks = page.findAll(By.cssSelector("a[href]")); //this list must not be lazy, since we need to execute it in the context of the editor iframe. return ImmutableList.copyOf(transform(allLinks, toEditorEmbeddedLink())); })); }
/** * @param row is 1 index based * @param column is 1 index based */ public TimedQuery<String> getTimedPageLayoutsCellContent(final int row, final int column) { return Queries.forSupplier(timeouts, () -> execute.onTinyMceIFrame(() -> page.findAll(By.cssSelector(".columnLayout:nth-child(" + (row) + ") .cell .innerCell")).get(column - 1).getText().trim())); }
/** * @return a timed query of the number of results in the recently viewed panel * @since 5.8.0 */ public TimedQuery<Integer> numberRecentlyViewedResults() { return Queries.forSupplier(timeouts, () -> recentlyViewedResults.find(By.tagName("tbody")).findAll(By.tagName("tr")).size()); }
/** * @return the number of results in the quick search dropdown * @since 5.8.0 */ public TimedQuery<Integer> numberOfQuickSearchResults() { waitForQuickSearchToBeVisible(); final By locator = ByJquery.$(".aui-dd-parent.autocomplete .aui-dropdown:visible li"); return Queries.forSupplier(timeouts, () -> getDialog().findAll(locator).size()); }
/** * Waits until a script tag (any script tag) has loaded. Most iframes containing a script tag pointing at all.js * or all-debug.js */ @SuppressWarnings("unchecked") public C waitUntilContentLoaded() { // wait until the remote panel has loaded waitUntilTrue(Queries.forSupplier(new DefaultTimeouts(), () -> withinIFrame(iframe -> !iframe.findElements(By.tagName("script")).isEmpty()))); return (C) this; }
public TimedCondition hasField(String field) { return Conditions.forMatcher(Queries.forSupplier(timeouts, queryForRow(field).supplier()), iterableWithSize(1, PageElement.class)); }
public TimedQuery<Iterable<PageElement>> getVerifyMessages() { return Queries.forSupplier(timeouts, extendedElementFinder.within(pageContent) .newQuery(By.cssSelector("#test-connection-messages div.aui-message")) .supplier()); } }
/** * Returns all the text in the wiki content */ public TimedQuery<String> getTextTimed() { return Queries.forSupplier(timeouts, () -> execute.onTinyMceIFrame(() -> page.find(By.cssSelector(".wiki-content")).getText())); }
public TimedQuery<Iterable<String>> getApplicationRoleNames() { final Supplier<Iterable<String>> namesSupplier = extendedFinder .within(applicationRolesCells) .newQuery(By.tagName("li")) .transform(PageElement::getText) .supplier(); return Queries.forSupplier(timeouts, namesSupplier); }
@SuppressWarnings("unchecked") public C waitUntilContentElementNotEmpty(final String elementId) { this.waitUntilContentLoaded(); // wait until the remote panel has loaded waitUntilTrue(Queries.forSupplier(new DefaultTimeouts(), () -> withinIFrame(iframe -> { String escapedId = AddonTestUtils.escapeJQuerySelector(elementId); return iframe.findElements(ByJquery.$("#" + escapedId + ":empty")).isEmpty(); }))); return (C) this; }
private TimedQuery<Iterable<PageElement>> getSkatedElements() { return Queries.forSupplier(timeouts, extendedFinder.within(section) .newQuery(By.className("js-file-attachment")) .filter(PageElements.attributeExists("resolved")) .supplier() ); }
public TimedQuery<Iterable<String>> getSuggestionsTimed() { return Queries.forSupplier(timeouts, extendedElementFinder.within(getActiveLayer()) .newQuery(By.className("aui-list-item-link")) .transform(PageElements.getAttribute("title")) .supplier()); }