use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.
the class InteractiveMapPageObject method placePinInMap.
public AddPinComponentObject placePinInMap() {
wait.forElementVisible(mapFrame);
jsActions.scrollElementIntoViewPort(mapFrame);
driver.switchTo().frame(mapFrame);
wait.forElementVisible(addPinButton);
addPinButton.click();
Actions actions = new Actions(driver);
actions.moveToElement(mapImagesCollection.get(0));
actions.click().perform();
driver.switchTo().defaultContent();
PageObjectLogging.log("placePinInMap", "Pin was placed in map", true);
return new AddPinComponentObject(driver);
}
use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.
the class InteractiveMapPageObject method clickOnPin.
public void clickOnPin(Integer pinListPosition, boolean... noFrame) {
if (noFrame.length == 0) {
wait.forElementVisible(mapFrame);
driver.switchTo().frame(mapFrame);
}
wait.forElementVisible(pinCollection.get(pinListPosition));
jsActions.scrollToElement(pinCollection.get(pinListPosition));
Actions actions = new Actions(driver);
actions.moveToElement(pinCollection.get(pinListPosition));
actions.click().perform();
PageObjectLogging.log("clickOnPin", "Pin was clicked", true, driver);
}
use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.
the class InteractiveMapPageObject method clickOnFilterBoxTitle.
public void clickOnFilterBoxTitle() {
wait.forElementVisible(mapFrame);
jsActions.scrollToElement(mapFrame);
driver.switchTo().frame(mapFrame);
wait.forElementVisible(filterBoxTitle);
Actions actions = new Actions(driver);
actions.moveToElement(filterBoxTitle).click().perform();
driver.switchTo().defaultContent();
PageObjectLogging.log("clickOnFilterBoxTitle", "Filter box title was clicked", true);
}
use of org.openqa.selenium.interactions.Actions in project selenium-tests by Wikia.
the class VisualEditModePageObject method removeCategory.
public void removeCategory(String categoryName) {
WebElement removeCategory = driver.findElement(By.cssSelector(categoryRemoveSelector.replace("%categoryName%", categoryName)));
WebElement category = driver.findElement(By.cssSelector(".category[data-name='" + categoryName + "']"));
new Actions(driver).moveToElement(category).perform();
scrollAndClick(removeCategory);
PageObjectLogging.log("removeCategory", "remove category button clicked on category " + categoryName, true);
}
use of org.openqa.selenium.interactions.Actions in project rstudio by rstudio.
the class MenuNavigator method getMenuItem.
public static WebElement getMenuItem(final WebDriver driver, String level1, String level2, String level3) {
WebElement popupItem = getMenuItem(driver, level1, level2);
Actions action = new Actions(driver);
action.moveToElement(popupItem).build().perform();
// Wait for there to be two popups open (the level1 and level2 menus)
(new WebDriverWait(driver, 1)).until(new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver d) {
List<WebElement> elements = driver.findElements(By.className("gwt-MenuBarPopup"));
return elements.size() > 1;
}
});
// Get the second popup menu
List<WebElement> elements = driver.findElements(By.className("gwt-MenuBarPopup"));
WebElement menu2popup = elements.get(1);
return findMenuItemByName(menu2popup, level3);
}
Aggregations