]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added testbench test for a Form with borders and paddings. Related to #3710
authorJohn Alhroos <john.ahlroos@itmill.com>
Thu, 6 Oct 2011 10:50:32 +0000 (10:50 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Thu, 6 Oct 2011 10:50:32 +0000 (10:50 +0000)
svn changeset:21598/svn branch:6.7

tests/testbench/com/vaadin/tests/components/form/FormWithPaddingsAndBorders.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/form/FormWithPaddingsAndBorders.java [new file with mode: 0644]

diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithPaddingsAndBorders.html b/tests/testbench/com/vaadin/tests/components/form/FormWithPaddingsAndBorders.html
new file mode 100644 (file)
index 0000000..384cc6c
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>FormWithPaddingsAndBorders</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">FormWithPaddingsAndBorders</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.form.FormWithPaddingsAndBorders</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForVaadin</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td>initial</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithPaddingsAndBorders.java b/tests/testbench/com/vaadin/tests/components/form/FormWithPaddingsAndBorders.java
new file mode 100644 (file)
index 0000000..ff1951d
--- /dev/null
@@ -0,0 +1,46 @@
+package com.vaadin.tests.components.form;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.TestUtils;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.TextField;
+
+public class FormWithPaddingsAndBorders extends TestBase {
+
+    @Override
+    protected void setup() {
+        getLayout().setSizeFull();
+
+        TestUtils.injectCSS(getMainWindow(),
+                ".v-form{ border: 10px solid red; padding:10px;}");
+
+        final Form f = new Form();
+        addComponent(f);
+        f.setSizeUndefined();
+        f.getLayout().setSizeUndefined();
+
+        f.addField("foo", new TextField("Foo"));
+        f.addField("bar", new TextField("A bit longer field caption"));
+
+        HorizontalLayout hl = new HorizontalLayout();
+        hl.setWidth("100%");
+        Button b = new Button("right aligned");
+        hl.addComponent(b);
+        hl.setComponentAlignment(b, Alignment.TOP_RIGHT);
+        f.setFooter(hl);
+    }
+
+    @Override
+    protected String getDescription() {
+        return "Ensure that paddings set on form is considered in width calculations";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return 3710;
+    }
+
+}