From db7146ba49f7146aea451c2e2d1b608196009453 Mon Sep 17 00:00:00 2001 From: Bernard Labno Date: Mon, 14 Feb 2011 15:53:34 +0000 Subject: [PATCH] Implemented test of cell offsets as test case for HtmlUnit bug. --- src/test/java/pl/labno/bernard/htmlunified/TableCellOffsetTest.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+), 0 deletions(-) create mode 100644 src/test/java/pl/labno/bernard/htmlunified/TableCellOffsetTest.java diff --git a/src/test/java/pl/labno/bernard/htmlunified/TableCellOffsetTest.java b/src/test/java/pl/labno/bernard/htmlunified/TableCellOffsetTest.java new file mode 100644 index 0000000..ab1464f --- /dev/null +++ b/src/test/java/pl/labno/bernard/htmlunified/TableCellOffsetTest.java @@ -0,0 +1,24 @@ +package pl.labno.bernard.htmlunified; + +import com.gargoylesoftware.htmlunit.BrowserVersion; +import com.gargoylesoftware.htmlunit.CollectingAlertHandler; +import com.gargoylesoftware.htmlunit.WebClient; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + +public class TableCellOffsetTest { + + @Test + public void testClickImage() throws IOException { + final WebClient client = new WebClient(BrowserVersion.FIREFOX_3_6); + CollectingAlertHandler collectingAlertHandler = new CollectingAlertHandler(); + client.setAlertHandler(collectingAlertHandler); + client.getPage("file:./target/test-classes/tableCellOffset.html"); + for (String message : collectingAlertHandler.getCollectedAlerts()) { + Assert.assertTrue("Comparison of rows offset().left returned false", Boolean.parseBoolean(message)); + } + } + +} -- libgit2 0.24.0