@Init public void readAttachmentSettings() { By colLocator = ByJquery.$("td ~ td"); List<WebElement> attachSettingsRows = attachmentSettingsTable.findElements(By.tagName("tr")); attachmentsEnabled = attachSettingsRows.get(0).findElement(colLocator).getText().equals(ENABLED); attachmentPath = parseAttachmentPath(attachSettingsRows.get(1).findElement(colLocator).getText()); attachmentSize = attachSettingsRows.get(2).findElement(colLocator).getText(); thumnailsEnabled = attachSettingsRows.get(3).findElement(colLocator).getText().equals(ENABLED); zipSupportEnabled = attachSettingsRows.get(4).findElement(colLocator).getText().equals(ENABLED); }
@Init public void initialize() { final ByJquery locator = ByJquery.$("meta[name='ajs-enabled-dark-features']"); if (!driver.elementExists(locator)) { enabledFeatures = ImmutableSet.of(); return; } final WebElement element = driver.findElement(locator); String content = element.getAttribute("content"); enabledFeatures = ImmutableSet.copyOf(content.split(",")); }
public List<String> getErrorMessages() { //#all-messages is the container that is visible when an error message is shown //there seems to be two ".error li" elements, but the other one is not visible List<WebElement> errorElements = driver.findElements(ByJquery.$("#all-messages .aui-message-error li")); return Lists.transform(errorElements, innerText()); }
/** * Chooses an existing issue type scheme to associate with the currently selected project * @param scheme The new issue type scheme name */ public void chooseExistingIssueTypeScheme(final String scheme) { chooseSchemeRadioOption.select(); schemeSelect.find(ByJquery.$("option:contains(\"" + scheme + "\")")).select(); submit.click(); }
public void selectedAttachment(Content attachment) { Preconditions.checkArgument(ContentType.ATTACHMENT.equals(attachment.getType())); By locator = ByJquery.$("#attachments-table .title-field:contains(\"" + attachment.getTitle() + "\")"); getDialog().find(locator).click(); }
/** * Waits until the quick search dropdown is visible * * @since 5.8.0 */ @SuppressWarnings("WeakerAccess") public void waitForQuickSearchToBeVisible() { By locator = ByJquery.$(".aui-dd-parent.autocomplete .aui-dropdown:visible"); waitUntilTrue("Quick search is open", getDialog().find(locator).timed().isPresent()); }
/** * Clicks on a result in the recently viewed panel by link text and content type * * @since 5.8.0 */ public void clickRecentlyViewedResult(final String linkText, final String contentType) { final String cssClass = "blog".equals(contentType) ? "blogpost" : contentType; recentlyViewedResults.find(ByJquery.$(".content-type-" + cssClass + ":contains(\"" + linkText + "\")")).click(); }
private WebElement getIssueTypeListItemFromSelectedOptions(String sourceIssueType) { return selectedOptionsWebElement .findElement(ByJquery.$("li:contains(\"" + sourceIssueType + "\")")); }
@Init public void initialise() { dashboardMenu = pageBinder.bind(AuiDropdownMenu.class, ByJquery.$("#home_link").parent("li")); }
/** * Mouse-hover over the user icon and wait for the AUI dialog to appear */ public UserHoverPopup openUserHoverPopup(String username) { waitForJsBindingsIfNeeded(); PageElement userLogo = finder.find(By.cssSelector(String.format(".userLogoLink[data-username='%s']", username))); actions.moveToElement(userLogo); actions.perform(); // Here we are finding the popup element by finding a .ajs-content-hover element where the child a has data-username= provided username. PageElement popupElement = finder.find(ByJquery.$(".ajs-content-hover a[data-username='" + username + "']").closest(".ajs-content-hover")); return pageBinder.bind(UserHoverPopup.class, popupElement); }
public WebElement getPageItem(Content page) { Preconditions.checkArgument(ContentType.PAGE.equals(page.getType())); return driver.findElement(ByJquery.$("#pages-pane .favourite-pages-section .page-list-item .page-name:contains(\"" + page.getTitle() + "\")")); } }
/** * Check isVisible when inline comment was visibled, support timed to make sure page has enough time to render that inline comment * * @param inlineCommentIndex zero based index of inline comment that need to check * @return TimedQuery with true if the comment is visible within the timeout. */ public TimedQuery<Boolean> isInlineCommentVisible(int inlineCommentIndex) { return pageContent.find(ByJquery.$(".inline-comment-marker.valid:eq(" + inlineCommentIndex + ")")).timed().isVisible(); }
public boolean isServerPresent(String serverName) { // don't be having server names with quotes in 'em return mailServerTable.findElement(ByJquery.$("td:contains('" + serverName + "')")).isDisplayed(); } }
public PagePropertiesReportMacro clickSort(String columnHeading) { PageElement header = summaryTable.find(ByJquery.$("th:contains(" + columnHeading + ")")); waitUntilTrue("Column is not sortable: [" + columnHeading + "]", header.timed().hasClass("tablesorter-header")); header.click(); return this; }
public AuiFlag clickFavouriteButtonAndExpectErrorContains(String errorMessageExcerpt) { webdriverUtils.scrollToElementWithOffset(favouriteButton, 150); favouriteButton.click(); AuiFlag flag = pageBinder.bind(AuiFlag.class, ByJquery.$(".aui-flag.aui-flag-stack-top-item")); waitUntilTrue(flag.isVisible()); assertThat(flag.getFlagElement().getText(), containsString(errorMessageExcerpt)); return flag; }
public SpaceExportTree getExportTree() { driver.waitUntilElementIsVisible(ByJquery.$("#exportContentTree")); return pageBinder.bind(SpaceExportTree.class); } }
@Init public void initialise() { browseMenu = pageBinder.bind(AjsDropdownMenu.class, ByJquery.$("#browse-menu-link").parent("li")); }
private List<PageElement> getTemplatesForBlueprint(ItContentBlueprint blueprint) { return pluginTemplatesTable.findAll( ByJquery.$(getBlueprintTableSelector(blueprint.getModuleKey()) + " tr[" + BLUEPRINT_TEMPLATE_KEY_ATTRIBUTE + "]")); } }
public AuiFlag clickFavouriteButtonAndExpectError(String errorMessage) { webdriverUtils.scrollToElementWithOffset(favouriteButton, 150); favouriteButton.click(); AuiFlag flag = pageBinder.bind(AuiFlag.class, ByJquery.$(".aui-flag.aui-flag-stack-top-item")); waitUntilTrue(flag.isVisible()); waitUntilEquals(errorMessage, flag.getFlagElement().timed().getText()); return flag; }
public TimedCondition isUserInstalledPluginListed(String pluginFriendlyName) { Poller.waitUntilTrue(upmUserInstalledContainer.timed().isVisible()); String jquerySelector = String.format("h4.upm-plugin-name:contains(%s)", pluginFriendlyName); return upmUserInstalledContainer.find(ByJquery.$(jquerySelector)).timed().isPresent(); }