summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-09-12 12:10:37 +0000
committerLeif Åstrand <leif@vaadin.com>2011-09-12 12:10:37 +0000
commitf066b248ad306277b30eacde0a29c200e6d9c010 (patch)
tree118bd5bf75ba23075adff28976447172b0d90e79 /tests
parentfb6093db9c8e8dfd06e33861c01f206d630528f0 (diff)
downloadvaadin-framework-f066b248ad306277b30eacde0a29c200e6d9c010.tar.gz
vaadin-framework-f066b248ad306277b30eacde0a29c200e6d9c010.zip
Test for client side solution to #7393
svn changeset:20959/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html41
-rw-r--r--tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java56
2 files changed, 97 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html b/tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html
new file mode 100644
index 0000000000..701adeac34
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.html
@@ -0,0 +1,41 @@
+<?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></title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3"></td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.table.TableColumnResizeContentsWidth?restartApplication&amp;debug</td>
+ <td></td>
+</tr>
+<tr>
+ <td>dragAndDrop</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>-20,+0</td>
+</tr>
+<tr>
+ <td>assertElementWidth</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>
+ <td>80</td>
+</tr>
+<tr>
+ <td>dragAndDrop</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>+40,+0</td>
+</tr>
+<tr>
+ <td>assertElementWidth</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableColumnResizeContentsWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>
+ <td>120</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java b/tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java
new file mode 100644
index 0000000000..fbe7ed88ef
--- /dev/null
+++ b/tests/src/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java
@@ -0,0 +1,56 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.ColumnGenerator;
+import com.vaadin.ui.TextField;
+
+public class TableColumnResizeContentsWidth extends TestBase {
+
+ private static final String COL1 = "COL1";
+
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ table.addGeneratedColumn(COL1, new ColumnGenerator() {
+ public Object generateCell(Table source, Object itemId,
+ Object columnId) {
+ TextField textField = new TextField();
+ textField.setWidth("100%");
+ return textField;
+ }
+ });
+
+ table.addItem();
+
+ table.setWidth("200px");
+ table.setColumnWidth(COL1, 100);
+
+ addComponent(table);
+ addComponent(new Button("Increase width", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ table.setColumnWidth(COL1, table.getColumnWidth(COL1) + 20);
+ table.requestRepaint();
+ }
+ }));
+ addComponent(new Button("Decrease width", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ table.setColumnWidth(COL1, table.getColumnWidth(COL1) - 40);
+ table.requestRepaint();
+ }
+ }));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "When a column is resized, it's contents should update to match the new size";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7393);
+ }
+
+}