Examples of HtmlSpan


Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Verify the presence and contents of several message components.</p>
     */
    public void testMessage() throws Exception {

        HtmlSpan span = null;

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

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

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

        span = (HtmlSpan) element("message-unfiltered");
        assertNotNull(span);
        assertEquals("Resource Unfiltered Text", span.asText());

        span = (HtmlSpan) element("message-substitute");
        assertNotNull(span);
        assertEquals("From Here to Eternity", span.asText());

    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Verify the proper operation of clientId in a subview.</p.
     */
    public void testSubview() throws Exception {

        HtmlSpan span = null;

        span = (HtmlSpan) element("subview:write1");
        assertNotNull(span);
        assertEquals("subview:write1", span.asText());

    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Verify the presence and contents of several write components.</p>
     */
    public void testWrite() throws Exception {

        HtmlSpan span = null;

        span = (HtmlSpan) element("write-literal");
        assertNotNull(span);
        assertEquals("Literal Write Content", span.asText());

        span = (HtmlSpan) element("write-filtered");
        assertNotNull(span);
        assertEquals("Literal <b>Filtered</b> Content", span.asText());

        span = (HtmlSpan) element("write-unfiltered");
        assertNotNull(span);
        assertEquals("Literal Unfiltered Content", span.asText());

        span = (HtmlSpan) element("retrieved-literal");
        assertNotNull(span);
        assertEquals("Retrieved Simple Content", span.asText());

        span = (HtmlSpan) element("retrieved-filtered");
        assertNotNull(span);
        assertEquals("Retrieved <b>Filtered</b> Content", span.asText());

        span = (HtmlSpan) element("retrieved-unfiltered");
        assertNotNull(span);
        assertEquals("Retrieved Unfiltered Content", span.asText());

    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSpan;

public class EditCardTestBase {
    protected String getDisplayedCardIconSrc(HtmlPage page) throws Exception {
        HtmlSpan defaultSpan = page.getHtmlElementById("defaultIconUrlSpan");
        HtmlSpan span = page.getHtmlElementById("iconUrlSpan");
        if (defaultSpan.isDisplayed()) {
            return getImageSrcFromSpan(defaultSpan);
        }
        else if (span.isDisplayed()) {
            return getImageSrcFromSpan(span);
        }
        else {
            return null;
        }
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

    // Make sure we can lookup server component by name
    HtmlToolTip tt = (HtmlToolTip)server.findComponent(_DEFAULT_CLIENTSIDE_TOOLTIP);
    assertNotNull("Unable to find server-side HtmlToolTip component",tt);
   
    // 1) Find client-side tooltip span
    HtmlSpan tooltip1 = (HtmlSpan)((HtmlPage)client.getContentPage()).getElementById(_DEFAULT_CLIENTSIDE_TOOLTIP)// Required because name collision
    assertNotNull("Unable to find client-side span named \""+_DEFAULT_CLIENTSIDE_TOOLTIP+"\"",tooltip1);       
    // 2) Find Richpanel div to perform mouse-over (parent element)
    HtmlDivision parentDiv = (HtmlDivision)client.getElement(_DEFAULT_CLIENTSIDE_PANEL);
    assertNotNull("Unable to find \"sample1\" control",parentDiv);
    // 3) Find Richpanel internal div (also needed)
    HtmlDivision parentSubDiv = (HtmlDivision)client.getElement(_DEFAULT_CLIENTSIDE_PANEL+"_body");
    assertNotNull("Unable to find \"sample1_body\" control",parentSubDiv);
    // 4) Make sure tooltip is currently hidden (style contains 'display: none')
    String hiddenStyle = tooltip1.getStyleAttribute();
    assertTrue("Tooltip not hidden as expected: ["+hiddenStyle+"]",
        hiddenStyle.contains("display:none") || hiddenStyle.contains("display: none"));
    // 5) Move mouse over div to make tooltip display
    //   Yes, all three of these are required.
    parentDiv.mouseOver();
    parentDiv.mouseMove();
    parentSubDiv.mouseOver();

    // 6) Make sure tooltip is currently visible (style does not contain 'display: none')
    String visibleStyle = tooltip1.getStyleAttribute();
    assertFalse("Tooltip not visible as expected: ["+visibleStyle+"]",
        visibleStyle.contains("display:none") || visibleStyle.contains("display: none"));   
  }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    // Make sure we can lookup server component by name
    HtmlToolTip tt = (HtmlToolTip)server.findComponent(_FOLLOWMOUSE_TOOLTIP);
    assertNotNull("Unable to find server-side HtmlToolTip component",tt);
   
    // 1) Find client-side tooltip span
    HtmlSpan tooltip1 = (HtmlSpan)((HtmlPage)client.getContentPage()).getElementById(_FOLLOWMOUSE_TOOLTIP)// Required because name collision
    assertNotNull("Unable to find client-side span named \""+_FOLLOWMOUSE_TOOLTIP+"\"",tooltip1);       
    // 2) Find Richpanel div to perform mouse-over (parent element)
    HtmlDivision parentDiv = (HtmlDivision)client.getElement(_FOLLOWMOUSE_PANEL);
    assertNotNull("Unable to find \"sample1\" control",parentDiv);
    // 3) Find Richpanel internal div (also needed)
    HtmlDivision parentSubDiv = (HtmlDivision)client.getElement(_FOLLOWMOUSE_PANEL+"_body");
    assertNotNull("Unable to find \"sample1_body\" control",parentSubDiv);
    // 4) Make sure tooltip is currently hidden (style contains 'display: none')
    String hiddenStyle = tooltip1.getStyleAttribute();
    assertTrue("Tooltip not hidden as expected: ["+hiddenStyle+"]",
        hiddenStyle.contains("display:none") || hiddenStyle.contains("display: none"));
    // 5) Move mouse over div to make tooltip display
    //   Yes, all three of these are required.
    parentDiv.mouseOver();
    parentDiv.mouseMove();
    parentSubDiv.mouseOver();

    // 0.5 delay on tooltip - so wait a sec
    Thread.sleep(1000);
   
    // 6) Make sure tooltip is currently visible (style does not contain 'display: none')
    String visibleStyle = tooltip1.getStyleAttribute();
    assertFalse("Tooltip not visible as expected: ["+visibleStyle+"]",
        visibleStyle.contains("display:none") || visibleStyle.contains("display: none"));   
  }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

   {
      // Find outside control
      Element e = client.getElement(controlId);
      assertNotNull("Control not found: "+controlId,e);
      assertTrue("Control not expected type (HtmlSpan): "+e.getClass(),e instanceof HtmlSpan);
      HtmlSpan span = (HtmlSpan)e;
     
      // Find text control
      e = client.getElement(controlId+"tempValue");
      assertNotNull("Control not found: "+controlId+"tempValue",e);
      assertTrue("Control not expected type (HtmlTextInput): "+e.getClass(),e instanceof HtmlTextInput);
      HtmlTextInput nameInput = (HtmlTextInput)e;
      // Make sure input control is hidden
      String hiddenStyle = nameInput.getStyleAttribute();
      assertTrue("Input control not hidden as expected: ["+hiddenStyle+"]",
              hiddenStyle.contains("display:none") || hiddenStyle.contains("display: none"));
     
      // Activate control - click on outside table control
      span.click();
     
      // Make sure input control is now visible
      String visibleStyle = nameInput.getStyleAttribute();
      assertFalse("Input control not visible as expected: ["+visibleStyle+"]",
              visibleStyle.contains("display:none") || visibleStyle.contains("display: none"));
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

Examples of com.gargoylesoftware.htmlunit.html.HtmlSpan

    /**
     * <p>Verify the presence and contents of several message components.</p>
     */
    public void testMessage() throws Exception {

        HtmlSpan span = null;

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

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

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

        span = (HtmlSpan) element("message-unfiltered");
        assertNotNull(span);
        assertEquals("Resource Unfiltered Text", span.asText());

        span = (HtmlSpan) element("message-substitute");
        assertNotNull(span);
        assertEquals("From Here to Eternity", 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.