Package org.seleniuminspector

Examples of org.seleniuminspector.ElementInspector


     @Test
    public void testAjaxTabbedPaneInside() {
        testAppFunctionalPage("/components/foldingpanel/tabbedPaneIn.jsf");
        tabSet("fn:loadingModes").setTabIndex(1, ServerLoadingMode.getInstance());

        ElementInspector tabbedPane = element("fn:tabbedPaneID");
        tabbedPane.assertElementExists();
        tabbedPane.assertVisible(false);

        foldingPanel("fn:tabbedPaneFoldingPanel").toggle().click();

        tabbedPane.assertVisible(true);

        element("fn:firstHeader").assertText("First tab");
        element("fn:firstContent").assertText("Some text on the first tab");
        ElementInspector secondHeader = element("fn:secondHeader");
        secondHeader.assertText("Second tab");

        secondHeader.clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        element("fn:secondContent").assertText("Some text on the second tab");
    }
View Full Code Here


            public void waitForLoad() {
                sleep(5000);
            }
        });

        ElementInspector tabSet = element("fn:tabSetID");
        tabSet.assertElementExists();
        tabSet.assertVisible(false);

        foldingPanel("fn:tabSetFoldingPanel").toggle().click();
        element("fn:firstTab").assertText("Client");

        ElementInspector secondTab = element("fn:secondTab");
        secondTab.click();
        secondTab.assertText("Server");
    }
View Full Code Here

     @Test
    public void testValidationInside() {
        testAppFunctionalPage("/components/foldingpanel/validationIn.jsf");
        tabSet("fn:loadingModes").setTabIndex(1, ServerLoadingMode.getInstance());

        ElementInspector requiredInput = element("fn:required_input");
        requiredInput.assertElementExists();
        requiredInput.assertVisible(false);

        ElementInspector message = element("fn:validationMessage");
        message.assertElementExists();
        message.assertVisible(false);

        foldingPanel("fn:validationFoldingPanel").toggle().click();

        requiredInput.assertVisible(true);
        message.assertVisible(false);

        requiredInput.keyPress(13);

        message.assertVisible(true);
        message.assertContainsText("Value is required.");
        element("fn:validationMessage").assertVisible(true);
    }
View Full Code Here

public class InputTextTest extends OpenFacesTestCase {
     @Test
    public void testTypedValue() {
        testAppFunctionalPage("/components/inputtext/inputTextFieldBaseFunctionality.jsf");

        ElementInspector value = element("formID:value");
        ElementInspector value2 = element("formID:value2");
        value.assertText("");
        value2.assertText("");
        InputTextInspector first = inputText("formID:first");
        InputTextInspector second = inputText("formID:second");
        first.assertValue("");
        second.assertValue("some prompt text");

        ElementInspector submit = element("formID:submit");

        // fill by empty values
        first.clear();
        second.clear();
        first.assertValue("");
        second.assertValue("");
//        second.fireEvent("onblur");
        value.click(); // onblur
        second.assertValue("some prompt text");
        submit.clickAndWait();
        value.assertText("");
        value2.assertText("");
        first.assertValue("");
        second.assertValue("some prompt text");

        // type own value
        // fill by empty values
        first.clear();
        second.clear();
        first.type("val1");
        first.assertValue("val1");
        second.type("val2");
        second.assertValue("val2");
        submit.clickAndWait();
        value.assertText("val1");
        value2.assertText("val2");
        first.assertValue("val1");
        second.assertValue("val2");
    }
View Full Code Here

