aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-08-19 12:37:52 +0300
committerArtur Signell <artur@vaadin.com>2013-08-19 12:37:52 +0300
commitacc12f857d04d9b341dec700ffa469ca96d30ad8 (patch)
tree43e4583b45f1ef96d9fc2919746c56f8dfff7317 /uitest/src
parent1420d23cef01bbc4e07dba693fe4717b531cd951 (diff)
parent99c7d0b3cde116bf31b00bd31f62f9f4920b1762 (diff)
downloadvaadin-framework-acc12f857d04d9b341dec700ffa469ca96d30ad8.tar.gz
vaadin-framework-acc12f857d04d9b341dec700ffa469ca96d30ad8.zip
Merge changes from origin/7.1
7cb49d1 Fix invisible calendar actions menu #12181 44aacf4 Clarify Embedded javadoc (#12290) 59a043b Fix actions in action menu appearing in random order #12250 5d57129 Fix calendar click events on context menu #12297 f5e3663 Document multiple load semantics in @StyleSheet and @JavaScript (#12200) 17bb700 Add optional OSGi Import-Package for javax.validation (#12301) ea148c8 Disable all logging if production mode is enabled (#12299) 326bbb5 Fixes parsing of multiple push messages in streaming mode (#12197) 7fc1054 Ensure StringToIntegerConverter rejects values outside range of int (#12230) f587298 Improve URI fragment listener javadocs (#12296) d97cfbc Refine handling of null and empty URI fragments (#12207) 99c7d0b Show tooltips for ordered layout captions (#10046) Change-Id: Ifb2e0131fde769e2620b7ba03755a5ba324d8aaf
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.html71
-rw-r--r--uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java141
-rw-r--r--uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html82
-rw-r--r--uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java79
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.html61
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java15
6 files changed, 448 insertions, 1 deletions
diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.html b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.html
new file mode 100644
index 0000000000..3830faa7de
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.html
@@ -0,0 +1,71 @@
+<?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>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.calendar.CalendarActionsMenuTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>contextmenu</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//td[@id='gwt-uid-5']/div</td>
+ <td>ACTION</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[2]</td>
+ <td>127,5</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>155,9</td>
+</tr>
+<tr>
+ <td>contextmenu</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[34]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//td[@id='gwt-uid-6']/div</td>
+ <td>ACTION</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[13]</td>
+ <td>139,0</td>
+</tr>
+<tr>
+ <td>contextmenu</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[14]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//td[@id='gwt-uid-14']/div</td>
+ <td>ACTION</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscalendarCalendarActionsMenuTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VCalendar[0]/domChild[0]/domChild[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[13]</td>
+ <td>139,0</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java
new file mode 100644
index 0000000000..77225b2e4c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2000-2013 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.calendar;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import com.vaadin.event.Action;
+import com.vaadin.event.Action.Handler;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Calendar;
+import com.vaadin.ui.Calendar.TimeFormat;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.components.calendar.CalendarComponentEvents.EventClick;
+import com.vaadin.ui.components.calendar.CalendarComponentEvents.EventClickHandler;
+import com.vaadin.ui.components.calendar.CalendarComponentEvents.EventMoveHandler;
+import com.vaadin.ui.components.calendar.CalendarComponentEvents.EventResizeHandler;
+import com.vaadin.ui.components.calendar.CalendarComponentEvents.MoveEvent;
+import com.vaadin.ui.components.calendar.event.BasicEvent;
+import com.vaadin.ui.components.calendar.event.CalendarEvent;
+import com.vaadin.ui.components.calendar.event.CalendarEventProvider;
+
+public class CalendarActionsMenuTest extends AbstractTestUI {
+
+ private Calendar calendar;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ calendar = new Calendar(new CalendarEventProvider() {
+
+ @Override
+ public List<com.vaadin.ui.components.calendar.event.CalendarEvent> getEvents(
+ Date startDate, Date endDate) {
+
+ List<CalendarEvent> events = new ArrayList<CalendarEvent>();
+
+ CalendarEvent event = null;
+ try {
+ event = new BasicEvent("NAME", "TOOLTIP",
+ new SimpleDateFormat("yyyy-MM-dd hh:mm")
+ .parse("2013-01-01 07:00"),
+ new SimpleDateFormat("yyyy-MM-dd hh:mm")
+ .parse("2013-01-01 11:00"));
+ } catch (ParseException e) {
+ // Nothing to do
+ }
+ events.add(event);
+
+ try {
+ event = new BasicEvent("NAME 2", "TOOLTIP2",
+ new SimpleDateFormat("yyyy-MM-dd hh:mm")
+ .parse("2013-01-03 07:00"),
+ new SimpleDateFormat("yyyy-MM-dd hh:mm")
+ .parse("2013-01-04 11:00"));
+ } catch (ParseException e) {
+ // Nothing to do
+ }
+ events.add(event);
+
+ return events;
+ }
+
+ });
+ try {
+ calendar.setStartDate(new SimpleDateFormat("yyyy-MM-dd")
+ .parse("2013-01-01"));
+ calendar.setEndDate(new SimpleDateFormat("yyyy-MM-dd")
+ .parse("2013-01-31"));
+ } catch (ParseException e) {
+ // Nothing to do
+ }
+ calendar.setImmediate(true);
+ calendar.setFirstVisibleHourOfDay(6);
+ calendar.setLastVisibleHourOfDay(22);
+ calendar.setTimeFormat(TimeFormat.Format24H);
+ calendar.setHandler((EventResizeHandler) null);
+
+ setEnabled(true);
+ calendar.addActionHandler(new Handler() {
+ @Override
+ public void handleAction(Action action, Object sender, Object target) {
+ Notification.show("ACTION CLICKED");
+
+ }
+
+ @Override
+ public Action[] getActions(Object target, Object sender) {
+ return new Action[] { new Action("ACTION") };
+ }
+ });
+ calendar.setHandler(new EventClickHandler() {
+ private static final long serialVersionUID = -177173530105538438L;
+
+ @Override
+ public void eventClick(EventClick event) {
+ Notification.show("EVENT CLICKED");
+ }
+ });
+
+ calendar.setHandler(new EventMoveHandler() {
+ @Override
+ public void eventMove(MoveEvent event) {
+ Notification.show("EVENT MOVED");
+ }
+ });
+ addComponent(calendar);
+ calendar.setSizeFull();
+ setSizeFull();
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ // TODO Auto-generated method stub
+ return "The context should appear if you right click on a calendar event regardless of view mode";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return 12181;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html
new file mode 100644
index 0000000000..81da3b897e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html
@@ -0,0 +1,82 @@
+<?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>Required error tootlip</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Required error tooltip</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.orderedlayout.ErrorIndicator?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-4']/span</td>
+ <td>43,4</td>
+</tr>
+
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipVertivcalCaption</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-4']/span[2]</td>
+ <td>3,6</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipVertivcalRequiredIndicator</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-6']/span</td>
+ <td>38,11</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipHorizontalCaption</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='gwt-uid-6']/span[2]</td>
+ <td>3,4</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tooltipHorizontalRequiredIndicator</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java
new file mode 100644
index 0000000000..9964e1ee78
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2000-2013 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.orderedlayout;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class ErrorIndicator extends AbstractTestUI {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
+ * VaadinRequest)
+ */
+ @Override
+ protected void setup(VaadinRequest request) {
+ VerticalLayout layout = new VerticalLayout();
+
+ TextField inVertical = new TextField();
+ inVertical.setRequired(true);
+ inVertical.setRequiredError("Vertical layout tooltip");
+ inVertical.setCaption("Vertical layout caption");
+
+ layout.addComponent(inVertical);
+ addComponent(layout);
+
+ HorizontalLayout horizontalLayout = new HorizontalLayout();
+
+ TextField inHorizontal = new TextField();
+ inHorizontal.setRequired(true);
+ inHorizontal.setRequiredError("Horizontal layout tooltip");
+ inHorizontal.setCaption("Horizontal layout caption");
+
+ horizontalLayout.addComponent(inHorizontal);
+ layout.addComponent(horizontalLayout);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
+ */
+ @Override
+ protected String getTestDescription() {
+ return "Show tooltip for caption and required indicator";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber()
+ */
+ @Override
+ protected Integer getTicketNumber() {
+ return 10046;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.html b/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.html
index bcb9f52afe..ba24b55f64 100644
--- a/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.html
+++ b/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.html
@@ -71,7 +71,66 @@
<td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Current URI fragment: test</td>
</tr>
-
+<!--Open other URL in between to ensure the page is loaded again (testbench doesn't like opening a URI that only changes the fragment)-->
+<tr>
+ <td>open</td>
+ <td>/run/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.ui.UriFragmentTest?restartApplication</td>
+ <td></td>
+</tr>
+<!--Empty initial fragment-->
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
+ <td>No URI fragment set</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--Still no # after setting to null-->
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
+ <td>No URI fragment set</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--Empty # is added when setting to ""-->
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
+ <td>Current URI fragment:</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
+ <td>Current URI fragment: test</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--Setting to null when there is a fragment actually sets it to #-->
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsuiUriFragmentTest::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td>
+ <td>Current URI fragment:</td>
+</tr>
</tbody></table>
</body>
</html>
diff --git a/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java b/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java
index 2172b00ee3..bfd784280a 100644
--- a/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java
+++ b/uitest/src/com/vaadin/tests/components/ui/UriFragmentTest.java
@@ -29,6 +29,21 @@ public class UriFragmentTest extends AbstractTestUI {
getPage().setUriFragment("test");
}
}));
+
+ addComponent(new Button("Navigate to #", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getPage().setUriFragment("");
+ }
+ }));
+
+ addComponent(new Button("setUriFragment(null)",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getPage().setUriFragment(null);
+ }
+ }));
}
private void updateLabel() {