diff options
3 files changed, 31 insertions, 45 deletions
diff --git a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html deleted file mode 100644 index 8795ad12dc..0000000000 --- a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.formlayout.TableInFormLayoutCausesScrolling?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsformlayoutTableInFormLayoutCausesScrolling::/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td> - <td>12,13</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>should-be-scrolled-up</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java index 3978c49b09..9ba6f0ea94 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java @@ -1,40 +1,35 @@ package com.vaadin.tests.components.formlayout; -import com.vaadin.tests.components.AbstractTestCase; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.FormLayout; -import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; -public class TableInFormLayoutCausesScrolling extends AbstractTestCase { +public class TableInFormLayoutCausesScrolling extends AbstractTestUI { @Override - public void init() { - // Window Initialization. - final LegacyWindow window = new LegacyWindow("Main Window"); - setMainWindow(window); + public void setup(VaadinRequest request) { - // FormLayout creation final FormLayout fl = new FormLayout(); - window.setContent(fl); + addComponent(fl); - // Add 20 TextField for (int i = 20; i-- > 0;) { fl.addComponent(new TextField()); } - // Add 1 selectable table with some items final Table table = new Table(); table.setSelectable(true); table.addContainerProperty("item", String.class, ""); for (int i = 50; i-- > 0;) { table.addItem(new String[] { "item" + i }, i); } - window.addComponent(table); + + fl.addComponent(table); } @Override - protected String getDescription() { + protected String getTestDescription() { return "Clicking in the Table should not cause the page to scroll"; } diff --git a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java new file mode 100644 index 0000000000..dc10217efb --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrollingTest.java @@ -0,0 +1,23 @@ +package com.vaadin.tests.components.formlayout; + +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.interactions.Actions; + +import java.io.IOException; + +public class TableInFormLayoutCausesScrollingTest extends MultiBrowserTest { + + @Test + public void pageIsNotScrolled() throws IOException { + openTestURL(); + + new Actions(driver).sendKeys(Keys.PAGE_DOWN).perform(); + + $(TableElement.class).first().getCell(2, 0).click(); + + compareScreen("scrolledDown"); + } +}
\ No newline at end of file |