Package org.seleniuminspector.openfaces

Examples of org.seleniuminspector.openfaces.PopupLayerInspector


     @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


     @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 testWithA4JControls() {
        testAppFunctionalPage("/components/popuplayer/popupLayer_a4j.jsf");
        PopupLayerInspector popupLayer = popupLayer("formID:popupLayer_a4j_ID");
        popupLayer.assertElementExists();
        popupLayer.assertVisible(false);
        ElementInspector button = element("formID:button_a4j_ID");
        button.click();
        String oldValue = popupLayer.text();
        popupLayer.assertVisible(true);
        ElementInspector popupCloser = element("formID:popup_a4j_Closer");
        popupCloser.click();
        popupLayer.assertVisible(false);
        element("formID:refresher_a4j").click();
        RichFacesAjaxLoadingMode.getInstance().waitForLoad();
        button.click();
        String newValue = popupLayer.text();
        popupLayer.assertVisible(true);
        popupCloser.click();
        popupLayer.assertElementExists();
        popupLayer.assertVisible(false);
        assertFalse(newValue.equals(oldValue));
    }
View Full Code Here

     @Test
    public void testPopupLayerVisibleByPageLoad() {
        testAppFunctionalPage("/components/popuplayer/popupLayerVisibleByLoad.jsf");

        PopupLayerInspector popupLayer = popupLayer("formID:visible");
        popupLayer.assertVisible(true);
        element("formID:submit").clickAndWait();
        popupLayer.assertVisible(true);
    }
View Full Code Here

    // showPopupLayer, hidePopupLayer
     @Test
    public void testShowHideJSFunctions() {
        testAppFunctionalPage("/components/popuplayer/popupLayerJSFunctions.jsf");

        PopupLayerInspector popupLayer = popupLayer("formID:showHide");
        // show PopupLayer
        popupLayer.assertVisible(false);
        element("showPopupLayer").click();
        popupLayer.assertVisible(true);

        // make submit and check is PopupLayer in 'visible' state
        element("formID:submit").clickAndWait();
        popupLayer.assertVisible(true);

        // hide PopupLayer
        element("hidePopupLayer").click();
        popupLayer.assertVisible(false);
    }
View Full Code Here

    // showPopupLayerAtXY
     @Test
    public void testShowPopupLayerAtXYJSFunction() {
        testAppFunctionalPage("/components/popuplayer/popupLayerJSFunctions.jsf");

        PopupLayerInspector popupLayer = popupLayer("formID:showAtXY");

        element("showPopupLayerAtXY").click();
        popupLayer.assertVisible(true);

        element("formID:submit").clickAndWait();
        popupLayer.assertVisible(true);
        popupLayer.assertPosition(250, 250);
    }
View Full Code Here

     @Test
    @Ignore
    public void testShowPopupLayerCenteredJSFunction() {
        testAppFunctionalPage("/components/popuplayer/popupLayerJSFunctions.jsf");

        PopupLayerInspector popupLayer = popupLayer("formID:centered");
        element("showCentered").clickAndWait();

        int popupLayerWidth = 200;
        int popupLayerHeight = 200;
        Dimension windowSize = window().size();

        Point popupLayerPos = popupLayer.position();
        assertTrue(Math.abs(popupLayerPos.x - (windowSize.width - popupLayerWidth) / 2) <= 10);
        assertTrue(Math.abs(popupLayerPos.y - (windowSize.height - popupLayerHeight) / 2) <= 10);

        popupLayer.assertVisible(true);
        element("formID:submit").clickAndWait();
        popupLayer.assertVisible(true);
    }
View Full Code Here

    // setPopupLayerLeft, setPopupLayerTop
     @Test
    public void testSetTopAndLeftJSFunctions() {
        testAppFunctionalPage("/components/popuplayer/popupLayerJSFunctions.jsf");

        PopupLayerInspector popupLayer = popupLayer("formID:setLeftTop");

        popupLayer.assertVisible(false);
        InputInspector leftCoordinateInput = new InputInspector("leftCoodinate");
        leftCoordinateInput.type("100");
        InputInspector topCoordinateInput = new InputInspector("topCoodinate");
        topCoordinateInput.type("200");
        ElementInspector topLeftButton = element("setPopupLayerTopLeft");
        topLeftButton.click();

        popupLayer.assertVisible(true);
        element("formID:submit").clickAndWait();
        popupLayer.assertVisible(true);

        popupLayer.assertPosition(100, 200);

        leftCoordinateInput.type("300");
        topCoordinateInput.type("500");
        topLeftButton.click();

        popupLayer.assertPosition(300, 500);
    }
View Full Code Here

    }

     @Test
    public void testStyling() {
        testAppFunctionalPage("/components/popuplayer/popupLayerStyling.jsf");
        PopupLayerInspector popupLayer = popupLayer("formID:styled");

        popupLayer.assertStyle("width: 400px; height: 200px; border: 2px solid crimson; background: mistyrose; " +
                "text-decoration: underline; font-weight: bold; text-align:center; left: 200px; top: 200px;");

        popupLayer.mouseOver();
        popupLayer.mouseMove();

        popupLayer.assertStyle("width: 450px; height: 250px; border: 3px dashed springgreen; background: azure; " +
                "text-decoration: overline; font-weight: lighter;");
    }
View Full Code Here

*/
public class PopupLayerTest extends OpenFacesTestCase {
     @Test
    public void testReRenderThroughA4J() {
        testAppFunctionalPage("/components/popuplayer/popupLayer_a4j.jsf");
        PopupLayerInspector popupLayer = popupLayer("formID:popupLayerID");
        popupLayer.assertElementExists();
        popupLayer.assertVisible(false);
        element("formID:buttonID").click();
        String oldValue = popupLayer.text();
        popupLayer.assertVisible(true);
        element("formID:popupCloser").click();
        popupLayer.assertVisible(false);
        element("formID:refresher").click();
        RichFacesAjaxLoadingMode.getInstance().waitForLoad();
        element("formID:buttonID").click();
        String newValue = popupLayer.text();
        popupLayer.assertVisible(true);
        element("formID:popupCloser").click();
        popupLayer.assertVisible(false);
        popupLayer.assertElementExists();
        assertFalse(newValue.equals(oldValue));
    }
View Full Code Here

TOP

Related Classes of org.seleniuminspector.openfaces.PopupLayerInspector

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.