From: Sauli Tähkäpää Date: Fri, 12 Sep 2014 12:54:22 +0000 (+0300) Subject: Convert TableInFormLayoutCausesScrollingTest to TB4. X-Git-Tag: 7.4.0.beta1~218 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3bbf16e22860452d6fd34ccc127b42a3a2baac04;p=vaadin-framework.git Convert TableInFormLayoutCausesScrollingTest to TB4. Change-Id: I9f2cec6ad77b05e7175de390240977d881530ded --- 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 @@ - - - - - - -New Test - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.components.formlayout.TableInFormLayoutCausesScrolling?restartApplication
mouseClickvaadin=runcomvaadintestscomponentsformlayoutTableInFormLayoutCausesScrolling::/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]12,13
screenCaptureshould-be-scrolled-up
- - 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