summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-11-29 16:36:27 +0200
committerVaadin Code Review <review@vaadin.com>2012-11-30 07:42:46 +0000
commit9dd665b56eb4166d2af92a4825c37d20d15ed413 (patch)
treecb49de0aa15e6e8a29464e928c4653dd6ba19dad /uitest
parentcfb2513cd2049d6cae90b6d2c725a03e75194ce9 (diff)
downloadvaadin-framework-9dd665b56eb4166d2af92a4825c37d20d15ed413.tar.gz
vaadin-framework-9dd665b56eb4166d2af92a4825c37d20d15ed413.zip
UI scroll position can be given programmatically (#9952)
Change-Id: Icef0858ee495abcacab7823f7f8fc6044abd64dc
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html57
-rw-r--r--uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.java44
2 files changed, 101 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html
new file mode 100644
index 0000000000..b5326e4660
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html
@@ -0,0 +1,57 @@
+<?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>UIScrollTest</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">UIScrollTest</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.uitest.UIScrollTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsuitestUIScrollTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>Halfway_down_button</td>
+</tr>
+<tr>
+ <td>scroll</td>
+ <td>vaadin=runcomvaadintestscomponentsuitestUIScrollTest::</td>
+ <td>1020</td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>300</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsuitestUIScrollTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//div[@id='runcomvaadintestscomponentsuitestUIScrollTest-1797389287-overlays']/div</td>
+ <td>Scrolled to 1020 px</td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//div[@id='runcomvaadintestscomponentsuitestUIScrollTest-1797389287-overlays']/div</td>
+ <td>0,0</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.java b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.java
new file mode 100644
index 0000000000..66b6ef90b1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.java
@@ -0,0 +1,44 @@
+package com.vaadin.tests.components.uitest;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.UI;
+
+public class UIScrollTest extends TestBase {
+
+ @Override
+ protected void setup() {
+ // Set layout to high enough to get scroll.
+ getLayout().setHeight("2250px");
+ addComponent(new Button("scoll to 1000px", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ UI.getCurrent().setScrollTop(1000);
+ }
+ }));
+ addComponent(new Button(
+ "This button is halfway down. Click to report scroll position.",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show("Scrolled to "
+ + event.getButton().getUI().getScrollTop()
+ + " px");
+ }
+ }));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Windows can be programmatically scrolled";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9952;
+ }
+
+}