Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage


        UIResource componentXcssComponent = createLoadStyleComponent();

        componentXcssComponent.setSrc(RESOURCE_URI_PREFIX + componentXcss);
        childrenList.add(componentXcssComponent);

        HtmlPage page = renderView();
        List<HtmlLink> styles = selectStylesByHhref(page, userXcss);

        assertEquals(2, styles.size());
        assertEquals("component", styles.get(0).getClassAttribute());
        assertEquals("user", styles.get(1).getClassAttribute());
View Full Code Here


        List<UIComponent> childrenList = facesContext.getViewRoot().getChildren();

        childrenList.add(userComponent);
        childrenList.add(new ResourceDependentComponent(true, new AjaxScript()));

        HtmlPage page = renderView();
        List<HtmlScript> scripts = selectScriptsBySrc(page, "AjaxScript");

        assertEquals(1, scripts.size());
        scripts = selectScriptsBySrc(page, "AJAX.js");
View Full Code Here

        return "graph-test";
    }

    @Test
    public void testRequest() throws Exception {
        HtmlPage page = requestPage();
        HtmlInput input = getInput(page);
        assertNotNull(input);
    }
View Full Code Here

        return submit.click();
    }

    @Test
    public void testSubmitTooShortValue() throws Exception {
        HtmlPage page = submitValueAndCheckMessage("", containsString(GraphBean.SHORT_MSG));
        checkMessage(page, "textMessage", containsString(GraphBean.SHORT_MSG));
        checkMessage(page, "graphMessage", equalTo(""));
    }
View Full Code Here

        checkMessage(page, "graphMessage", equalTo(""));
    }

    @Test
    public void testBeanLevelConstrain() throws Exception {
        HtmlPage page = submitValueAndCheckMessage("bar", equalTo(GraphBean.FOO_MSG));
        checkMessage(page, "graphMessage", containsString(GraphBean.FOO_MSG));
        checkMessage(page, "textMessage", equalTo(""));
    }
View Full Code Here

        return "test";
    }

    @Test
    public void testRequest() throws Exception {
        HtmlPage page = requestPage();
        HtmlInput input = getInput(page);
        assertNotNull(input);
    }
View Full Code Here

        environment.release();
        environment = null;
    }

    protected HtmlPage submitValueAndCheckMessage(String value, Matcher<String> matcher) throws Exception {
        HtmlPage page = requestPage();
        HtmlInput input = getInput(page);
        page = (HtmlPage) input.setValueAttribute(value);
        page = submit(page);
        checkMessage(page, "uiMessage", matcher);
        return page;
View Full Code Here

        HtmlInput input = htmlForm.getInputByName("form:text");
        return input;
    }

    protected HtmlPage requestPage() throws IOException {
        HtmlPage page = environment.getPage("/" + getPageName() + ".jsf");
        return page;
    }
View Full Code Here

    public void testSmokes()
        throws Exception
    {
        client.setThrowExceptionOnFailingStatusCode( false );
        HtmlPage page = client.getPage( baseUrl + "index.html" );
        assertFalse( page.asText().contains( "Hello World" ) );
    }
View Full Code Here

    public void testSmokes()
        throws Exception
    {
        client.setThrowExceptionOnFailingStatusCode( false );
        HtmlPage page = client.getPage( baseUrl + "index.html" );
        assertTrue( page.asText().contains( "Hello World" ) );
    }
View Full Code Here

TOP

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

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.