element("confirmationForm:buttonPopup1").assertVisible(true);
element("confirmationForm:buttonInvoker").click();
ElementInspector buttonPopup = element("confirmationForm:buttonPopup");
buttonPopup.assertVisible(false);
ConfirmationInspector buttonConfirmation = confirmation("confirmationForm:buttonConfirmation");
buttonConfirmation.assertVisible(true);
buttonConfirmation.okButton().click();
buttonPopup.assertVisible(true);
buttonConfirmation.assertVisible(false);
element("confirmationForm:linkInvoker").click();
ElementInspector linkPopup = element("confirmationForm:linkPopup");
linkPopup.assertVisible(false);
ConfirmationInspector linkConfirmation = confirmation("confirmationForm:linkConfirmation");
linkConfirmation.assertVisible(true);
linkConfirmation.okButton().click();
linkPopup.assertVisible(true);
linkConfirmation.assertVisible(false);
getDriver().findElement(By.id("textInvoker")).click();
ElementInspector textPopup = element("confirmationForm:textPopup");
textPopup.assertVisible(false);
ConfirmationInspector textConfirmation = confirmation("confirmationForm:textConfirmation");
textConfirmation.assertVisible(true);
textConfirmation.okButton().click();
textPopup.assertVisible(true);
textConfirmation.assertVisible(false);
element("confirmationForm:imageInvoker").evalExpression("ondblclick.call(this, this)");
ElementInspector imagePopup = element("confirmationForm:imagePopup");
imagePopup.assertVisible(false);
ConfirmationInspector imageConfirmation = confirmation("confirmationForm:imageConfirmation");
// imageConfirmation.assertVisible();
imageConfirmation.assertVisible(true);
imageConfirmation.okButton().click();
imagePopup.assertVisible(true);
imageConfirmation.assertVisible(false);
getDriver().findElement(By.id("message_input")).clear();
getDriver().findElement(By.id("message_input")).sendKeys("Are you sure?");
ElementInspector changedInvoker = element("changedInvoker");
changedInvoker.evalExpression("click()");
getDriver().findElement(By.id("detail_input")).clear();
getDriver().findElement(By.id("detail_input")).sendKeys("");
getDriver().findElement(By.id("detail_input")).sendKeys("bla bla bla");
changedInvoker.evalExpression("click()");
getDriver().findElement(By.id("yes_input")).clear();
getDriver().findElement(By.id("yes_input")).sendKeys("");
getDriver().findElement(By.id("yes_input")).sendKeys("Confirm");
changedInvoker.evalExpression("click()");
getDriver().findElement(By.id("no_input")).clear();
getDriver().findElement(By.id("no_input")).sendKeys("");
getDriver().findElement(By.id("no_input")).sendKeys("Decline");
changedInvoker.evalExpression("click()");
try {
getDriver().findElement(By.xpath("//*[@id='confirmationForm:editableConfirmation']//*[contains(text(), 'Are you sure?')]"));
getDriver().findElement(By.xpath("//*[@id='confirmationForm:editableConfirmation']//*[contains(text(), 'bla bla bla')]"));
} catch (NoSuchElementException e) {
assertTrue(false);
}
try {
getDriver().findElement(By.xpath("//*[@id='confirmationForm:editableConfirmation']//*[contains(text(), 'Are you really sure?')]"));
assertTrue(false);
} catch (NoSuchElementException e) {}
try {
getDriver().findElement(By.xpath("//*[@id='confirmationForm:editableConfirmation']//*[contains(text(), 'Think once again before doing it')]"));
assertTrue(false);
} catch (NoSuchElementException e) {}
ConfirmationInspector editableConfirmation = confirmation("confirmationForm:editableConfirmation");
editableConfirmation.okButton().assertValue("Confirm");
editableConfirmation.cancelButton().assertValue("Decline");
editableConfirmation.okButton().click();
// WebElement okButton =
// getDriver().findElement(By.xpath(editableConfirmation.okButton().getXPath())).click();
// Actions click = new Actions(getDriver()).moveToElement(okButton).click();
// click.build().perform();
assertTrue(window().document().isAlertPresent());