summaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html52
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java55
2 files changed, 107 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html
new file mode 100644
index 0000000000..e5b1f47f2d
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.html
@@ -0,0 +1,52 @@
+<?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="http://localhost:8888/" />
+<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.table.TableRowScrolledBottom?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>500</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[44]/VLabel[0]</td>
+ <td>This is a test item with long text so that there is something to see Nr. 100. This text must be long otherwise the timing issue on Firefox does not occur. This works fine in IE</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>500</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableRowScrolledBottom::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[44]/VLabel[0]</td>
+ <td>This is a test item with long text so that there is something to see Nr. 200. This text must be long otherwise the timing issue on Firefox does not occur. This works fine in IE</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java
new file mode 100644
index 0000000000..9823fc1859
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java
@@ -0,0 +1,55 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class TableRowScrolledBottom extends TestBase {
+
+ @Override
+ protected void setup() {
+
+ final Table table = new Table();
+ table.setSizeFull();
+ table.addContainerProperty("Test", Label.class, null);
+ table.setHeight("100%");
+
+ Button button = new Button("Add 100 items");
+ button.addClickListener(new Button.ClickListener() {
+ int i = 0;
+
+ @Override
+ public void buttonClick(Button.ClickEvent event) {
+ for (int j = 0; j < 100; j++) {
+ ++i;
+ table.addItem(
+ new Object[] { new Label(
+ "This is a test item with long text so that there is something to see Nr. <b>"
+ + i
+ + "</b>. This text must be long otherwise the timing issue on Firefox does not occur. This works fine in IE",
+ ContentMode.HTML) }, i);
+ table.setCurrentPageFirstItemIndex(table
+ .getContainerDataSource().size() - 1);
+ }
+ }
+ });
+
+ addComponent(table);
+ addComponent(button);
+ getLayout().setExpandRatio(table, 1f);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Table should be scrolled to bottom when adding rows and updating currentPageFirstItemIndex to last item";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 10970;
+ }
+
+}