@Override public boolean matchesSafely(ViewProjectRolesPage.ProjectRole projectRole) { return projectRole.getProjectRoleName().now().matches(projectRoleName); }
/** * @return the list of failed invite addresses. */ public List<String> getFailedInvitationAddresses() { return newArrayList( Splitter.on(',') .trimResults() //need this due to the stupid html containing spaces between the entries .omitEmptyStrings() .split(failedInvitations.timed() .getText() .by(timeouts.timeoutFor(TimeoutType.AJAX_ACTION))) ); }
private String locateRowIdForPageTitle(String pageTitle) { // there has to be a better way than this final String rowIdSelectorJavascript = "return $(\"tr:contains('" + pageTitle + "')\")[0].id"; final TimedQuery<String> rowIdQuery = jsQueryFactory.forStringJavascript(rowIdSelectorJavascript); try { return rowIdQuery.byDefaultTimeout(); } catch (WebDriverException ex) { throw new RuntimeException("Failed to locate draft for page title [" + pageTitle + "]", ex); } } }
@Override public boolean apply(@Nullable final String text) { checkNotNull(text, "text"); return message.getMessage().now().contains(text); } };
public List<String> getUsersToAdd() { return Lists.newArrayList( usersToAdd.timed() .getValue() .by(timeouts.timeoutFor(TimeoutType.AJAX_ACTION)) .split(",") ); } }
public TimedCondition normalizedHtmlContains(final String normalizedHtml, final boolean normalizeSpaces) { return Conditions.forSupplier(timeouts, () -> { return getTimedNormalizedHtml(normalizeSpaces).byDefaultTimeout().contains(normalizedHtml); }); }
@Override public boolean matchesSafely(E item) { String id = item.getId().now(); return id != null && id.contains(idSubstring); }
public List<String> getUsersToAdd() { return Lists.newArrayList( usersToAddInput.timed() .getValue() .by(timeouts.timeoutFor(TimeoutType.AJAX_ACTION)) .split(",") ); } }
public InlineDialog close() { if(isOpen().byDefaultTimeout()) { trigger.click(); } return this; }
@Override public boolean matchesSafely(Suggestion item) { final String text = item.getText().now(); return text != null && text.contains(substring); }
public List<String> getUsersToAdd() { return newArrayList( usersToAddInput.timed() .getValue() .by(timeouts.timeoutFor(TimeoutType.AJAX_ACTION)) .split(",") ); } }
public Iterable<String> getIssueKeys() { return Iterables.transform(issueRows, row -> row.find(By.cssSelector("[data-issue-key]")).timed().getAttribute("data-issue-key").byDefaultTimeout()); } }
@Override public Boolean get() { return Iterables.size(getMessagesOfType(type).now()) > 0; } });
/** * @return the number of email that was sent. */ public int getSentEmailCount() { return parseInt(inviteLinkMessagesDiv.find(By.id("sent-invitations-count")) .timed() .getText() .by(timeouts.timeoutFor(TimeoutType.AJAX_ACTION))); }
public List<GroupRow> getGroupRows() { final Supplier<Iterable<PageElement>> supplier = extendedFinder.within(userGroups).newQuery(GroupRow.SELECTOR).supplier(); return ImmutableList.copyOf(transformTimed(timeouts, pageBinder, supplier, GroupRow.class).byDefaultTimeout()); }
@Override public String toString() { return "UserSuggestion[username=" + getUsername().now() + "]"; }
/** * get the invite form message (which should contain various errors, or success messages) */ public String getInviteFormMessage() { return inviteLinkMessagesDiv.timed().getText().by(timeouts.timeoutFor(TimeoutType.AJAX_ACTION)); }
public String getLinkText() { return source.find(By.cssSelector(".aui-button-link")).timed().getText().byDefaultTimeout(); }
@Override public boolean matches(Object obj) { MultiSelectSuggestion suggestion = (MultiSelectSuggestion) obj; return suggestion.getText().now().equals(text); }
public List<String> getReorderSiblingPageTitles() { final Function<PageElement, String> getTextFunction = input -> input.timed() .getText() .by(timeouts.timeoutFor(AJAX_ACTION)); return copyOf(transform(dialog.findAll(By.cssSelector(".siblings .dropper li span")), getTextFunction)); }