public void hoverOverSave() { actions.moveToElement(activeSaveButton); actions.perform(); }
public void doubleClickInContent(final By by) { execute.onTinyMceIFrame(() -> { final PageElement element = page.find(by); actions.doubleClick(element).perform(); return null; }); }
public void execute() { ensureViewport(); if (directTarget != null) { actions.dragAndDrop(source, directTarget).perform(); } else if (xOffset >= 0) { actions.dragAndDropBy(source, xOffset, yOffset).perform(); } else { throw new IllegalStateException("Drag and drop action not specified"); } }
/** * Triggers full synchronization. * * @return this repository */ public AccountRepository fullSynchronize() { actions.keyDown(Keys.LEFT_SHIFT) .click(getSynchronizationButton()) .keyUp(Keys.LEFT_SHIFT) .perform(); ForceSyncDialog forceSyncDialog = getForceSyncDialog(); Poller.waitUntilTrue(forceSyncDialog.isOpen()); TimedCondition syncFinished = isSynchronizationFinished(); forceSyncDialog.fullSync(); waitUntilTrue(syncFinished); return this; }
private PageElementActions moveToWysiwygMacro(final String macroName) { PageElement wysiwygMacro = page.find(By.cssSelector(".wysiwyg-macro[data-macro-name=\"" + macroName + "\"]")); waitUntilTrue(wysiwygMacro.timed().isVisible()); //a hack to click on the margin of the macro (where the background image is) //by default, it's got a margin of 24 px, so a -12 pixel should be a good buffer return actions.moveToElement(wysiwygMacro.find(By.tagName("tbody")), 0, -12); }
public void hoverOverUnlink() { actions.moveToElement(unlinkButton); actions.perform(); }
public void doubleClickLink() { actions.doubleClick(linkField).perform(); waitUntilTrue(copiedMessageIsVisible()); }
public SearchAndReplaceToolbar showSearchAndReplaceMenu() { actions.moveToElement(searchAndReplaceButton); // prevent click over tipsy tooltips actions.perform(); searchAndReplaceButton.click(); return pageBinder.bind(SearchAndReplaceToolbar.class); }
public MacroForm doubleClickEditWysiwygMacro(final String macroName) { execute.onTinyMceIFrame(() -> { moveToWysiwygMacro(macroName) .doubleClick() .perform(); return null; }); return binder.bind(MacroForm.class); }
@Override public Boolean get() { actions.moveToElement(row).perform(); return row.find(By.className("attachment-delete")).isVisible(); } }));
/** * Double click on the macro to trigger edit mode * * @param macroName The name of the macro to wait for */ public MacroForm doubleClickEditInlineMacro(final String macroName) { execute.onTinyMceIFrame(() -> { PageElement inlineMacro = page.find(By.cssSelector(".editor-inline-macro[data-macro-name=\"" + macroName + "\"]")); waitUntilTrue(inlineMacro.timed().isVisible()); actions.doubleClick(inlineMacro).perform(); return null; }); return binder.bind(MacroForm.class); }
public void closeSearchAndReplaceMenu() { actions.moveToElement(searchAndReplaceButton); // prevent click over tipsy tooltips actions.perform(); searchAndReplaceButton.click(); waitUntilFalse(pageBinder.bind(SearchAndReplaceToolbar.class).isVisible()); }
/** * Opens the Macro Browser via the menu */ public MacroBrowserDialog openMacroBrowser() { final InsertDropdownMenu insertMenu = openInsertMenu(); insertMenu.waitUntilVisible(); PageElement element = insertMenu.getPageElement().find(By.id(InsertDropdownMenu.InsertItem.MACRO.getId())); actions.moveToElement(element).perform(); return insertMenu.clickInsertMacro(); }
/** * 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 static UserHoverPopup openUserHoverPopup(String username, PageElementFinder finder, PageElementActions actions, PageBinder pageBinder) { PageElement userLogo = finder.find(By.cssSelector(String.format(".userLogoLink[data-username='%s']", username))); waitUntilTrue("User logo should be visible for " + username, userLogo.timed().isVisible()); actions.moveToElement(userLogo).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 PageLayout2Toolbar showPageLayout2Menu() { waitUntilFalse(pageLayouts2Container.timed().hasClass("disabled")); if (!pageLayouts2Button.hasClass("active")) { actions.moveToElement(pageLayouts2Button); // prevent click over tipsy tooltips actions.perform(); waitUntilTrue(toolTip.timed().isVisible()); pageLayouts2Button.click(); } return pageBinder.bind(PageLayout2Toolbar.class); }