     @Test
    public void testFocusAndBlurEvent() {
        testAppFunctionalPage("/components/inputtext/inputTextFieldBaseFunctionality.jsf");

        ElementInspector value = element("formID:value");
        ElementInspector value2 = element("formID:value2");
        value.assertText("");
        value2.assertText("");
        InputTextInspector first = inputText("formID:first");
        InputTextInspector second = inputText("formID:second");
        first.assertValue("");
        second.assertValue("some prompt text");
View Full Code Here

     @Test
    public void testValueChangeListener() {
        testAppFunctionalPage("/components/inputtext/inputTextValueChangeListener.jsf");

        ElementInspector asAttributeOutput = element("formID:asAttributeOutput");
        ElementInspector asTagOutput = element("formID:asTagOutput");
        asAttributeOutput.assertText("0");
        asTagOutput.assertText("false");

        inputText("formID:first").type("Yellow");
        inputText("formID:second").type("Yellow");

        element("formID:submit").clickAndWait();

        asAttributeOutput.assertText("1");
        asTagOutput.assertText("true");
    }
View Full Code Here

     @Test
    public void testReRenderThroughA4J() {
        Selenium selenium = getSelenium();
        testAppFunctionalPage("/components/hintlabel/hintLabel_a4j.jsf");

        ElementInspector hintLabel = element("formID:hintLabelID");
        String oldValue = hintLabel.text();
        hintLabel.mouseOver();
        String oldHintBody = selenium.getBodyText();
        String[] oldHintValue = oldHintBody.split("<!--");
        String oldHint = oldHintValue[0];
        element("formID:refresher").click();
        RichFacesAjaxLoadingMode.getInstance().waitForLoad();
        String newValue = hintLabel.text();
        hintLabel.mouseOver();
        String newHintBody = selenium.getBodyText();
        String[] newHintValue = newHintBody.split("<!--");
        String newHint = newHintValue[0];
        assertFalse(newHint.equals(oldHint));
        assertFalse(newValue.equals(oldValue));
View Full Code Here

     @Test
    public void testDynamicImageClientSideEvents() {
        Selenium selenium = getSelenium();
        testAppFunctionalPage("/components/dynamicimage/dynamicImage_clientEvents.jsf");

        ElementInspector dynamicImage = element("form1:dynamicImage1");

        //onclick
        dynamicImage.click();
        assertTrue(selenium.isTextPresent("click"));

        //ondblclick
        dynamicImage.doubleClick();
        assertTrue(selenium.isTextPresent("dblclick"));

        //onmousedown
        dynamicImage.mouseDown();
        assertTrue(selenium.isTextPresent("mousedown"));

        //onmouseup
        dynamicImage.mouseUp();
        assertTrue(selenium.isTextPresent("mouseup"));

        //onmouseover
        dynamicImage.mouseOver();
        assertTrue(selenium.isTextPresent("mouseover"));

        //onmouseout
        dynamicImage.mouseOut();
        assertTrue(selenium.isTextPresent("mouseout"));

        //onmousemove
        dynamicImage.mouseMove();
        assertTrue(selenium.isTextPresent("mousemove"));

    }
View Full Code Here

    }

     @Test
    public void testTabbedPaneAjax() throws Exception {
        testAppFunctionalPage("/components/tabbedpane/tabbedPaneAjax.jsf");
        ElementInspector tab1Output = element("form1:tab1Output");
        tab1Output.assertElementExists(true);
        ElementInspector tab2Output = element("form1:tab2Output");
        tab2Output.assertElementExists(false);
        ElementInspector tab3Output = element("form1:tab3Output");
        tab3Output.assertElementExists(false);
        ElementInspector tab4Output = element("form1:tab4Output");
        tab4Output.assertElementExists(false);
        List<ElementInspector> tabs = tabbedPane("form1:tp1").tabSet().tabs();
        tabs.get(1).clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        tab2Output.assertElementExists(true);
        tabs.get(2).clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        tab3Output.assertElementExists(true);
        tabs.get(3).clickAndWait(OpenFacesAjaxLoadingMode.getInstance());
        tab4Output.assertElementExists(true);
        tabs.get(0).click();
        tab1Output.assertElementExists(true);
    }
View Full Code Here

    public void testServerDefaultPresentation() {
        closeBrowser();
        testAppFunctionalPage("/components/validation/serverDefaultPresentation.jsf");
        isNotDefaultPresentation();
        element("testForm:fillInvalidData").click();
        ElementInspector submit = element("testForm:fmSubmit");
        submit.click();
        waitForPageToLoad();
        isDefaultPresentation();
        fillValidDataForClientSideAPI();
        submit.click();
        waitForPageToLoad();
        isNotDefaultPresentation();
    }
View Full Code Here

TOP

Related Classes of org.seleniuminspector.ElementInspector

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.