]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6718 TestBench test
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Fri, 27 Jan 2012 13:21:33 +0000 (13:21 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Fri, 27 Jan 2012 13:21:33 +0000 (13:21 +0000)
svn changeset:22792/svn branch:6.8

tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java [new file with mode: 0644]

diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html
new file mode 100644 (file)
index 0000000..97398b4
--- /dev/null
@@ -0,0 +1,142 @@
+<?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>PopupDateFieldExtendedRange</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">PopupDateFieldExtendedRange</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.datefield.PopupDateFieldExtendedRange?restartApplication</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton</td>
+       <td>12,18</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]#prevmon</td>
+       <td>11,9</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]#prevy</td>
+       <td>10,13</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton</td>
+       <td>18,10</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton</td>
+       <td>16,12</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton</td>
+       <td>17,10</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#popupButton</td>
+       <td>11,8</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]</td>
+       <td>left</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]</td>
+       <td>left</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]</td>
+       <td>up</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]</td>
+       <td>up</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]</td>
+       <td>shift left</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::Root/VOverlay[0]/VCalendarPanel[0]</td>
+       <td>shift down</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#popupButton</td>
+       <td>9,4</td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton</td>
+       <td>9,9</td>
+</tr>
+<tr>
+       <td>screenCapture</td>
+       <td></td>
+       <td></td>
+</tr>
+<tr>
+       <td>mouseClick</td>
+       <td>vaadin=runcomvaadintestscomponentsdatefieldExtendedRangeInMonthView::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton</td>
+       <td>21,4</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
new file mode 100644 (file)
index 0000000..4fc8f87
--- /dev/null
@@ -0,0 +1,69 @@
+package com.vaadin.tests.components.datefield;\r
+\r
+import java.util.Calendar;\r
+import java.util.Locale;\r
+\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+import com.vaadin.ui.Button.ClickListener;\r
+import com.vaadin.ui.DateField;\r
+import com.vaadin.ui.PopupDateField;\r
+\r
+@SuppressWarnings("serial")\r
+public class PopupDateFieldExtendedRange extends TestBase {\r
+\r
+    private Calendar date = Calendar.getInstance();\r
+\r
+    @Override\r
+    protected void setup() {\r
+        date.set(2011, 0, 1);\r
+\r
+        getLayout().setSpacing(true);\r
+\r
+        final PopupDateField[] fields = new PopupDateField[3];\r
+\r
+        fields[0] = makeDateField();\r
+        fields[0].setLocale(new Locale("fi", "FI"));\r
+        fields[0].setCaption("Finnish locale");\r
+\r
+        fields[1] = makeDateField();\r
+        fields[1].setLocale(new Locale("en", "US"));\r
+        fields[1].setCaption("US English locale");\r
+\r
+        fields[2] = makeDateField();\r
+        fields[2].setLocale(new Locale("fi", "FI"));\r
+        fields[2].setShowISOWeekNumbers(true);\r
+        fields[2].setCaption("Finnish locale with week numbers");\r
+\r
+        for (PopupDateField f : fields) {\r
+            addComponent(f);\r
+        }\r
+\r
+        addComponent(new Button("Change date", new ClickListener() {\r
+            public void buttonClick(ClickEvent event) {\r
+                date.set(2010, 1, 16);\r
+                for (PopupDateField f : fields) {\r
+                    f.setValue(date.getTime());\r
+                }\r
+            }\r
+        }));\r
+    }\r
+\r
+    @Override\r
+    protected String getDescription() {\r
+        return "Show a few days of the preceding and following months in the datefield popup";\r
+    }\r
+\r
+    @Override\r
+    protected Integer getTicketNumber() {\r
+        return 6718;\r
+    }\r
+\r
+    private PopupDateField makeDateField() {\r
+        PopupDateField pdf = new PopupDateField();\r
+        pdf.setResolution(DateField.RESOLUTION_DAY);\r
+        pdf.setValue(date.getTime());\r
+        return pdf;\r
+    }\r
+}\r