Package org.seleniuminspector.openfaces

Examples of org.seleniuminspector.openfaces.ConfirmationInspector


    public void testSessionExpiration() {
        testAppFunctionalPage("/components/sessionexpiration/rawTesting.jsf");

        element("//img[1]").clickAndWait(OpenFacesAjaxLoadingMode.getInstance());

        ConfirmationInspector confirmation = confirmation("formID:openfaces_internal_sessionexpiration_confirmation");
        confirmation.assertElementExists();
        confirmation.okButton().assertElementExists();

        confirmation.okButton().clickAndWait();
        confirmation.assertElementExists(false);

//     Selenium selenium = getSelenium();
//    testAppFunctionalPage("/components/sessionexpiration/rawTesting.jsf");
//
//    selenium.click("document.getElementsByTagName('img').item(0);");
View Full Code Here


    public void testConfirmationWithInvokerId() {
        testAppFunctionalPage("/requests/JSFC-1903.jsf");
        ElementInspector button = element("button1");
        button.click();

        ConfirmationInspector confirmation = confirmation("form1:conf1");
        confirmation.cancelButton().click();
        button.click();
        confirmation.okButton().click();
        assertEquals("!", window().document().getAlert());
        acceptAlert();
    }
View Full Code Here

        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());
View Full Code Here

    @Ignore
     @Test
    public void _testConfirmationReRenderThroughA4J() throws InterruptedException {
        testAppFunctionalPage("/components/confirmation/confirmation_a4j.jsf");
        Selenium selenium = getSelenium();
        ConfirmationInspector confirmation = confirmation("formID:confirmationID");
        PopupLayerInspector confirmedPopup = popupLayer("formID:confirmedPopup");
        for (int i = 0; i < 3; i++) {
            selenium.click("formID:button1");
            String oldSource = selenium.getHtmlSource();
            confirmation.okButton().click();
            confirmedPopup.assertVisible(true);
            selenium.click("formID:closer");
            selenium.click("formID:refresher");
            RichFacesAjaxLoadingMode.getInstance().waitForLoad();
            selenium.click("formID:button1");
            String newSource = selenium.getHtmlSource();
            sleep(500);
            confirmation.okButton().click();
            sleep(500);
            confirmedPopup.assertVisible(true);
            selenium.click("formID:closer");
            assertTrue(!newSource.equals(oldSource));
        }
View Full Code Here

    @Ignore
     @Test
    public void _testConfirmationInvocationThroughA4JControl() {
        testAppFunctionalPage("/components/confirmation/confirmation_a4j.jsf");
        Selenium selenium = getSelenium();
        ConfirmationInspector confirmation = confirmation("formID:confirmation_a4j_ID");
        PopupLayerInspector confirmedPopup = popupLayer("formID:confirmed_a4j_Popup");
        for (int i = 0; i < 3; i++) {
            selenium.click("formID:a4j_button");
            String oldSource = selenium.getHtmlSource();
            confirmation.okButton().click();
            confirmedPopup.assertVisible(true);
            selenium.click("formID:closer_a4j");
            selenium.click("formID:refresher_a4j");
            RichFacesAjaxLoadingMode.getInstance().waitForLoad();
            selenium.click("formID:button1");
            String newSource = selenium.getHtmlSource();
            confirmation.okButton().click();
            confirmedPopup.assertVisible(true);
            selenium.click("formID:closer_a4j");
            assertTrue(!newSource.equals(oldSource));
        }
    }
View Full Code Here

     @Test
    public void testSetConfirmationTextsFunction() {
        testAppFunctionalPage("/components/confirmation/confirmationTestInvokers.jsf");
        element("form1:linkInvokerID2").click();
        ConfirmationInspector confirmation = confirmation("form1:setConfirmationTexts");
        confirmation.message().assertText("header custom text");
        confirmation.details().assertText("details custom text");
        confirmation.okButton().assertValue("accept");
        confirmation.cancelButton().assertValue("decline");
        confirmation.okButton().click();
    }
View Full Code Here

     @Test
    public void testStyles() {
        testAppFunctionalPage("/components/confirmation/confirmationStyles.jsf");

        element("invoker").click();
        ConfirmationInspector confirmation = confirmation("form1:styled");
        confirmation.buttonArea().assertStyle("background: blue");
        confirmation.assertStyle("border: 3px solid black");
        confirmation.cancelButton().assertStyle("border: 1px dashed black");
        confirmation.caption().assertStyle("border: 1px dashed white");
        confirmation.details().assertStyle("color: red");
        confirmation.iconArea().assertStyle("border: 1px solid orange");
        confirmation.message().assertStyle("color: blue");
        confirmation.content().assertStyle("background: beige");
        confirmation.modalLayer().assertStyle("background: gray");
        confirmation.okButton().assertStyle("border: 1px dashed pink");

        confirmation.okButton().mouseOver();
        confirmation.okButton().mouseMove();

        confirmation.okButton().assertStyle("border: 3px dashed pink");
        confirmation.buttonArea().assertStyle("background: azure");
        confirmation.assertStyle("border: 2px dotted blue");

        confirmation.okButton().mouseOut();
        confirmation.cancelButton().mouseOver();
        confirmation.cancelButton().mouseMove();

        confirmation.cancelButton().assertStyle("border: 3px dashed black");
        confirmation.details().assertStyle("font-weight: bold");
        confirmation.iconArea().assertStyle("border: 3px solid red");
        confirmation.message().assertStyle("color: green");
        confirmation.content().assertStyle("background: orange");
    }
View Full Code Here

TOP

Related Classes of org.seleniuminspector.openfaces.ConfirmationInspector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.