Package org.seleniuminspector.openfaces

Examples of org.seleniuminspector.openfaces.FoldingPanelInspector


     @Test
    public void testWithFoldingPanel() {
        testAppFunctionalPage("/components/loadbundle/withFoldingPanel.jsf");

        FoldingPanelInspector foldingPanel = foldingPanel("formID:loadBundleFoldingPanel");

        // check 'ar' locale
        foldingPanel.caption().assertText(TODAY_AR);
        foldingPanel.setExpanded(true);
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        foldingPanel.content().assertText(TODAY_AR + WEEK_AR);

        TabSetInspector localeChanger = tabSet("formID:localeChanger");

        // check 'es' locale
        localeChanger.tabs().get(1).clickAndWait();
        testAppFunctionalPage("/components/loadbundle/withFoldingPanel.jsf"); // issue a GET request for view to update locale in JSP
        foldingPanel.caption().assertText(TODAY_ES);
        foldingPanel.setExpanded(true);
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        foldingPanel.content().assertText(TODAY_ES + WEEK_ES);

        // check 'ja' locale
        localeChanger.tabs().get(2).clickAndWait();
        testAppFunctionalPage("/components/loadbundle/withFoldingPanel.jsf"); // issue a GET request for view to update locale in JSP
        foldingPanel.caption().assertText(TODAY_JA);
        foldingPanel.setExpanded(true);
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        foldingPanel.content().assertText(TODAY_JA + WEEK_JA);

        // check 'ru' locale
        localeChanger.tabs().get(3).clickAndWait();
        testAppFunctionalPage("/components/loadbundle/withFoldingPanel.jsf"); // issue a GET request for view to update locale in JSP
        foldingPanel.caption().assertText(TODAY_RU);
        foldingPanel.setExpanded(true);
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        foldingPanel.content().assertText(TODAY_RU + WEEK_RU);

        // reset tab index for further running tests
        localeChanger.tabs().get(0).clickAndWait();
    }
View Full Code Here


        ElementInspector serverImage = element("formID:serverImage");
        serverImage.assertElementExists(false);
        ElementInspector serverText = element("formID:serverText");
        serverText.assertElementExists(false);

        FoldingPanelInspector serverFoldingPanel = foldingPanel("formID:serverFP");
        serverFoldingPanel.assertElementExists();
        serverFoldingPanel.toggle().clickAndWait();
        serverImage.assertVisible(true);
        serverText.assertVisible(true);
        serverText.assertText("test server loading mode");

        //check 'client' loading mode
        element("formID:clientFP::caption").assertVisible(true); //todo: use FoldingPanelInspector in such cases
        ElementInspector clientImage = element("formID:clientImage");
        clientImage.assertElementExists();
        clientImage.assertVisible(false);
        ElementInspector clientText = element("formID:clientText");
        clientText.assertElementExists();
        clientText.assertVisible(false);

        FoldingPanelInspector clientFoldingPanel = foldingPanel("formID:clientFP");
        clientFoldingPanel.assertElementExists();
        clientFoldingPanel.toggle().click();
        clientImage.assertVisible(true);
        clientText.assertVisible(true);
        clientText.assertText("test client loading mode");

        //check 'ajax' loading mode
        FoldingPanelInspector ajaxFoldingPanel = foldingPanel("formID:ajaxFP");
        ajaxFoldingPanel.caption().assertVisible(true);
        ElementInspector ajaxImage = element("formID:ajaxImage");
        ajaxImage.assertElementExists(false);
        ElementInspector ajaxText = element("formID:ajaxText");
        ajaxText.assertElementExists(false);

        ajaxFoldingPanel.assertElementExists();
        ajaxFoldingPanel.toggle().clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        ajaxImage.assertVisible(true);
        ajaxText.assertVisible(true);
        ajaxText.assertText("test ajax loading mode");

        /*check that content loaded once*/
        //collapse all FoldingPanels
        serverFoldingPanel.toggle().click();
        clientFoldingPanel.toggle().click();
        ajaxFoldingPanel.toggle().click();

        serverFoldingPanel.toggle().click();
        serverImage.assertVisible(true);
        serverText.assertVisible(true);

        clientFoldingPanel.toggle().click();
        clientImage.assertVisible(true);
        clientText.assertVisible(true);

        ajaxFoldingPanel.toggle().click();
        ajaxImage.assertVisible(true);
        ajaxText.assertVisible(true);
    }
