示例#1
0
 /**
  * Fails in all modes due to an HtmlUnit bug: offsetWidth always returns 1256. TODO(t.broyer):
  * file a new HtmlUnit bug. Similar to http://sourceforge.net/p/htmlunit/bugs/1447/
  */
 @DoNotRunWith(Platform.HtmlUnitBug)
 public void testCustomImageClass() {
   ImageResource resource = widgetUi.prettyImage;
   Image widget = widgetUi.fooImage;
   assertEquals(resource.getWidth(), widget.getOffsetWidth());
   assertEquals(resource.getHeight(), widget.getOffsetHeight());
   assertEquals(resource.getTop(), widget.getOriginTop());
   assertEquals(resource.getLeft(), widget.getOriginLeft());
 }
示例#2
0
  /**
   * Fails in all modes due to an HtmlUnit bug: offsetWidth always returns 1256. TODO(t.broyer):
   * file a new HtmlUnit bug. Similar to http://sourceforge.net/p/htmlunit/bugs/1447/
   */
  @DoNotRunWith(Platform.HtmlUnitBug)
  public void testImageResourceInImageWidget() {
    ImageResource resource = widgetUi.prettyImage;
    Image widget = widgetUi.babyWidget;
    assertEquals(resource.getWidth(), widget.getOffsetWidth());
    assertEquals(resource.getHeight(), widget.getOffsetHeight());
    assertEquals(resource.getTop(), widget.getOriginTop());
    assertEquals(resource.getLeft(), widget.getOriginLeft());

    assertEquals("expected alt text", widget.getAltText());
    assertEquals("expected style name", widget.getStyleName());
  }