Package com.thoughtworks.inproctester.jerseytester.webdriver

Examples of com.thoughtworks.inproctester.jerseytester.webdriver.JerseyClientHtmlunitDriver.findElement()


    @Test
    public void shouldRenderStatusPage() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
        webDriver.get("http://localhost");
        assertThat(webDriver.getTitle(), is("Status"));
        assertThat(webDriver.findElement(By.id("accept_header.value")).getText(), is("text/html"));
    }

    @Test
    public void shouldReadCookiesFromRequest() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
View Full Code Here


        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
        webDriver.get("http://localhost");
        webDriver.manage().addCookie(new Cookie("cookieone", "valueone", "localhost", "/", null));
        webDriver.get("http://localhost");
        assertThat(webDriver.getTitle(), is("Status"));
        assertThat(webDriver.findElement(By.id("cookie_header.value")).getText(), is("cookieone=valueone;"));
    }

    @Test
    public void shouldReadCookiesFromInChildPage() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
View Full Code Here

        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
        webDriver.get("http://localhost");
        webDriver.manage().addCookie(new Cookie("cookieone", "valueone", "localhost", "/", null));
        webDriver.get("http://localhost/cookie");
        assertThat(webDriver.getTitle(), is("Cookie"));
        assertThat(webDriver.findElement(By.id("cookie_header.value")).getText(), is("cookieone=valueone;"));
    }

    @Test
    public void shouldNotSeeCookieFromDifferentDomain() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
View Full Code Here

        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
        webDriver.get("http://localhost");
        webDriver.manage().addCookie(new Cookie("cookieone", "valueone", "localhost", "/", null));
        webDriver.get("http://thoughtworks");
        assertThat(webDriver.getTitle(), is("Status"));
        assertThat(webDriver.findElement(By.id("cookie_header.value")).getText(), is(""));
    }

    @Test
    public void shouldNotSeeCookieForDifferentPath() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
View Full Code Here

        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
        webDriver.get("http://localhost");
        webDriver.manage().addCookie(new Cookie("cookieone", "valueone", "localhost", "/cookie", null));
        webDriver.get("http://localhost");
        assertThat(webDriver.getTitle(), is("Status"));
        assertThat(webDriver.findElement(By.id("cookie_header.value")).getText(), is(""));
    }

    @Test
    public void ajaxPostShouldShowFormContent() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
View Full Code Here

    @Test
    public void ajaxPostShouldShowFormContent() {
        WebDriver webDriver = new JerseyClientHtmlunitDriver(client);
        webDriver.get("http://localhost");
        webDriver.findElement(By.id("my-form")).submit();
        assertThat(webDriver.getPageSource(), containsString(DataConstants.AJAX_JSON_DUMMY_DATA_KEY));
        assertThat(webDriver.getPageSource(), containsString(DataConstants.AJAX_JSON_DUMMY_DATA_VALUE));
    }

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