Commit db7146ba49f7146aea451c2e2d1b608196009453

Authored by bernard
1 parent cb7d7007

Implemented test of cell offsets as test case for HtmlUnit bug.

  1 +package pl.labno.bernard.htmlunified;
  2 +
  3 +import com.gargoylesoftware.htmlunit.BrowserVersion;
  4 +import com.gargoylesoftware.htmlunit.CollectingAlertHandler;
  5 +import com.gargoylesoftware.htmlunit.WebClient;
  6 +import org.junit.Assert;
  7 +import org.junit.Test;
  8 +
  9 +import java.io.IOException;
  10 +
  11 +public class TableCellOffsetTest {
  12 +
  13 + @Test
  14 + public void testClickImage() throws IOException {
  15 + final WebClient client = new WebClient(BrowserVersion.FIREFOX_3_6);
  16 + CollectingAlertHandler collectingAlertHandler = new CollectingAlertHandler();
  17 + client.setAlertHandler(collectingAlertHandler);
  18 + client.getPage("file:./target/test-classes/tableCellOffset.html");
  19 + for (String message : collectingAlertHandler.getCollectedAlerts()) {
  20 + Assert.assertTrue("Comparison of rows offset().left returned false", Boolean.parseBoolean(message));
  21 + }
  22 + }
  23 +
  24 +}
... ...
Please register or login to post a comment