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(); } })); } }
@Override public TimedCondition isAt() { return Conditions.or(table.timed().isPresent(), noProjects.timed().isPresent()); }
@Override public TimedCondition isAt() { return Conditions.or( refreshButton.timed().isPresent(), logInLink.timed().isPresent() ); }
@Override public TimedCondition isAt() { return Conditions.or(projectsList.timed().isPresent(), noProjectsMessage.timed().isPresent()); }
@Override public TimedCondition isAt() { return Conditions.or(createLink.timed().isPresent(), multiSelectElement.timed().isPresent()); } }
@Override public TimedCondition isAt() { return Conditions.or(disableElement.timed().isPresent(), enableElement.timed().isPresent()); }
private TimedCondition isLoading() { return Conditions.or( row.timed().hasClass("loading"), Conditions.forMatcher( row.find(By.cssSelector("td")).timed().getAttribute("style"), containsString("background-color"))); }
@Nonnull @SuppressWarnings("unchecked") public TimedCondition isPresent() { // either the lozenge, or the auth link are present return or(getStatusLozenge().timed().isPresent(), getRemoteAuthenticationRequiredLink().timed().isPresent()); }
public TimedCondition isVisible() { return Conditions.or(displayCommentView.timed().isVisible(), createCommentView.timed().isVisible()); }
private TimedCondition hasAvailableGroupsSelectOrInfoMessage() { return or(availablegroups.timed().isPresent(), messageInUserPickerContainer().timed().hasText("User is a member of all groups.")); }
private TimedCondition hasGroupsToLeaveSelectOrInfoMessage() { return or(joinedGroups.timed().isPresent(), messageInUserPickerContainer().timed().hasText("User isn't a member of any groups.")); }
/** * Used to check whether the tooltip of the restrictions icon matches the specified text * * @param text The expect text value of the title * @return A {@link com.atlassian.pageobjects.elements.query.TimedCondition} for the matching tooltip */ public TimedCondition hasRestrictionsTooltip(String text) { waitUntilTrue(pageRestrictions.timed().isVisible()); return Conditions.or( pageRestrictions.timed().hasAttribute("title", text), pageRestrictions.timed().hasAttribute("original-title", text) ); }
/** * 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") ) ); }
@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 or(loggedOutElement.timed().isPresent(), alreadyLoggedOutElement.timed().isPresent(), confirmElement.timed().isPresent(), confirmElementOndemand.timed().isPresent()); }
@Override public TimedCondition isAt() { TimedCondition dialogTitleStartsWithDeleteLink = Conditions.forMatcher(elementFinder.find(By.className("dialog-title")).timed().getText(), Matchers.startsWith("Delete Link:")); return Conditions.or(dialogTitleStartsWithDeleteLink, elementFinder.find(By.className("form-body")).timed().isPresent()); }