/src/test/java/it/ToolsMenu.java
https://bitbucket.org/xavist/easyfollow-confluence-plugin · Java · 48 lines · 37 code · 10 blank · 1 comment · 1 complexity · 48f2adf336adce091c427e1319c71658 MD5 · raw file
- package it;
- import com.atlassian.confluence.pageobjects.component.PageComponent;
- import com.atlassian.confluence.pageobjects.component.menu.AUIDropdownMenu;
- import com.atlassian.pageobjects.elements.ElementBy;
- import com.atlassian.pageobjects.elements.PageElement;
- import com.atlassian.pageobjects.elements.PageElementFinder;
- import com.atlassian.webdriver.utils.by.ByJquery;
- import org.openqa.selenium.By;
- import javax.inject.Inject;
- public class ToolsMenu extends AUIDropdownMenu implements PageComponent
- {
- @Inject
- protected PageElementFinder finder;
- @ElementBy(id="action-menu-link")
- protected PageElement tools;
- public ToolsMenu()
- {
- super(ByJquery.$("#action-menu-link").parent("li"));
- }
- public ToolsMenu open()
- {
- if (!isOpen())
- {
- tools.click();
- }
- // Wait until the menu has finished loading items
- driver.waitUntilElementIsVisibleAt(By.className("ajs-drop-down"), menuContainer);
- return this;
- }
- public boolean canFollow()
- {
- return finder.find(By.id("easyfollow-follow-label-action")).isPresent();
- }
- public boolean canUnfollow()
- {
- return finder.find(By.id("easyfollow-unfollow-label-action")).isPresent();
- }
- }