summaryrefslogtreecommitdiffstats
path: root/uitest/src/com
diff options
context:
space:
mode:
authorMikael Grankvist <mgrankvi@vaadin.com>2012-11-13 13:35:27 +0200
committerMikael Grankvist <mgrankvi@vaadin.com>2012-11-13 15:55:58 +0200
commitf79949cc274a1fdbd865d800d567ad6d774197bd (patch)
tree8691d51750bd5e9e2da06d797debfcad67a92345 /uitest/src/com
parentd65970d329249c6725ec0bafd46725405492e833 (diff)
downloadvaadin-framework-f79949cc274a1fdbd865d800d567ad6d774197bd.tar.gz
vaadin-framework-f79949cc274a1fdbd865d800d567ad6d774197bd.zip
(#10180) Moved positioning from onStateChanged to onConnectorHierarchyChange. Added test.
Change-Id: Iccd290a8e2be165207abe1b4805ec992d24bad0d
Diffstat (limited to 'uitest/src/com')
-rw-r--r--uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html52
-rw-r--r--uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java59
2 files changed, 111 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.html
new file mode 100644
index 0000000000..f00d6b15f9
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.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>AbsoluteLayoutCorrectPositioningOfHiddenField</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">AbsoluteLayoutCorrectPositioningOfHiddenField</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.absolutelayout.AbsoluteLayoutCorrectPositioningOfHiddenField?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SpositionedLabel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SactionButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SpositionedLabel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>AbsoluteLayoutLabelPositionNotOrigo</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsabsolutelayoutAbsoluteLayoutCorrectPositioningOfHiddenField::PID_SactionButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>AbsoluteLayoutLabelMovedDown</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java
new file mode 100644
index 0000000000..42ea6158fd
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutCorrectPositioningOfHiddenField.java
@@ -0,0 +1,59 @@
+package com.vaadin.tests.components.absolutelayout;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.AbsoluteLayout;
+import com.vaadin.ui.AbsoluteLayout.ComponentPosition;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+
+public class AbsoluteLayoutCorrectPositioningOfHiddenField extends TestBase {
+
+ @Override
+ protected void setup() {
+ setTheme("tests-tickets");
+ final AbsoluteLayout abs = new AbsoluteLayout();
+ abs.setStyleName("borders");
+ abs.setWidth("250px");
+ abs.setHeight("100px");
+
+ final Label l = new Label("Top 20, Left 20");
+ l.setSizeUndefined();
+ l.setId("positionedLabel");
+ l.setVisible(false);
+ abs.addComponent(l, "top:20px;left:20px");
+
+ final Button action = new Button("Set visible");
+ action.addClickListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (l.isVisible()) {
+ l.setValue("Top 70, Left 20");
+ ComponentPosition position = abs.getPosition(l);
+ position.setCSSString("top:70px;left:20px;");
+ abs.setPosition(l, position);
+ } else {
+ l.setVisible(true);
+ action.setCaption("Move down");
+ }
+ }
+ });
+ action.setId("actionButton");
+ abs.addComponent(action, "top: 70px;left: 150px;");
+
+ addComponent(abs);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "AbsoluteLayout should reposition invisible components when set to visible";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 10180;
+ }
+
+}