Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlSubmitInput.click()


    public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception {
        WebClient client = new WebClient();
        HtmlPage storm = client.getPage(getPath("storm.jsf"));
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
                "beginConversationButton");
        storm = beginConversationButton.click();

        resetCloud(client);

        client.getPage(getPath("cloud.jsf", getCid(storm)));
        assert !isCloudDestroyed(client);
View Full Code Here


        HtmlPage rain = client.getPage(getPath("rain.jsf"));

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class,
                "beginConversationButton");
        rain = beginConversationButton.click();
        String cid = getCid(rain);

        // Cause rain
        HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
        rain = rainButton.click();
View Full Code Here

        rain = beginConversationButton.click();
        String cid = getCid(rain);

        // Cause rain
        HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
        rain = rainButton.click();

        // Re-request the page, inside the conversation and check it has rained
        rain = client.getPage(getPath("rain.jsf", cid));
        assert hasRained(rain);
View Full Code Here

        HtmlPage rain = client.getPage(getPath("rain.jsf"));

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class,
                "beginConversationButton");
        rain = beginConversationButton.click();
        String cid = getCid(rain);

        // Cause rain
        HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
        rain = rainButton.click();
View Full Code Here

        rain = beginConversationButton.click();
        String cid = getCid(rain);

        // Cause rain
        HtmlSubmitInput rainButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "rain");
        rain = rainButton.click();

        // Re-request the page, inside the conversation and check it has rained
        rain = client.getPage(getPath("rain.jsf", cid));
        assert hasRained(rain);
View Full Code Here

        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);
    }

    @Test(groups = { CONTEXTS })
    @SpecAssertion(section = "6.7.5", id = "r")
View Full Code Here

        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);

        // begin a conversation again and check that IllegalStateException is thrown
        HtmlSubmitInput beginConversationButton2 = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationAndSwallowException");
View Full Code Here

        assert isLongRunning(page);

        // begin a conversation again and check that IllegalStateException is thrown
        HtmlSubmitInput beginConversationButton2 = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationAndSwallowException");
        page = beginConversationButton2.click();
        assert page.getBody().getTextContent().contains("Hello world!");
    }

    @Test(groups = { CONTEXTS })
    @SpecAssertion(section = "6.7.5", id = "s")
View Full Code Here

        assertFalse(isLongRunning(page));

        // Begin a conversation with explicit id
        HtmlSubmitInput beginConversationButton = (HtmlSubmitInput) page
                .getElementById("form:beginNextConversationIdentifiedByCustomIdentifier");
        page = beginConversationButton.click();
        assertTrue(isLongRunning(page));

        // Try it again with the same id
        page = client.getPage(getPath("cumulus.jsf"));
        beginConversationButton = (HtmlSubmitInput) page
View Full Code Here

        // Try it again with the same id
        page = client.getPage(getPath("cumulus.jsf"));
        beginConversationButton = (HtmlSubmitInput) page
                .getElementById("form:beginConversationIdentifiedByCustomIdentifierAndSwallowException");
        page = beginConversationButton.click();
        // Exception is swallowed and the browser is redirected to home
        assertTrue(page.getBody().getTextContent().contains("Hello world!"));
    }

    @Test(groups = { CONTEXTS })
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.