Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.asText()


    }

    @Test
    public void testWebConsolePlugin() throws IOException {
        final HtmlPage page = webClient.getPage(prepareUrl(PLUGIN_SUFFIX));
        String text = page.asText();

        //Filter name should be part of Filter table
        assertTrue(text.contains("WebConsoleTestTurboFilter"));

        //Console name should be part of console table
View Full Code Here


    }

    @Test
    public void testPrinter() throws IOException {
        final HtmlPage page = webClient.getPage(prepareUrl(PRINTER_SUFFIX));
        String text = page.asText();

        //Should dump content of configured file testremote.log
        //with its name
        assertTrue(text.contains("testremote.log"));
    }
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

  }

  @Test
  public void testPipelining() throws Exception {
    HtmlPage page = executePageTest("pipeliningTest", null);
    JSONArray array = new JSONArray(page.asText());
    assertEquals(3, array.length());
    Map<String, JSONObject> jsonObjects = Maps.newHashMap();
    for (int i = 0; i < array.length(); i++) {
      JSONObject jsonObj = array.getJSONObject(i);
      assertTrue(jsonObj.has("id"));
View Full Code Here

    @Test
    public void shouldIncludeOrExcludeBodyCorrectly() throws IOException {
        WebClient client = new WebClient();
        HtmlPage page = client.getPage(url + "jsp-taglib-test.jsp");
        assertThat(page.asText())
            .contains("Feature [ACTIVE_FEATURE] is active")
            .doesNotContain("Feature [INACTIVE_FEATURE] is active");
    }

    @Test
View Full Code Here

    @Test
    public void shouldIncludeOrExcludeBodyCorrectlyInverseCondition() throws IOException {
        WebClient client = new WebClient();
        HtmlPage page = client.getPage(url + "jsp-taglib-inverse-test.jsp");
        assertThat(page.asText())
                .contains("Feature [INACTIVE_FEATURE] is inactive")
                .doesNotContain("Feature [ACTIVE_FEATURE] is inactive");
    }

}
View Full Code Here

        WebClient client = new WebClient();
        HtmlPage page = client.getPage(url + "index.jsf");

        // this part of the page is rendered
        assertTrue(page.asText().contains("Text for ENABLED feature!"));

        // this part is disabled
        assertFalse(page.asText().contains("Text for DISABLED feature!"));

        // one div can be found the other not
View Full Code Here

        // this part of the page is rendered
        assertTrue(page.asText().contains("Text for ENABLED feature!"));

        // this part is disabled
        assertFalse(page.asText().contains("Text for DISABLED feature!"));

        // one div can be found the other not
        assertNotNull(page.getElementById("enabledDiv"));
        assertNull(page.getElementById("disabledDiv"));
View Full Code Here

        System.out.print("Running:" + TEST_CASE + "\t\t\t");

        final HtmlPage page = (HtmlPage) _webClient.getPage(_url);
        //System.out.println(page.getTitleText());

        String responseText = page.asText();
        //System.out.println("html-->\n" + responseText);
        //check page header
        assertTrue(-1 != responseText.indexOf("Tuscany DAS Companies WEB Example"));
        //check table headers
        assertTrue(-1 != responseText.indexOf("ID"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.