View Full Code Here

     @Test
    public void testStyles() {
        testAppFunctionalPage("/components/foldingpanel/foldingPanelStyles.jsf");

        FoldingPanelInspector foldingPanel = foldingPanel("formID:styledFP");
        foldingPanel.assertStyle("border: 5px solid orange;");
        foldingPanel.assertExpressionEquals("offsetWidth", 200);
        foldingPanel.caption().assertStyle("border: 2px dashed blue; background: LightBlue; color: DarkOrange; font-weight: bold;");

        ElementInspector toggle = foldingPanel.toggle();
        ElementInspector toggleImage = toggle.getElementsByTagName("img").get(0);
        toggleImage.assertAttributeStartsWith("src", "collapsed.gif");

        toggle.mouseOver();
        toggle.mouseMove();
        toggleImage.assertAttributeStartsWith("src", "collapsed_rollover.gif");
        toggle.mouseDown();
        toggleImage.assertAttributeStartsWith("src", "collapsed_pressed.gif");
        toggle.mouseUp();
        toggleImage.assertAttributeStartsWith("src", "collapsed_rollover.gif");
        toggle.click();
        toggle.mouseOut();
        foldingPanel.mouseMove();
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();

        foldingPanel.content().assertStyle("background: LightYellow; color: red; border: 2px solid springgreen;");

        toggleImage.assertAttributeStartsWith("src", "expanded.gif");

        //todo: uncomment it if 'JSFC-3294' in 'fixed' state
/*
 
View Full Code Here

    @Ignore
     @Test
    public void disabledTestFPMessages() throws Exception {
        Selenium selenium = getSelenium();
        testAppFunctionalPage("/components/foldingpanel/foldingPanelAjax.jsf");
        FoldingPanelInspector fp2 = foldingPanel("form2:fp2");
        fp2.toggle().click();
        OpenFacesAjaxLoadingMode.getInstance().waitForLoad();
        selenium.type("form2:input2", "");
        selenium.click("form2:submitForm2");
        waitForPageToLoad();
        fp2.toggle().click();
        selenium.click("form2:submitForm2");
        waitForPageToLoad();
        assertFalse(selenium.isElementPresent("form1:input2"));
        assertFalse(selenium.isTextPresent("\"input2\": Value is required."));
        assertFalse(selenium.isTextPresent("Validation Error"));
View Full Code Here

    @Ignore
    public void testAjaxFoldingPanelInside() {
        testAppFunctionalPage("/components/foldingpanel/foldingPanelIn.jsf");

        foldingPanel("fn:foldingPanel_FoldingPanel").toggle().clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        FoldingPanelInspector foldingPanel = foldingPanel("fn:insiderFoldingPanel");
        foldingPanel.caption().assertElementExists();
        foldingPanel.content().assertVisible(false);

        foldingPanel.toggle().clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        foldingPanel.caption().assertElementExists();
        foldingPanel.content().assertVisible(true);
    }
View Full Code Here

        ElementInspector foldingPanelCaption = element("formID:foldingPanel_a4j_Caption");
        ElementInspector foldingPanelContent = element("formID:foldingPanel_a4j_Content");
        String oldCaptionValue = foldingPanelCaption.text();
        String oldContentValue = foldingPanelContent.text();

        FoldingPanelInspector foldingPanel = foldingPanel("formID:foldingPanel_a4j_ID");
        foldingPanel.toggle().click();
        element("formID:refresher_a4j").click();
        RichFacesAjaxLoadingMode.getInstance().waitForLoad();
        foldingPanel.toggle().clickAndWait(OpenFacesAjaxLoadingMode.getInstance());

        String newCaptionValue = foldingPanelCaption.text();
        String newContentValue = foldingPanelContent.text();
        assertFalse(newCaptionValue.equals(oldCaptionValue));
        assertFalse(newContentValue.equals(oldContentValue));
View Full Code Here

TOP

Related Classes of org.seleniuminspector.openfaces.FoldingPanelInspector

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.