Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlDivision


    @Test
    @Ignore // broke with the jQuery 1.6.2 upgrade
    public void testServerClick() throws IOException, SAXException {
        HtmlPage page = environment.getPage("/dropDownMenu_serverMode.jsf");
        HtmlDivision item = (HtmlDivision) page.getElementById("form:saveAll");
        assertNotNull(item);
        DropDownMenuBean.setCurrent("none");
        item.click();

        item = (HtmlDivision) page.getElementById("form:saveAll");
        assertNotNull(item);
        assertEquals("action", DropDownMenuBean.getCurrent());
    }
View Full Code Here


    @Test
    @Ignore
    public void testAjaxClick() throws IOException, SAXException {
        HtmlPage page = environment.getPage("/dropDownMenu_ajaxMode.jsf");
        HtmlDivision item = (HtmlDivision) page.getElementById("form:saveAll");
        assertNotNull(item);
        DropDownMenuBean.setCurrent("none");
        item.click();

        item = (HtmlDivision) page.getElementById("form:saveAll");
        assertNotNull(item);
        assertEquals("action", DropDownMenuBean.getCurrent());
    }
View Full Code Here

    @Test
    @Ignore // broke with the jQuery 1.6.2 upgrade
    public void testServerClick() throws IOException, SAXException {
        HtmlPage page = environment.getPage("/menuItem_serverMode.jsf");

        HtmlDivision item = (HtmlDivision) page.getElementById("form:menuItem");
        assertNotNull(item);
        DropDownMenuBean.setCurrent("none");
        item.click();

        item = (HtmlDivision) page.getElementById("form:menuItem");
        assertNotNull(item);
        assertEquals("action", DropDownMenuBean.getCurrent());
    }
View Full Code Here

    @Test
    @Ignore
    public void testAjaxClick() throws IOException, SAXException {
        HtmlPage page = environment.getPage("/menuItem_ajaxMode.jsf");
        HtmlDivision item = (HtmlDivision) page.getElementById("form:menuItem");
        assertNotNull(item);
        DropDownMenuBean.setCurrent("none");
        item.click();
        item = (HtmlDivision) page.getElementById("form:menuItem");
        assertNotNull(item);
        assertEquals("action", DropDownMenuBean.getCurrent());
    }
View Full Code Here

    }

    @Test
    public void testClientClick() throws IOException, SAXException {
        HtmlPage page = environment.getPage("/menuItem_clientMode.jsf");
        HtmlDivision item = (HtmlDivision) page.getElementById("form:menuItem");
        assertNotNull(item);
        DropDownMenuBean.setCurrent("none");
        item.click();

        item = (HtmlDivision) page.getElementById("form:menuItem");
        assertNotNull(item);
        assertEquals("none", DropDownMenuBean.getCurrent());
    }
View Full Code Here

        webClient.setJavaScriptEnabled( true );
        final HtmlPage page = webClient.getPage( uri.toURL() );

        final HtmlAnchor a =
            (HtmlAnchor) page.getByXPath( "//a[contains(@href, 'surefire260_TestB_testDup')]" ).get( 0 );
        final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260_TestB_testDuperror" );
        assertTrue( content.getAttribute( "style" ).contains( "none" ) );
        a.click();
        assertFalse( content.getAttribute( "style" ).contains( "none" ) );
        webClient.closeAllWindows();
    }
View Full Code Here

        webClient.setJavaScriptEnabled( true );
        final HtmlPage page = webClient.getPage( uri.toURL() );

        final HtmlAnchor a =
            (HtmlAnchor) page.getByXPath( "//a[contains(@href, 'surefire260_TestB_testDup')]" ).get( 0 );
        final HtmlDivision content = (HtmlDivision) page.getElementById( "surefire260_TestB_testDuperror" );
        assertTrue( content.getAttribute( "style" ).contains( "none" ) );
        a.click();
        assertFalse( content.getAttribute( "style" ).contains( "none" ) );
        webClient.closeAllWindows();
    }
View Full Code Here

     * Checks that the given error exists in the message panel
     * @param page the page
     * @param expectedError the text of the expected error
     */
    public static void testErrorExists(HtmlPage page, String expectedError) {
        HtmlDivision messagesDiv = page.getHtmlElementById("messages");
        List<HtmlElement> errors = messagesDiv.getElementsByAttribute("ul", "class", "errors");
        assertFalse("No error found", errors.isEmpty());
        boolean found = errorOrMessageExists(errors, expectedError);
        assertTrue("This error wasn't found", found);
    }
View Full Code Here

     * Checks that the given success message exists in the message panel
     * @param page the page
     * @param expectedMessage the text of the expected message
     */
    public static void testMessageExists(HtmlPage page, String expectedMessage) {
        HtmlDivision messagesDiv = page.getHtmlElementById("messages");
        List<HtmlElement> messages = messagesDiv.getElementsByAttribute("ul", "class", "messages");
        assertFalse("No message found", messages.isEmpty());
        boolean found = errorOrMessageExists(messages, expectedMessage);
        assertTrue("This message wasn't found", found);
    }
View Full Code Here

        form.getInputByName("login").setValueAttribute("login4");
        form.getInputByName("password").setValueAttribute("password4");
        form.getInputByValue("Modify card").click();

        testMessageExists(page, "The card \"card4\" has been modified.");
        HtmlDivision cardsDiv = page.getHtmlElementById("cards");
        List<HtmlDivision> cardDivs = cardsDiv.getElementsByAttribute("div", "class", "card");
        assertEquals(3, cardDivs.size());
        assertTrue(cardsDiv.asText().contains("card4"));
        assertFalse(cardsDiv.asText().contains("card1"));
    }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlDivision

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.