Examples of HtmlSpan


Examples of br.com.objectos.way.ui.builder.HtmlSpan

*/
@Test
public class HtmlSpanText {

  public void span() {
    HtmlSpan ui = Html.span().end();

    assertThat(ui, hasToString(equalTo("<span></span>")));
  }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    @Test(groups = { CONTEXTS })
    @SpecAssertion(section = "6.7.4", id = "a")
    public void testConversationActiveDuringNonFacesRequest() throws Exception {
        WebClient client = new WebClient();
        HtmlPage page = client.getPage(getPath("cloud.jsf"));
        HtmlSpan span = getFirstMatchingElement(page, HtmlSpan.class, "cloudName");
        assert span.getTextContent().equals(Cloud.NAME);
    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Execute the "Subview Processing" path.</p>
     */
    public void testExecute() throws Exception {

        HtmlSpan span, expected, actual = null;
        HtmlSubmitInput submit = null;

        // setUp() should have put us on the first page
        assertEquals("Subview Processing (Page 1 of 2)", title());

        // Verify contents of the first page
        span = (HtmlSpan) element("form:subview_alpha:alpha");
        assertNotNull(span);
        assertEquals("This is the alpha dynamic include", span.asText());

        span = (HtmlSpan) element("form:subview_beta:beta");
        assertNotNull(span);
        assertEquals("This is the beta dynamic include", span.asText());

        expected = (HtmlSpan) element("form:expected");
        assertNotNull(expected);
        actual = (HtmlSpan) element("form:actual");
        assertNotNull(actual);
        assertEquals(expected.asText(), actual.asText());

        // Advance to the second page
        submit = (HtmlSubmitInput) element("form:continue");
        assertNotNull(submit);
        submit(submit);
        assertEquals("Subview Processing (Page 2 of 2)", title());

        // Verify the contents of the second page
        span = (HtmlSpan) element("form:subview_gamma:gamma");
        assertNotNull(span);
        assertEquals("This is the gamma dynamic include", span.asText());

        span = (HtmlSpan) element("form:subview_delta:delta");
        assertNotNull(span);
        assertEquals("This is the delta dynamic include", span.asText());

        expected = (HtmlSpan) element("form:expected");
        assertNotNull(expected);
        actual = (HtmlSpan) element("form:actual");
        assertNotNull(actual);
        assertEquals(expected.asText(), actual.asText());

        // Advance to the third page
        submit = (HtmlSubmitInput) element("form:continue");
        assertNotNull(submit);
        submit(submit);
        assertEquals("Subview Processing (Page 2 of 2)", title());

        // Verify the contents of the third page
        span = (HtmlSpan) element("form:subview_gamma:gamma");
        assertNotNull(span);
        assertEquals("This is the gamma dynamic include", span.asText());

        span = (HtmlSpan) element("form:subview_delta:delta");
        assertNotNull(span);
        assertEquals("This is the delta dynamic include", span.asText());

        expected = (HtmlSpan) element("form:expected");
        assertNotNull(expected);
        actual = (HtmlSpan) element("form:actual");
        assertNotNull(actual);
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Execute the "Jndi Access" path.</p>
     */
    public void testExecute() throws Exception {

        HtmlSpan span, expected, actual = null;
        HtmlSubmitInput submit = null;

        // setUp() should have put us on the page
        assertEquals("JNDI Test Title", title());

View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Submit incorrect input fields and verify the correct response.</p>
     */
    public void testIncorrect() throws Exception {

        HtmlSpan span = null;
        HtmlTextInput username = (HtmlTextInput) element("form:username");
        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");

        username.setValueAttribute("bb");
        password.setValueAttribute("");
        submit(submit);

        assertEquals("logon", title());

        span = (HtmlSpan) element("globalErrors");
        assertNotNull(span);
        assertEquals("[EH][EP] can not be less than 3 characters.[ES]" +
                     "[EP] is required.[ES][EF]",
                     span.asText());

        username = (HtmlTextInput) element("form:username");
        assertNotNull(username);
        assertEquals("bb", username.getValueAttribute());

        span = (HtmlSpan) element("form:usernameErrors");
        assertNotNull(span);
        // FIXME:  response string should really include "Username:"
        assertEquals("[EH][EP] can not be less than 3 characters.[ES][EF]",
                     span.asText());

        password = (HtmlPasswordInput) element("form:password");
        assertNotNull(password);
        assertEquals("", password.getValueAttribute());

        span = (HtmlSpan) element("form:passwordErrors");
        assertNotNull(span);
        // FIXME:  response string should really include "Password:"
        assertEquals("[EH][EP] is required.[ES][EF]", span.asText());

    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

     * <p>Verify the content of a pristine page returned when executing this
     * view for the first time.</p>
     */
    public void testPristine() throws Exception {

        HtmlSpan span = null;

        HtmlElement html = page.getDocumentElement();
        assertEquals("html", html.getTagName());
        assertEquals("http://www.w3.org/1999/xhtml", html.getAttributeValue("xmlns"));

        assertEquals("logon", title());

        HtmlForm form = (HtmlForm) element("form");
        assertNotNull(form);
        assertEquals("", form.getAcceptAttribute());
        assertEquals("", form.getAcceptCharsetAttribute());
        String url = this.url.toString();
        url = url.substring(0, url.length() - 1);
        url = url.substring(url.lastIndexOf('/'));
        String action = form.getActionAttribute();
        int semicolon = action.indexOf(';');
        if (semicolon >= 0) {
            action = action.substring(0, semicolon);
        }
        assertEquals(url + "/logon.faces", action);
        assertEquals("", form.getEnctypeAttribute());
        assertEquals("post", form.getMethodAttribute());
        assertEquals("logonForm", form.getNameAttribute());
        assertEquals("", form.getOnResetAttribute());
        assertEquals("", form.getOnSubmitAttribute());
        assertEquals("", form.getTargetAttribute());

        span = (HtmlSpan) element("form:usernamePrompt");
        assertNotNull(span);
        assertEquals("Username:", span.asText());

        HtmlTextInput username = (HtmlTextInput) element("form:username");
        assertNotNull(username);
        assertEquals("", username.getLangAttribute());
        assertEquals("form:username", username.getNameAttribute());
        assertEquals("", username.getOnClickAttribute());
        assertEquals("", username.getOnDblClickAttribute());
        assertEquals("", username.getOnKeyDownAttribute());
        assertEquals("", username.getOnKeyPressAttribute());
        assertEquals("", username.getOnKeyUpAttribute());
        assertEquals("", username.getOnMouseDownAttribute());
        assertEquals("", username.getOnMouseMoveAttribute());
        assertEquals("", username.getOnMouseOutAttribute());
        assertEquals("", username.getOnMouseOverAttribute());
        assertEquals("", username.getOnMouseUpAttribute());
        assertEquals("text", username.getTypeAttribute());
        assertEquals("", username.getValueAttribute());

        span = (HtmlSpan) element("form:passwordPrompt");
        assertNotNull(span);
        assertEquals("Password:", span.asText());

        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        assertNotNull(password);
        assertEquals("", password.getLangAttribute());
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Submit known-bad mismatch and verify the correct response.</p>
     */
    public void testMismatch() throws Exception {

        HtmlSpan span = null;
        HtmlTextInput username = (HtmlTextInput) element("form:username");
        HtmlPasswordInput password = (HtmlPasswordInput)
            element("form:password");
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");

        username.setValueAttribute("baduser");
        password.setValueAttribute("badpass");
        submit(submit);

        assertEquals("logon", title());

        span = (HtmlSpan) element("globalErrors");
        assertNotNull(span);
        assertEquals("[EH][EP]Invalid username/password combination[ES][EF]",
                     span.asText());

        username = (HtmlTextInput) element("form:username");
        assertNotNull(username);
        assertEquals("baduser", username.getValueAttribute());

        span = (HtmlSpan) element("form:usernameErrors");
        assertNotNull(span);
        assertEquals("", span.asText());

        password = (HtmlPasswordInput) element("form:password");
        assertNotNull(password);
        assertEquals("", password.getValueAttribute());

        span = (HtmlSpan) element("form:passwordErrors");
        assertNotNull(span);
        assertEquals("", span.asText());

    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

     * <p>Verify the content of a pristine page returned when executing this
     * view for the first time.</p>
     */
    public void testPristine() throws Exception {

        HtmlSpan span = null;
        assertEquals("context", title());

        // Validate FacesContext Values

        span = (HtmlSpan) element("form:renderKitIdFC");
        assertEquals("HTML_BASIC", span.asText());

        span = (HtmlSpan) element("form:viewIdFC");
        assertEquals("/context.jsp", span.asText());

        // Validate ExternalContext Values

        span = (HtmlSpan) element("form:authTypeEC");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:remoteUserEC");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:requestContextPathEC");
        assertEquals("/struts-faces-systest1", span.asText()); // FIXME - Ant property?


        span = (HtmlSpan) element("form:requestLocaleEC");
        String formRequestLocaleEC = span.asText(); // FIXME - validate this

        span = (HtmlSpan) element("form:requestPathInfoEC");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:requestServletPathEC");
        assertEquals("/context.jsp", span.asText());

        // Validate HttpServletRequest Values

        span = (HtmlSpan) element("form:authTypeRQ");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:contextPathRQ");
        assertEquals("/struts-faces-systest1", span.asText()); // FIXME - Ant property?

        span = (HtmlSpan) element("form:localeRQ");
        assertEquals(formRequestLocaleEC, span.asText());

        span = (HtmlSpan) element("form:pathInfoRQ");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:remoteUserRQ");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:servletPathRQ");
        assertEquals("/context.jsp", span.asText());

        // Validate ServletContext Values

        span = (HtmlSpan) element("form:majorVersionSC");
        assertEquals("2", span.asText());

        span = (HtmlSpan) element("form:minorVersionSC");
        assertTrue("3".equals(span.asText()) || "4".equals(span.asText()));

    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Submit the initial form and validate the resulting values.</p>
     */
    public void testSubmit() throws Exception {

        HtmlSpan span = null;
        HtmlSpan spanCA = null;
        HtmlSubmitInput submit = (HtmlSubmitInput) element("form:submit");
        submit(submit);
        assertEquals("context1", title());

        // Validate FacesContext Values

        span = (HtmlSpan) element("form:renderKitIdFC");
        assertEquals("HTML_BASIC", span.asText());

        span = (HtmlSpan) element("form:viewIdFC");
        assertEquals("/context1.jsp", span.asText());

        // Validate ExternalContext Values

        span = (HtmlSpan) element("form:authTypeEC");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:remoteUserEC");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:requestContextPathEC");
        assertEquals("/struts-faces-systest1", span.asText()); // FIXME - Ant property?

        span = (HtmlSpan) element("form:requestLocaleEC");
        String formRequestLocaleEC = span.asText(); // FIXME - validate this

        span = (HtmlSpan) element("form:requestPathInfoEC");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:requestServletPathEC");
        assertEquals("/context1.jsp", span.asText());

        // Validate HttpServletRequest Values

        span = (HtmlSpan) element("form:authTypeRQ");
        assertEquals("", span.asText());

        span = (HtmlSpan) element("form:contextPathRQ");
        assertEquals("/struts-faces-systest1", span.asText()); // FIXME - Ant property?
        spanCA = (HtmlSpan) element("form:contextPathCA");
        assertEquals(span.asText(), spanCA.asText());

        span = (HtmlSpan) element("form:localeRQ");
        assertEquals(formRequestLocaleEC, span.asText());
        spanCA = (HtmlSpan) element("form:localeCA");
        assertEquals(span.asText(), spanCA.asText());

        span = (HtmlSpan) element("form:pathInfoRQ");
        assertEquals("", span.asText());
        spanCA = (HtmlSpan) element("form:pathInfoCA");
        assertEquals(span.asText(), spanCA.asText());

        span = (HtmlSpan) element("form:remoteUserRQ");
        assertEquals("", span.asText());
        spanCA = (HtmlSpan) element("form:remoteUserCA");
        assertEquals(span.asText(), spanCA.asText());

        span = (HtmlSpan) element("form:servletPathRQ");
        assertEquals("/context1.jsp", span.asText());
        spanCA = (HtmlSpan) element("form:servletPathCA");
        assertEquals("/context.faces", spanCA.asText());

        // Validate ServletContext Values

        span = (HtmlSpan) element("form:majorVersionSC");
        assertEquals("2", span.asText());
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

     * <p>Verify that the loadMessages tag properly exposes a Struts
     * MessageResources instance as a Map.</p>
     */
    public void testLoadMessages() throws Exception {

        HtmlSpan span = null;

        span = (HtmlSpan) element("lookup-simple");
        assertNotNull(span);
        assertEquals("Resource Simple Text", span.asText());

        span = (HtmlSpan) element("lookup-filtered");
        assertNotNull(span);
        assertEquals("Resource <b>Filtered</b> Text", span.asText());

        span = (HtmlSpan) element("lookup-unfiltered");
        assertNotNull(span);
        assertEquals("Resource Unfiltered Text", span.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.