Package com.gargoylesoftware.htmlunit.html

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


        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert isLongRunning(page);
        assert getCid(page) != null;
        assert page.getBody().getTextContent().contains("Cumulus congestus");
    }
View Full Code Here


        assert !isLongRunning(page);

        // begin a conversation and set a custom timeout
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationAndSetTimeout");
        page = beginConversationButton.click();
        assert page.getBody().getTextContent().contains("Cumulonimbus");
    }

    @Test
    @SpecAssertion(section = "6.7.5", id = "m")
View Full Code Here

        assert !isLongRunning(page);

        // begin a conversation
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class,
                "beginConversationButton");
        page = beginConversationButton.click();
        assert page.getBody().getTextContent().contains("Stratocumulus");
    }

    @Test
    public void testSuppressedConversationPropagation() throws Exception {
View Full Code Here

    public void testConversationPropagated() throws Exception {
        WebClient webClient = new WebClient();
        HtmlPage storm = webClient.getPage(getPath("storm.jsf"));
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
                "beginConversationButton");
        storm = beginConversationButton.click();
        HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");
        stormStrength.setValueAttribute(STORM_STRENGTH);
        String stormCid = getCid(storm);
        HtmlSubmitInput thunderButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "thunderButton");
        HtmlPage thunder = thunderButton.click();
View Full Code Here

        storm = beginConversationButton.click();
        HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");
        stormStrength.setValueAttribute(STORM_STRENGTH);
        String stormCid = getCid(storm);
        HtmlSubmitInput thunderButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "thunderButton");
        HtmlPage thunder = thunderButton.click();
        assert stormCid.equals(getCid(thunder));
        stormStrength = getFirstMatchingElement(thunder, HtmlTextInput.class, "stormStrength");
        assert stormStrength.getValueAttribute().equals(STORM_STRENGTH);
    }
View Full Code Here

    public void testConversationPropagatedOverRedirect() throws Exception {
        WebClient webClient = new WebClient();
        HtmlPage storm = webClient.getPage(getPath("storm.jsf"));
        HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class,
                "beginConversationButton");
        storm = beginConversationButton.click();
        HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");
        stormStrength.setValueAttribute(REDIRECT_STORM_STRENGTH);
        String stormCid = getCid(storm);
        HtmlSubmitInput lighteningButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "lighteningButton");
        HtmlPage lightening = lighteningButton.click();
View Full Code Here

        storm = beginConversationButton.click();
        HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");
        stormStrength.setValueAttribute(REDIRECT_STORM_STRENGTH);
        String stormCid = getCid(storm);
        HtmlSubmitInput lighteningButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "lighteningButton");
        HtmlPage lightening = lighteningButton.click();
        assert lightening.getWebResponse().getRequestUrl().toString().contains("lightening.jsf");
        assert stormCid.equals(getCid(lightening));
        stormStrength = getFirstMatchingElement(lightening, HtmlTextInput.class, "stormStrength");
        assert stormStrength.getValueAttribute().equals(REDIRECT_STORM_STRENGTH);
    }
View Full Code Here

            webClient.getOptions().setRedirectEnabled(false);

            // validate CSRF and get authorization code
            String redirectQuery;
            try {
                final Page redirectPage = submitInput.click();
                redirectQuery = redirectPage.getUrl().getQuery();
            } catch (FailingHttpStatusCodeException e) {
                // escalate non redirect errors
                if (e.getStatusCode() != HttpStatus.SC_MOVED_TEMPORARILY) {
                    throw e;
View Full Code Here

        final HtmlTextInput username = form.getInputByName("username");
        username.setValueAttribute(USERNAME);
        final HtmlPasswordInput password = form.getInputByName("password");
        password.setValueAttribute(USERNAME);
        final HtmlSubmitInput submit = form.getInputByName("submit");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
        return callbackUrl;
    }
   
View Full Code Here

        final HtmlTextInput sessionUsernameOrEmail = form.getInputByName("session[username_or_email]");
        sessionUsernameOrEmail.setValueAttribute("testscribeup@gmail.com");
        final HtmlPasswordInput sessionPassword = form.getInputByName("session[password]");
        sessionPassword.setValueAttribute("testpwdscribeup");
        final HtmlSubmitInput submit = authorizationPage.getHtmlElementById("allow");
        final HtmlPage callbackPage = submit.click();
        final String callbackUrl = callbackPage.getUrl().toString();
        logger.debug("callbackUrl : {}", callbackUrl);
        return callbackUrl;
    }
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.