Examples of asText()


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

    @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

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

    @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

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

        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

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

        // 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

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

        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

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

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doFill");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        // check table headers
        assertTrue(-1 != responseText.indexOf("ID"));
        assertTrue(-1 != responseText.indexOf("Name"));
        //check table values
View Full Code Here

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

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doFillAll");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check table headers
        assertTrue(-1 != responseText.indexOf("ID"));
        assertTrue(-1 != responseText.indexOf("Name"));
        assertTrue(-1 != responseText.indexOf("Department_ID"));
View Full Code Here

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

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doAddDepartment");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check new department
        assertTrue(-1 != responseText.indexOf("79"));

        System.out.println("SUCCESS!!!");
View Full Code Here

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

        final HtmlSubmitInput allCompaniesButton = (HtmlSubmitInput)form.getHtmlElementById("doChangeDepartmentNames");
        // Now submit the form by clicking the button
        final HtmlPage resultPage = (HtmlPage)allCompaniesButton.click();

        //verify the resultPage
        String responseText = resultPage.asText();
        //System.out.println("html-->\n" + responseText);
        //check update departments
        assertTrue(-1 != responseText.indexOf("Dept-"));
        //also, check to not have old departments names (default name)
        assertTrue(-1 == responseText.indexOf("Default Name"));
View Full Code Here

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

        Iterator<?> ss = page.getAllHtmlChildElements();
        ss.next();
        ss.next();
        ss.next();
        HtmlParagraph p = (HtmlParagraph)ss.next();
        assertEquals("Hello world", p.asText());
    }

}
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.