summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-01-08 01:31:44 +0200
committerArtur Signell <artur@vaadin.com>2013-01-08 01:58:25 +0200
commit9d9df80a3b906ae50f85008153462c3abdc6779a (patch)
tree7d655d484cb4e5614b5a64b8c82eed7755ee0f6d /uitest
parent68406d87bb4dfb90d460ac02ef6412493f76eba7 (diff)
downloadvaadin-framework-9d9df80a3b906ae50f85008153462c3abdc6779a.tar.gz
vaadin-framework-9d9df80a3b906ae50f85008153462c3abdc6779a.zip
Only show tooltips for the Form itself (#9173)
Change-Id: Ifeeb480e8df0f88a4bb78cc6ad2cb1f77c8d0dd9
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/form/FormTooltips.html199
-rw-r--r--uitest/src/com/vaadin/tests/components/form/FormTooltips.java56
2 files changed, 255 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/form/FormTooltips.html b/uitest/src/com/vaadin/tests/components/form/FormTooltips.html
new file mode 100644
index 0000000000..0d069efb0b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/form/FormTooltips.html
@@ -0,0 +1,199 @@
+<?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.form.FormTooltips?restartApplication</td>
+ <td></td>
+</tr>
+<!--first name tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>Fields own tooltip</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--first name caption tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>Fields own tooltip</td>
+</tr>
+<tr>
+ <td>mouseMove</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--Form description tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]</td>
+ <td>Form error</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>Some description</td>
+</tr>
+<tr>
+ <td>mouseMove</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--Form error message tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]</td>
+ <td>Form error</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>Some description</td>
+</tr>
+<tr>
+ <td>mouseMove</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--last name parent should have error tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/domChild[0]/domChild[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]</td>
+ <td>Form error</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>Some description</td>
+</tr>
+<tr>
+ <td>mouseMove</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--last name should have no tooltip-->
+<tr>
+ <td>mouseMove</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>300</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--last name caption should have no tooltip-->
+<tr>
+ <td>mouseMove</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VForm[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>300</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/form/FormTooltips.java b/uitest/src/com/vaadin/tests/components/form/FormTooltips.java
new file mode 100644
index 0000000000..b70f66c710
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/form/FormTooltips.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2012 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.form;
+
+import java.util.Arrays;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.server.UserError;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.TextField;
+
+public class FormTooltips extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final Form form = new Form();
+ form.setDescription("Some description");
+ form.setItemDataSource(new BeanItem<Person>(new Person("foo", "bar",
+ "baz", 12, Sex.MALE, null)), Arrays.asList(new String[] {
+ "firstName", "lastName", "age" }));
+ ((TextField) form.getField("firstName"))
+ .setDescription("Fields own tooltip");
+
+ form.setComponentError(new UserError("Form error"));
+ addComponent(form);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "The 'first name' should show its own tooltip, the other fields should show no tooltip";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9173;
+ }
+
+}