diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-01-12 13:52:27 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-01-12 13:52:27 +0000 |
commit | d13c213bca979781632929209f003533f1154b76 (patch) | |
tree | 631bf01ee7d7430732d785e2dd31b6dca0edf6de /tests | |
parent | 8de79ee9de8574b47c737abb88263fcae9267bba (diff) | |
download | vaadin-framework-d13c213bca979781632929209f003533f1154b76.tar.gz vaadin-framework-d13c213bca979781632929209f003533f1154b76.zip |
Merged revisions [10620]-[10678] from 6.2
svn changeset:10693/svn branch:6.3
Diffstat (limited to 'tests')
4 files changed, 190 insertions, 12 deletions
diff --git a/tests/src/com/vaadin/tests/components/button/Buttons.html b/tests/src/com/vaadin/tests/components/button/Buttons.html new file mode 100644 index 0000000000..43e554bec5 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/button/Buttons.html @@ -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>com.vaadin.tests.components.button.Buttons</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">com.vaadin.tests.components.button.Buttons</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.button.Buttons</td> + <td></td> +</tr> +<tr> + <td>waitForVaadin</td> + <td></td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/src/com/vaadin/tests/components/button/Buttons.java b/tests/src/com/vaadin/tests/components/button/Buttons.java index 4b1e7d60d8..b27d3f8ae9 100644 --- a/tests/src/com/vaadin/tests/components/button/Buttons.java +++ b/tests/src/com/vaadin/tests/components/button/Buttons.java @@ -8,7 +8,6 @@ import com.vaadin.tests.util.LoremIpsum; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; -import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.NativeButton; import com.vaadin.ui.Button.ClickEvent; @@ -54,17 +53,6 @@ public class Buttons extends ComponentTestCase { } - private Component createActionLayout() { - HorizontalLayout actionLayout = new HorizontalLayout(); - actionLayout.setSpacing(true); - actionLayout.setMargin(true); - for (Component c : createActions()) { - actionLayout.addComponent(c); - } - addComponent(actionLayout); - return actionLayout; - } - private Button createButton(String text, boolean nativeButton) { Button b; if (nativeButton) { diff --git a/tests/src/com/vaadin/tests/components/menubar/Menubars.html b/tests/src/com/vaadin/tests/components/menubar/Menubars.html new file mode 100644 index 0000000000..090a6bf08d --- /dev/null +++ b/tests/src/com/vaadin/tests/components/menubar/Menubars.html @@ -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="http://artur-laptop.office.itmill.com:8888/" /> +<title>com.vaadin.tests.components.menubar.Menubars</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">com.vaadin.tests.components.menubar.Menubars</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.menubar.Menubars</td> + <td></td> +</tr> +<tr> + <td>waitForVaadin</td> + <td></td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/src/com/vaadin/tests/components/menubar/Menubars.java b/tests/src/com/vaadin/tests/components/menubar/Menubars.java new file mode 100644 index 0000000000..15c353b98a --- /dev/null +++ b/tests/src/com/vaadin/tests/components/menubar/Menubars.java @@ -0,0 +1,126 @@ +package com.vaadin.tests.components.menubar;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.tests.components.ComponentTestCase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.MenuBar.MenuItem;
+
+public class Menubars extends ComponentTestCase {
+
+ MenuBar menubar[] = new MenuBar[20];
+
+ @Override
+ protected void setup() {
+ super.setup();
+
+ MenuBar m;
+ m = createMenuBar("This is an undefined wide menubar with 3 items", 3);
+
+ m.setWidth(null);
+ addTestComponent(m);
+
+ m = createMenuBar(
+ "This is an undefined wide menubar with fixed 100px height (4 items)",
+ 4);
+ m.setWidth(null);
+ m.setHeight("100px");
+ addTestComponent(m);
+
+ m = createMenuBar("This is a 200px wide menubar with 10 items", 10);
+ m.setWidth("200px");
+ addTestComponent(m);
+
+ m = createMenuBar("This is a 200px wide menubar with 2 items", 2);
+ m.setWidth("200px");
+ addTestComponent(m);
+
+ m = createMenuBar("This is a 100% wide menubar with 3 items ", 3);
+ m.setWidth("100%");
+ addTestComponent(m);
+
+ m = createMenuBar("This is a 100% wide menubar with 40 items ", 40);
+ m.setWidth("100%");
+ addTestComponent(m);
+
+ m = createMenuBar(
+ "This is a 100% wide menubar with fixed 65px height (5 items). ",
+ 5);
+ m.setWidth("100%");
+ m.setHeight("65px");
+
+ addTestComponent(m);
+
+ }
+
+ private MenuBar createMenuBar(String text, int items) {
+ MenuBar m = new MenuBar();
+ m.setCaption(text);
+
+ for (int i = 1; i <= items; i++) {
+ MenuItem mi = m.addItem("Item " + i, null);
+ for (int j = 1; j <= items; j++) {
+ mi.addItem("Sub menu " + i + "/" + j, null);
+ }
+ }
+
+ return m;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "A generic test for MenuBars in different configurations";
+ }
+
+ @Override
+ protected List<Component> createActions() {
+ ArrayList<Component> actions = new ArrayList<Component>();
+
+ CheckBox errorIndicators = new CheckBox("Error indicators",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Button b = event.getButton();
+ boolean enabled = (Boolean) b.getValue();
+ setErrorIndicators(enabled);
+
+ }
+ });
+
+ CheckBox enabled = new CheckBox("Enabled", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Button b = event.getButton();
+ boolean enabled = (Boolean) b.getValue();
+ setEnabled(enabled);
+ }
+ });
+
+ CheckBox readonly = new CheckBox("Readonly",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Button b = event.getButton();
+ boolean enabled = (Boolean) b.getValue();
+ setReadOnly(enabled);
+ }
+ });
+
+ errorIndicators.setValue(new Boolean(false));
+ readonly.setValue(new Boolean(false));
+ enabled.setValue(new Boolean(true));
+
+ errorIndicators.setImmediate(true);
+ readonly.setImmediate(true);
+ enabled.setImmediate(true);
+
+ actions.add(errorIndicators);
+ actions.add(readonly);
+ actions.add(enabled);
+
+ return actions;
+ }
+
+}
|