diff options
Diffstat (limited to 'uitest/src/com/vaadin')
7 files changed, 262 insertions, 3 deletions
diff --git a/uitest/src/com/vaadin/tests/components/OutOfSyncTest.html b/uitest/src/com/vaadin/tests/components/OutOfSyncTest.html new file mode 100644 index 0000000000..4828069e2a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/OutOfSyncTest.html @@ -0,0 +1,38 @@ +<?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/OutOfSyncTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>pause</td> + <td>1000</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runOutOfSyncTest::/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<!--Out of sync occured -> the button should be removed--> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runOutOfSyncTest::/VButton[0]</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/OutOfSyncTest.java b/uitest/src/com/vaadin/tests/components/OutOfSyncTest.java new file mode 100644 index 0000000000..0efb519e8d --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/OutOfSyncTest.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Notification; + +public class OutOfSyncTest extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Button b = new Button("Click me after 1s to be out of sync"); + b.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + Notification.show("This code will never be reached"); + } + }); + setContent(b); + Thread t = new Thread(new Runnable() { + + @Override + public void run() { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + // Remove button but prevent repaint -> causes out of sync + // issues + getSession().lock(); + try { + setContent(null); + getConnectorTracker().markClean(OutOfSyncTest.this); + } finally { + getSession().unlock(); + } + } + }); + t.start(); + } + + @Override + protected String getTestDescription() { + return "Click the button after 1s when it has been removed server side (causing synchronization problems)"; + } + + @Override + protected Integer getTicketNumber() { + return 10780; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html new file mode 100644 index 0000000000..642abd8120 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html @@ -0,0 +1,72 @@ +<?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.button.ButtonToggleIcons?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>v-icon</td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]/domChild[0]</td> + <td>v-icon</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>v-icon</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]</td> + <td>40,14</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]/domChild[0]</td> + <td>v-icon</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>v-icon</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]</td> + <td>40,14</td> +</tr> +<tr> + <td>assertNotCSSClass</td> + <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]/domChild[0]</td> + <td>v-icon</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java new file mode 100644 index 0000000000..626ed1d250 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.button;
+
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+@SuppressWarnings("serial")
+public class ButtonToggleIcons extends UI {
+
+ @Override
+ protected void init(final VaadinRequest request) {
+ final VerticalLayout layout = new VerticalLayout();
+ setContent(layout);
+
+ final ThemeResource iconResource = new ThemeResource(
+ "../runo/icons/16/arrow-left.png");
+
+ final ClickListener iconToggleListener = new ClickListener() {
+ @Override
+ public void buttonClick(final ClickEvent event) {
+ final Button btn = event.getButton();
+ if (btn.getIcon() == null) {
+ btn.setIcon(iconResource);
+ } else {
+ btn.setIcon(null);
+ }
+ }
+ };
+
+ layout.addComponent(new Button("Toggle icon", iconToggleListener));
+ layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
+ }
+}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java index 1f2973ccb7..dea1deb9b5 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java @@ -86,8 +86,8 @@ public class ComboBoxDataSourceChange extends TestBase { cb2.addListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - currentValue - .setValue(event.getProperty().getValue().toString()); + currentValue.setValue(String.valueOf(event.getProperty() + .getValue())); } }); } diff --git a/uitest/src/com/vaadin/tests/components/table/TableDragColumn.html b/uitest/src/com/vaadin/tests/components/table/TableDragColumn.html index 14f2781f38..5d0ba160fe 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableDragColumn.html +++ b/uitest/src/com/vaadin/tests/components/table/TableDragColumn.html @@ -67,7 +67,7 @@ <tr> <td>drop</td> <td>vaadin=runcomvaadintestscomponentstableTables::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[2]</td> - <td>10,10</td> + <td>70,10</td> </tr> <tr> <td>screenCapture</td> diff --git a/uitest/src/com/vaadin/tests/overlays/OverlayTouchScrolling.java b/uitest/src/com/vaadin/tests/overlays/OverlayTouchScrolling.java new file mode 100644 index 0000000000..fdcfdf7266 --- /dev/null +++ b/uitest/src/com/vaadin/tests/overlays/OverlayTouchScrolling.java @@ -0,0 +1,56 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.tests.overlays; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Component; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; + +public class OverlayTouchScrolling extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + + final CssLayout green = new CssLayout(); + green.setSizeFull(); + final CssLayout layout = new CssLayout() { + @Override + protected String getCss(Component c) { + return "background:green;"; + } + }; + layout.setSizeFull(); + layout.addComponent(green); + setContent(layout); + + Button button = new Button("Tap me with a touch device"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + + Notification + .show("Now close this and you can scroll in mad places."); + green.addComponent(new Label( + "Thank you for clicking, now scroll (with touch device) to area without green background, which shouldn't be possible.")); + } + }); + green.addComponent(button); + } + + @Override + protected String getTestDescription() { + return "Using overlays breaks top level scrolling on touch devices"; + } + + @Override + protected Integer getTicketNumber() { + return 10860; + } +} |