use of org.openqa.selenium.interactions.Actions in project zeppelin by apache.
the class ParagraphActionsIT method testEditOnDoubleClick.
@Test
public void testEditOnDoubleClick() throws Exception {
if (!endToEndTestEnabled()) {
return;
}
try {
createNewNote();
Actions action = new Actions(driver);
waitForParagraph(1, "READY");
setTextOfParagraph(1, "%md");
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.ARROW_RIGHT);
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.ENTER);
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(Keys.SHIFT + "3");
driver.findElement(By.xpath(getParagraphXPath(1) + "//textarea")).sendKeys(" abc");
runParagraph(1);
waitForParagraph(1, "FINISHED");
collector.checkThat("Markdown editor is hidden after run ", driver.findElements(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-if, 'paragraph.config.editorHide')]")).size(), CoreMatchers.equalTo(0));
collector.checkThat("Markdown editor is shown after run ", driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.tableHide')]")).isDisplayed(), CoreMatchers.equalTo(true));
// to check if editOnDblClick field is fetched correctly after refresh
driver.navigate().refresh();
waitForParagraph(1, "FINISHED");
action.doubleClick(driver.findElement(By.xpath(getParagraphXPath(1)))).perform();
ZeppelinITUtils.sleep(1000, false);
collector.checkThat("Markdown editor is shown after double click ", driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-if, 'paragraph.config.editorHide')]")).isDisplayed(), CoreMatchers.equalTo(true));
collector.checkThat("Markdown editor is hidden after double click ", driver.findElement(By.xpath(getParagraphXPath(1) + "//div[contains(@ng-show, 'paragraph.config.tableHide')]")).isDisplayed(), CoreMatchers.equalTo(false));
deleteTestNotebook(driver);
} catch (Exception e) {
handleException("Exception in ParagraphActionsIT while testEditOnDoubleClick ", e);
}
}
use of org.openqa.selenium.interactions.Actions in project ghostdriver by detro.
the class MouseCommandsTest method doubleClick.
@Test
public void doubleClick() {
WebDriver d = getDriver();
Actions actionBuilder = new Actions(d);
d.get("http://www.duckduckgo.com");
// Double click
actionBuilder.doubleClick().build().perform();
// Double click on the logo
actionBuilder.doubleClick(d.findElement(By.id("logo_homepage_link"))).build().perform();
}
use of org.openqa.selenium.interactions.Actions in project ghostdriver by detro.
the class MouseCommandsTest method clickAndHold.
@Test
public void clickAndHold() {
WebDriver d = getDriver();
Actions actionBuilder = new Actions(d);
d.get("http://www.duckduckgo.com");
// Hold, then release
actionBuilder.clickAndHold().build().perform();
actionBuilder.release();
// Hold on the logo, then release
actionBuilder.clickAndHold(d.findElement(By.id("logo_homepage_link"))).build().perform();
actionBuilder.release();
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method pageDown.
public void pageDown() {
Actions clicker = new Actions(driver);
clicker.sendKeys(Keys.PAGE_DOWN);
}
use of org.openqa.selenium.interactions.Actions in project java.webdriver by sayems.
the class Action method pressShiftAndTab.
// Method to press shift + tab
public void pressShiftAndTab() {
Actions action = new Actions(driver);
action.sendKeys(Keys.chord(Keys.SHIFT), Keys.chord(Keys.TAB)).build().perform();
}
Aggregations