@Override public TimedCondition isAt() { return Conditions.forSupplier(new Supplier<Boolean>() { @Override public Boolean get() { return "complete".equals(driver.executeScript("return document.readyState;")); } }); }
public TimedCondition isSelected(UiOAuthConfig config) { return Conditions.and( Conditions.forMatcher(getSelectedValue(), is(config.getId())), Conditions.forMatcher(getSelectedText(), is(config.getText())) ); }
@Nonnull public TimedCondition hasStatus(String statusText) { return isEqual(statusText, getText()); }
public TimedQuery<Boolean> isHiddenAndNotAnimated() { return Conditions.dependantCondition(Conditions.not(isVisible()), this::isNotAnimated); }
public TimedQuery<Boolean> isLoaded() { return Conditions.and(contentAreaIsVisible(), isEditButtonVisible(), Conditions.not(isPreviewButtonVisible()), //CONFSRVDEV-5874: The Close button will be enable in preview if content type is page/blogpost //isCloseLinkDisabled(), Conditions.not(isSpinnerVisible())); }
@SuppressWarnings("unchecked") public TimedCondition hasRow(String columnName, Matcher<String> cellMatcher) { return Conditions.forMatcher(getRow(columnName, cellMatcher), (Matcher) notNullValue()); }
@Override public TimedCondition isAt() { TimedCondition result = name.timed().isPresent(); if (fieldConfigId >= 0) { result = Conditions.and(result, name.timed().hasAttribute(DATA_ID, valueOf(fieldConfigId))); } return result; }
private TimedCondition isLoading() { return Conditions.or( row.timed().hasClass("loading"), Conditions.forMatcher( row.find(By.cssSelector("td")).timed().getAttribute("style"), containsString("background-color"))); }
public TimedCondition isSuggestionsOpen() { return Conditions.and(getActiveLayer().timed().isPresent(), Conditions.forSupplier(timeouts, () -> getActiveLayer().find(By.id(getId() + "-suggestions")).isPresent())); }
public static TimedCondition isAtLeastOneElementVisibleCondition(By by, PageElementFinder elementFinder, TimeoutType timeout) { final TimeoutType finalTimeout = timeout; return Conditions.or(Lists.transform(elementFinder.findAll(by, timeout), new Function<PageElement, TimedQuery<Boolean>>() { public TimedQuery<Boolean> apply(PageElement from) { return from.withTimeout(finalTimeout).timed().isVisible(); } })); } }
/** * Checks whether there are permissions on a page based on the state of the metadata. * * @deprecated since 5.9.1. It is unreliable to use the metadata to derive the permissions on a page since the visual representation * of restrictions can change over time (new icons, re-wording tooltips). * Use {@link #hasRestrictionsTooltip} or {@link #hasRestrictionsIconClass} instead to check whether the desired icon/tooltip is present. * Use {@link com.atlassian.confluence.api.service.permissions.ContentRestrictionService#getRestrictionsForOperation} * instead to check whether permissions are actually persisted on a page rather than deducing this from the icon. */ @Deprecated public TimedCondition hasPageRestrictions() { /* Before 5.9, the presence of the pageRestrictions div was enough to indicate that restrictions were present. From 5.9, we also use this div to render an unlocked icon when there are no restrictions present, so this check needs to account for both cases. */ //noinspection unchecked return Conditions.and( pageRestrictions.timed().isVisible(), Conditions.or( pageRestrictions.timed().hasAttribute("title", "Restrictions apply"), pageRestrictions.timed().hasAttribute("original-title", "Restrictions apply") ) ); }
/** * @return timed condition that ensures that statuses for applinks have been fetched. This is when the page is * "fully loaded" * @see #isLoaded() */ @Nonnull @SuppressWarnings("unchecked") public TimedCondition allStatusesLoaded() { Iterable<TimedQuery<Boolean>> allLoaded = (Iterable) rowsQuery().map(ApplinkRow::isStatusLoaded).get(); // and() doesn't handle empty lists unfortunately, at this stage we assume that the applinks list length won't // change return Iterables.isEmpty(allLoaded) ? Conditions.alwaysTrue() : and(allLoaded); }
/** * Check that the JIRA Dialog has been closed. */ public TimedQuery<Boolean> isClosed() { // JIRA Dialogs get removed from the DOM when they are closed. return not(isInDOM()); }
@Override public TimedCondition isAt() { return Conditions.alwaysTrue(); }
@Override public TimedCondition isAt() { //This is the only way I can do this now. return Conditions.forMatcher(projectPermissionsElement.timed().getAttribute("data-schemeid"), Matchers.equalTo(String.valueOf(schemeId))); }
@Override public TimedCondition isAt() { return Conditions.and(transitionPropertiesTable.timed().isPresent(), isTransitionPropertyTableReady()); }
@SuppressWarnings("unchecked") @WaitUntil public void waitForPage() { // similar to an existing page => displays an AUI message final TimedCondition similarPageCondition = Conditions.forMatcher(pageElementFinder.find(By.cssSelector("#content .aui-message .title")).timed().getText(), CASE_INSENSITIVE_NOT_FOUND_TITLE_MATCHER); // not similar to an existing page => displays title element final TimedCondition notFoundCondition = Conditions.forMatcher(pageElementFinder.find(By.id("title-text")).timed().getText(), CASE_INSENSITIVE_NOT_FOUND_TITLE_MATCHER); waitUntilTrue(Conditions.or(notFoundCondition, similarPageCondition)); }
@Override public TimedCondition isAt() { return Conditions.or( refreshButton.timed().isPresent(), logInLink.timed().isPresent() ); }