diff options
Diffstat (limited to 'uitest')
50 files changed, 1580 insertions, 183 deletions
diff --git a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.html b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.html new file mode 100644 index 0000000000..33fc46f060 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.html @@ -0,0 +1,92 @@ +<?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.application.DetachOldUIOnReload?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 0</td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.DetachOldUIOnReload</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::PID_SLog_row_0</td> + <td>1. UI 0 has been detached</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 1</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::PID_SLog_row_0</td> + <td>2. UI 1 has been detached</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 2</td> +</tr> +<tr> + <td>open</td> + <td>/</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.DetachOldUIOnReload</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::PID_SLog_row_0</td> + <td>3. UI 2 has been detached</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestsapplicationDetachOldUIOnReload::/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[0]/VLabel[0]</td> + <td>This is UI 3</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java new file mode 100644 index 0000000000..154c84b4f5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java @@ -0,0 +1,85 @@ +/* + * 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.application; + +import java.util.ArrayList; +import java.util.List; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; + +public class DetachOldUIOnReload extends AbstractTestUIWithLog { + private static final String PERSISTENT_MESSAGES_ATTRIBUTE = DetachOldUIOnReload.class + .getName() + ".sessionMessages"; + + @Override + protected void setup(VaadinRequest request) { + addComponent(new Label("This is UI " + getUIId())); + addComponent(new Button("Reload page", new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + getPage().reload(); + } + })); + addComponent(new Button("Read log messages from session", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + for (String message : getSessionMessages(false)) { + log(message); + } + } + })); + } + + private List<String> getSessionMessages(boolean storeIfNeeded) { + List<String> messages = (List<String>) getSession().getAttribute( + PERSISTENT_MESSAGES_ATTRIBUTE); + if (messages == null) { + messages = new ArrayList<String>(); + if (storeIfNeeded) { + getSession().setAttribute(PERSISTENT_MESSAGES_ATTRIBUTE, + messages); + } + } + return messages; + } + + private void logToSession(String message) { + getSessionMessages(true).add(message); + } + + @Override + public void detach() { + super.detach(); + logToSession("UI " + getUIId() + " has been detached"); + } + + @Override + protected String getTestDescription() { + return "Tests that the previous UI gets cleaned immediately when refreshing."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(10338); + } + +} diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html new file mode 100644 index 0000000000..f366054f45 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.html @@ -0,0 +1,36 @@ +<?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/run/com.vaadin.tests.application.RefreshStatePreserveTitle?restartApplication" /> +<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.application.RefreshStatePreserveTitle?restartApplication</td> + <td></td> +</tr> +<tr> + <td>assertTitle</td> + <td>TEST</td> + <td></td> +</tr> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.application.RefreshStatePreserveTitle</td> + <td></td> +</tr> +<tr> + <td>assertTitle</td> + <td>TEST</td> + <td></td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java new file mode 100644 index 0000000000..88b3a9b9f4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java @@ -0,0 +1,30 @@ +package com.vaadin.tests.application; + +import com.vaadin.annotations.PreserveOnRefresh; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Label; + +@PreserveOnRefresh +public class RefreshStatePreserveTitle extends AbstractTestUI { + + private Log log = new Log(5); + + @Override + protected void setup(VaadinRequest request) { + getPage().setTitle("TEST"); + addComponent(new Label( + "Refresh the page and observe that window title 'TEST' is lost.")); + } + + @Override + protected String getTestDescription() { + return "Refreshing the browser window should preserve the window title"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(11054); + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html index f20967c8de..e7d437eeca 100644 --- a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html +++ b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.html @@ -28,7 +28,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestsapplicationTerminalErrorNotification::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestsapplicationTerminalErrorNotification::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>Got an exception: You asked for it</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html index e03027f308..150ab3ff3d 100644 --- a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html +++ b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertText</td> - <td>//body/div[2]</td> + <td>//body/div[2]//h1</td> <td>42 & 84</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/ErrorMessages.html b/uitest/src/com/vaadin/tests/components/ErrorMessages.html index 5379ff59e0..2b7032ea79 100644 --- a/uitest/src/com/vaadin/tests/components/ErrorMessages.html +++ b/uitest/src/com/vaadin/tests/components/ErrorMessages.html @@ -3,17 +3,17 @@ <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://artur-laptop.office.itmill.com:8888/" /> -<title>New Test</title> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>ErrorMessages</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">ErrorMessages</td></tr> </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.ErrorMessages</td> + <td>/run/com.vaadin.tests.components.ErrorMessages?restartApplication</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java index 1208b8be3b..cc75f87a71 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonsWaiAria.java @@ -22,6 +22,7 @@ public class ButtonsWaiAria extends ComponentTestCase<Button> { l = createButton("Icon Button, empty alt", nat); l.setIcon(ICON_16_USER_PNG_CACHEABLE); + l.setDescription("Empty alt text"); addTestComponent(l); l = createButton("Icon Button with alt", nat); diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html b/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html index fd51a0daad..6add1deba5 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarWeeklyViewNewEvents.html @@ -313,7 +313,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,9</td> </tr> <!--Edit previously created events and change properties--> @@ -438,7 +438,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,8</td> </tr> <tr> @@ -558,7 +558,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>7,8</td> </tr> <tr> @@ -583,7 +583,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentscalendarCalendarTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>12,10</td> </tr> <!--Go to monthly view and assert inserted events--> diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html index 03ec163e40..3c91c8b24f 100644 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.html @@ -18,7 +18,7 @@ </tr> <tr> <td>showTooltip</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper3</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper3/VLabel[0]</td> <td>0,0</td> </tr> <tr> @@ -26,9 +26,10 @@ <td></td> <td>tooltip-initial</td> </tr> +<!--Drag Block 4 between Block 1 and Block 2--> <tr> <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper4</td> + <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragAndDropWrapperTooltips::PID_Swrapper4/VLabel[0]</td> <td>30,41</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html b/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html index 2dcd1b5071..ae81cfe61c 100644 --- a/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html +++ b/uitest/src/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html @@ -23,7 +23,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>41, 22</td> </tr> <tr> @@ -33,7 +33,7 @@ </tr> <tr> <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td></td> </tr> <tr> @@ -43,7 +43,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>0, 0</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/form/FormTooltips.html b/uitest/src/com/vaadin/tests/components/form/FormTooltips.html index ee693fd4be..5e412c3aad 100644 --- a/uitest/src/com/vaadin/tests/components/form/FormTooltips.html +++ b/uitest/src/com/vaadin/tests/components/form/FormTooltips.html @@ -3,7 +3,7 @@ <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:8070" /> +<link rel="selenium.base" href="http://localhost:8888" /> <title>FormTooltips</title> </head> <body> @@ -38,10 +38,15 @@ <td></td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>-1000</td> +</tr> <!--first name caption tooltip--> <tr> <td>showTooltip</td> @@ -64,10 +69,15 @@ <td></td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>-1000</td> +</tr> <!--Form should not have a description tooltip--> <tr> <td>showTooltip</td> @@ -80,9 +90,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]</td> - <td></td> + <td>-1000</td> </tr> <!--Form error message should not have a tooltip--> <tr> @@ -96,9 +106,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]</td> - <td></td> + <td>-1000</td> </tr> <!--last name should have no tooltip--> <tr> @@ -112,9 +122,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> <!--last name caption should have no tooltip--> <tr> @@ -128,9 +138,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsformFormTooltips::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html b/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html index 1ab75e1176..c9d9e186bc 100644 --- a/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html +++ b/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html @@ -28,12 +28,12 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>Hello world</td> </tr> <tr> <td>keyDown</td> - <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>\27</td> </tr> <!-- Fade delay is 400 ms by default - VNotification --> diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.html b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.html new file mode 100644 index 0000000000..fb00953e48 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.html @@ -0,0 +1,107 @@ +<?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>NotificationsWaiAria</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">NotificationsWaiAria</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.NotificationsWaiAria?restartApplication</td> + <td></td> +</tr> +<tr> + <td>enterCharacter</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTextField[0]</td> + <td>Prefix:</td> +</tr> +<tr> + <td>enterCharacter</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VTextField[0]</td> + <td>- press ESC to close</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VNativeSelect[0]/domChild[0]</td> + <td>label=ALERT</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]@role</td> + <td>alert</td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-Notification humanized v-Notification-humanized']//span[@class='v-assistive-device-only'][1]</td> + <td>Prefix:</td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-Notification humanized v-Notification-humanized']//span[@class='v-assistive-device-only'][2]</td> + <td>- press ESC to close</td> +</tr> +<tr> + <td>closeNotification</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VNativeSelect[0]/domChild[0]</td> + <td>label=STATUS</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>xpath=/html/body/div[2]/div@role</td> + <td>status</td> +</tr> +<tr> + <td>closeNotification</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTextField[0]</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VTextField[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsWaiAria::Root/VNotification[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java new file mode 100644 index 0000000000..27af49a397 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java @@ -0,0 +1,116 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.data.Item; +import com.vaadin.server.Page; +import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.NativeSelect; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; + +public class NotificationsWaiAria extends TestBase { + + private static final String CAPTION = "CAPTION"; + private static final String ROLE = "ROLE"; + + private TextField prefix; + private TextField postfix; + private NativeSelect role; + + private TextArea tf; + private ComboBox type; + + @SuppressWarnings("deprecation") + @Override + protected void setup() { + prefix = new TextField("Prefix", "Info"); + addComponent(prefix); + + postfix = new TextField("Postfix", + " - closes automatically after 10 seconds"); + addComponent(postfix); + + role = new NativeSelect("Role"); + role.addItem(Role.ALERT); + role.addItem(Role.STATUS); + role.setValue(role.getItemIds().iterator().next()); + addComponent(role); + + tf = new TextArea("Text", "Hello world"); + tf.setRows(10); + addComponent(tf); + type = new ComboBox(); + type.setNullSelectionAllowed(false); + type.addContainerProperty(CAPTION, String.class, ""); + + type.setItemCaptionPropertyId(CAPTION); + + Item item = type.addItem(Notification.TYPE_HUMANIZED_MESSAGE); + item.getItemProperty(CAPTION).setValue("Humanized"); + + item = type.addItem(Notification.TYPE_ERROR_MESSAGE); + item.getItemProperty(CAPTION).setValue("Error"); + + item = type.addItem(Notification.TYPE_WARNING_MESSAGE); + item.getItemProperty(CAPTION).setValue("Warning"); + + item = type.addItem(Notification.TYPE_TRAY_NOTIFICATION); + item.getItemProperty(CAPTION).setValue("Tray"); + + item = type.addItem(Notification.Type.ASSISTIVE_NOTIFICATION); + item.getItemProperty(CAPTION).setValue("Assistive"); + + type.setValue(type.getItemIds().iterator().next()); + addComponent(type); + + Button showNotification = new Button("Show notification", + new SettingHandler()); + addComponent(showNotification); + + Button showDefaultNotification = new Button("Default notification", + new DefaultHandler()); + addComponent(showDefaultNotification); + } + + @Override + protected String getDescription() { + return "Generic test case for notifications"; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + + private class SettingHandler implements ClickListener { + @Override + public void buttonClick(ClickEvent event) { + Type typeValue = (Type) type.getValue(); + + Notification n = new Notification(tf.getValue(), typeValue); + n.setHtmlContentAllowed(true); + n.setAssistivePrefixForType(typeValue, prefix.getValue()); + n.setAssistivePostfixForType(typeValue, postfix.getValue()); + n.setAssistiveRoleForType(typeValue, (Role) role.getValue()); + + n.show(Page.getCurrent()); + } + } + + private class DefaultHandler implements ClickListener { + @Override + public void buttonClick(ClickEvent event) { + Notification n = new Notification(tf.getValue(), + (Type) type.getValue()); + n.setHtmlContentAllowed(true); + n.show(Page.getCurrent()); + } + } +} diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html b/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html index 4e8296050f..806e7d1b44 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html +++ b/uitest/src/com/vaadin/tests/components/slider/SliderTooltip.html @@ -3,13 +3,13 @@ <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://arturwin.office.itmill.com:9999/" /> -<title>New Test</title> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>SliderTooltip</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">SliderTooltip</td></tr> </thead><tbody> <tr> <td>open</td> @@ -57,9 +57,14 @@ <td>40,16</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>pause</td> <td></td> + <td>1000</td> +</tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runcomvaadintestscomponentssliderSliderTest::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> + <td>-1000</td> </tr> </tbody></table> diff --git a/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java b/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java index 355cd43d37..4cf2506eeb 100644 --- a/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java +++ b/uitest/src/com/vaadin/tests/components/table/DoublesInTable.java @@ -9,7 +9,7 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.data.util.converter.Converter; -import com.vaadin.data.util.converter.StringToNumberConverter; +import com.vaadin.data.util.converter.StringToDoubleConverter; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; @@ -276,7 +276,7 @@ public class DoublesInTable extends TestBase { }); - t.setConverter("rent", new StringToNumberConverter() { + t.setConverter("rent", new StringToDoubleConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getCurrencyInstance(locale); diff --git a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html index eb3efc28fd..2df9fb678c 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html +++ b/uitest/src/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.html @@ -3,13 +3,13 @@ <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://arturwin.office.itmill.com:8888/" /> -<title>New Test</title> +<link rel="selenium.base" href="http://localhost:8888/" /> +<title>TableItemDescriptionGeneratorTest</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">TableItemDescriptionGeneratorTest</td></tr> </thead><tbody> <tr> <td>open</td> @@ -39,10 +39,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -65,10 +70,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -91,10 +101,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Cell and row tooltips--> <tr> <td>mouseClick</td> @@ -123,10 +138,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -149,10 +169,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -175,10 +200,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Row and Component tooltips--> <tr> <td>mouseClick</td> @@ -212,10 +242,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -238,10 +273,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -264,10 +304,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Row tooltips--> <tr> <td>mouseClick</td> @@ -296,10 +341,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--Button tooltip--> <tr> <td>mouseMoveAt</td> @@ -322,10 +372,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> <!--TextField tooltip--> <tr> <td>mouseMoveAt</td> @@ -348,10 +403,15 @@ <td>22,7</td> </tr> <tr> - <td>waitForElementNotPresent</td> - <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>pause</td> + <td>1000</td> <td></td> </tr> +<tr> + <td>assertElementPositionLeft</td> + <td>vaadin=runTableItemDescriptionGeneratorTest::Root/VTooltip[0]</td> + <td>-1000</td> +</tr> </tbody></table> </body> diff --git a/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html b/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html index bab6c8dc16..e24f4ddca4 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html +++ b/uitest/src/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.html @@ -33,7 +33,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>TF Value on the server:fooo</td> </tr> <tr> @@ -63,7 +63,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableShouldNotEatValueChanges::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>TF Value on the server:baar</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html index c2481e6be6..441324bb6a 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html +++ b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.html @@ -3,7 +3,6 @@ <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:9999/" /> <title>TableWithBrokenGeneratorAndContainer</title> </head> <body> @@ -163,7 +162,7 @@ <!--error notification--> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentstableTableWithBrokenGeneratorAndContainer::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentstableTableWithBrokenGeneratorAndContainer::Root/VNotification[0]/HTML[0]/domChild[1]</td> <td>Problem updating table. Please try again later</td> </tr> <!--table should be empty--> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html index 4b2ad890c3..825988173a 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html @@ -33,6 +33,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 1</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 2</td> </tr> <tr> @@ -58,6 +68,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[3]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 2</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[3]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 5</td> </tr> <tr> @@ -83,6 +103,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[4]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 5</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[4]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 6</td> </tr> <tr> @@ -143,6 +173,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[8]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 9</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[10]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[8]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 12</td> </tr> <tr> @@ -178,6 +218,16 @@ <tr> <td>assertText</td> <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>Tab 5</td> +</tr> +<tr> + <td>pressSpecialKey</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>space</td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> <td>Tab 1</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigationWaiAria.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigationWaiAria.java new file mode 100644 index 0000000000..e394594176 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabKeyboardNavigationWaiAria.java @@ -0,0 +1,86 @@ +package com.vaadin.tests.components.tabsheet; + +import java.util.ArrayList; + +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.Button.ClickListener; +import com.vaadin.ui.Component; +import com.vaadin.ui.Layout; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TabSheet.Tab; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +public class TabKeyboardNavigationWaiAria extends AbstractTestUI { + + int index = 1; + ArrayList<Component> tabs = new ArrayList<Component>(); + TabSheet ts = new TabSheet(); + + @Override + protected void setup(VaadinRequest request) { + ts.setWidth("500px"); + ts.setHeight("500px"); + + for (int i = 0; i < 5; ++i) { + addTab(); + } + + Button addTab = new Button("Add a tab", new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + addTab(); + } + }); + Button focus = new Button("Focus tabsheet", new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + ts.focus(); + } + }); + + addComponent(addTab); + addComponent(focus); + + addComponent(ts); + } + + @Override + protected String getTestDescription() { + return "The tab bar should be focusable and arrow keys should change focus for tabs. Space key selects a focused tab. The del key should close a tab if closable."; + } + + @Override + protected Integer getTicketNumber() { + return 11827; + } + + private Tab addTab() { + Layout content = new VerticalLayout(); + tabs.add(content); + + TextField field = new TextField("Tab " + index + " label"); + content.addComponent(field); + + Tab tab = ts.addTab(content, "Tab " + index, null); + + if (index == 2) { + tab.setClosable(true); + tab.setDescription("Tab 2 Tooltip"); + } + + if (index == 4) { + tab.setEnabled(false); + } + + if (index == 5) { + tab.setDefaultFocusComponent(field); + } + + index++; + return tab; + } +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html index 425da11af4..6876497a1f 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html @@ -21,6 +21,16 @@ <td></td> <td></td> </tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetIcons::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]@alt</td> + <td>iconalt1</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetIcons::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]@alt</td> + <td>iconalt3</td> +</tr> </tbody></table> </body> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java index 5d814ec48f..ccdc4ecb38 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java @@ -46,6 +46,8 @@ public class TabSheetIcons extends TestBase { for (Component c : tab) { tabsheet.addTab(c); + tabsheet.getTab(c).setIconAltText( + "iconalt" + tabsheet.getComponentCount()); } return tabsheet; diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java index 6c39cdab73..56836037b7 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTest.java @@ -26,7 +26,7 @@ public class TabSheetTest<T extends TabSheet> extends @Override public void execute(T c, Integer value, Object data) { - c.getTab(value).setIcon((Resource) data); + c.getTab(value).setIcon((Resource) data, "tabicon"); } }; diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.html new file mode 100644 index 0000000000..64e85f55e3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.html @@ -0,0 +1,76 @@ +<?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>TabSheetWithTabIds</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TabSheetWithTabIds</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.tabsheet.TabSheetWithTabIds</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab1</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab2</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab3</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithTabIds::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>tab1</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>tab2</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>tab3</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithTabIds::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab1</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab2</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>tab3</td> + <td></td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java new file mode 100644 index 0000000000..ae5adea45e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java @@ -0,0 +1,77 @@ +/* + * 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.tabsheet; + +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.Label; +import com.vaadin.ui.TabSheet; +import com.vaadin.ui.TabSheet.Tab; + +public class TabSheetWithTabIds extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + TabSheet tabSheet = new TabSheet(); + + final Tab tab1 = tabSheet.addTab(new Label("Label 1"), "Tab 1", null); + + final Tab tab2 = tabSheet.addTab(new Label("Label 2"), "Tab 2", null); + + final Tab tab3 = tabSheet.addTab(new Label("Label 3"), "Tab 3", null); + + addComponent(tabSheet); + + Button b = new Button("Set ids", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + tab1.setId("tab1"); + tab2.setId("tab2"); + tab3.setId("tab3"); + } + }); + addComponent(b); + + Button b2 = new Button("Clear ids", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + tab1.setId(null); + tab2.setId(null); + tab3.setId(null); + } + }); + addComponent(b2); + } + + @Override + protected String getTestDescription() { + return "Add support for setId to TabSheet.Tab"; + } + + @Override + protected Integer getTicketNumber() { + return 12064; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html index d133ab9937..38ff6ab8ca 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html @@ -13,7 +13,7 @@ </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.tabsheet.TabsheetTooltip</td> + <td>/run/com.vaadin.tests.components.tabsheet.TabsheetTooltip?restartApplication</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.html b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.html new file mode 100644 index 0000000000..2428e8b4bb --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.html @@ -0,0 +1,123 @@ +<?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.textfield.BigDecimalTextField?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertValue</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>15,2</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>1. Commit ok. Property value: 15.2</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>70,12</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>130</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::</td> + <td>160,327</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>2. Commit ok. Property value: 130</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>75,16</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>130abc</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::</td> + <td>96,280</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>3. Commit failed: Commit failed</td> +</tr> +<tr> + <td>assertCSSClass</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> + <td>v-errorindicator</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>71,12</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[1]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td> + <td>130,130</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::</td> + <td>118,280</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::/VVerticalLayout[0]/Slot[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<!--The converter automatically removes trailing zeros--> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstextfieldBigDecimalTextField::PID_SLog_row_0</td> + <td>4. Commit ok. Property value: 130.13</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java new file mode 100644 index 0000000000..18d8679c2f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java @@ -0,0 +1,123 @@ +/* + * 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.textfield; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Locale; + +import com.vaadin.data.fieldgroup.FieldGroup; +import com.vaadin.data.util.BeanItem; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +/** + * @since 7.2 + * @author Vaadin Ltd + */ +public class BigDecimalTextField extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + final VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + setLocale(new Locale("fi", "FI")); + + BeanBigDecimal beanBigDecimal = new BeanBigDecimal(); + BeanItem<BeanBigDecimal> beanItem = new BeanItem<BeanBigDecimal>( + beanBigDecimal); + + FormLayout formLayout = new FormLayout(); + TextField textField = new TextField("BigDecimal field"); + textField.setImmediate(true); + textField.setValue("12"); + formLayout.addComponent(textField); + + final FieldGroup fieldGroup = new FieldGroup(beanItem); + fieldGroup.bind(textField, "decimal"); + + Button setValue = new Button("Set value to 15,2", new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + ((TextField) fieldGroup.getField("decimal")).setValue("15,2"); + } + }); + + Button button = new Button("Commit"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + try { + fieldGroup.commit(); + log("Commit ok. Property value: " + + fieldGroup.getItemDataSource() + .getItemProperty("decimal").getValue()); + } catch (FieldGroup.CommitException e) { + log("Commit failed: " + e.getMessage()); + } + } + }); + + layout.addComponent(formLayout); + layout.addComponent(setValue); + layout.addComponent(button); + + setContent(layout); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Tests that BigDecimals work correctly with TextFields"; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 9997; + } + + public static class BeanBigDecimal implements Serializable { + BigDecimal decimal; + + public BeanBigDecimal() { + + } + + public BigDecimal getDecimal() { + return decimal; + } + + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + } + +} diff --git a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java index 2fd3f05dbb..06b8af1ec6 100644 --- a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java +++ b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java @@ -8,6 +8,8 @@ import com.vaadin.event.Action; import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractSelect; +import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator; +import com.vaadin.ui.Component; import com.vaadin.ui.Tree; public class SimpleTree extends TestBase implements Action.Handler { @@ -53,6 +55,17 @@ public class SimpleTree extends TestBase implements Action.Handler { tree.setItemIcon(9, notCachedFolderIconLargeOther, "First Choice"); tree.setItemIcon(11, notCachedFolderIconLarge); + tree.setItemDescriptionGenerator(new ItemDescriptionGenerator() { + @Override + public String generateDescription(Component source, Object itemId, + Object propertyId) { + if ((Integer) itemId == 3) { + return "tree item tooltip"; + } + return ""; + } + }); + // Expand whole tree for (Object id : tree.rootItemIds()) { tree.expandItemsRecursively(id); diff --git a/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html b/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html index e41cf5e176..338e4a2c5b 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html +++ b/uitest/src/com/vaadin/tests/components/ui/TooltipConfiguration.html @@ -4,12 +4,12 @@ <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> +<title>TooltipConfiguration</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">TooltipConfiguration</td></tr> </thead><tbody> <tr> <td>open</td> @@ -43,9 +43,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentsuiTooltipConfiguration::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> <!--Long close delay--> <tr> @@ -140,6 +140,7 @@ <td>vaadin=runcomvaadintestscomponentsuiTooltipConfiguration::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> <td>100</td> </tr> + </tbody></table> </body> </html> diff --git a/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html index b5326e4660..acbe30c5d2 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html +++ b/uitest/src/com/vaadin/tests/components/uitest/UIScrollTest.html @@ -43,7 +43,7 @@ </tr> <tr> <td>assertText</td> - <td>//div[@id='runcomvaadintestscomponentsuitestUIScrollTest-1797389287-overlays']/div</td> + <td>//div[@id='runcomvaadintestscomponentsuitestUIScrollTest-1797389287-overlays']//h1</td> <td>Scrolled to 1020 px</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html index 614ae7bcda..cdbcf8bacc 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/base_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html index 7d9ffc65b8..d5d70a62d2 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/chameleon_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html index d0ee96c7ef..783784e993 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/liferay_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html index a330f5bf61..175def94d3 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/reindeer_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html b/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html index 61ba58a0e6..0db6614a9c 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html +++ b/uitest/src/com/vaadin/tests/components/uitest/runo_theme_test.html @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,8</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,6</td> </tr> <tr> @@ -319,7 +319,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>8,5</td> </tr> <tr> @@ -334,7 +334,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>9,6</td> </tr> <tr> @@ -349,7 +349,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runThemeTestUI::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html b/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html index ac81dfdefb..ae77628bff 100644 --- a/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html +++ b/uitest/src/com/vaadin/tests/components/window/CloseSubWindow.html @@ -40,7 +40,7 @@ <!--Click close in title bar--> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html new file mode 100644 index 0000000000..f5f89d13ef --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.html @@ -0,0 +1,136 @@ +<?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>ExtraWindowShownWaiAria</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">ExtraWindowShownWaiAria</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.window.ExtraWindowShownWaiAria?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td> + <td></td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@role</td> + <td>dialog</td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]@id</td> + <td>headerid</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-labelledby</td> + <td>${headerid}</td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[0]@id</td> + <td>descriptionid</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-describedby</td> + <td>${descriptionid}</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]@role</td> + <td>button</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]@role</td> + <td>button</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VCheckBox[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[0]@id</td> + <td>descriptionid</td> +</tr> +<tr> + <td>storeAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VLabel[1]@id</td> + <td>description2id</td> +</tr> +<tr> + <td>assertAttribute</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/@aria-describedby</td> + <td>${descriptionid} ${description2id}</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/FocusableScrollPanel[0]/VCssLayout[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VWindow[0]/</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[6]/VTextField[0]</td> + <td>Important</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[7]/VTextField[0]</td> + <td> - do ASAP</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentswindowExtraWindowShownWaiAria::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-window-header']/span[@class='v-assistive-device-only'][1]</td> + <td>Important</td> +</tr> +<tr> + <td>assertText</td> + <td>xpath=//div[@class='v-window-header']/span[@class='v-assistive-device-only'][2]</td> + <td>- do ASAP</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java new file mode 100644 index 0000000000..39989926e7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java @@ -0,0 +1,172 @@ +package com.vaadin.tests.components.window; + +import com.vaadin.server.ThemeResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.window.WindowState.WindowRole; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.TextField; +import com.vaadin.ui.Window; + +public class ExtraWindowShownWaiAria extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final CheckBox modal = new CheckBox("Modal dialog"); + modal.setTabIndex(7); + final CheckBox additionalDescription = new CheckBox( + "Additional Description"); + final CheckBox tabStop = new CheckBox( + "Prevent leaving window with Tab key"); + final CheckBox tabOrder = new CheckBox("Change Taborder"); + final TextField prefix = new TextField("Prefix: "); + final TextField postfix = new TextField("Postfix: "); + + final TextField topTabStopMessage = new TextField( + "Top Tab Stop Message"); + final TextField bottomTabStopMessage = new TextField( + "Bottom Tab Stop Message"); + + Button simple = new Button("Open Alert Dialog", + new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + CssLayout layout = new CssLayout(); + + final Window w = new Window("Sub window", layout); + w.center(); + w.setModal(modal.getValue()); + w.setAssistiveRole(WindowRole.ALERTDIALOG); + w.setAssistivePrefix(prefix.getValue()); + w.setAssistivePostfix(postfix.getValue()); + + Label description1 = new Label("Simple alert dialog."); + layout.addComponent(description1); + + if (!additionalDescription.getValue()) { + w.setAssistiveDescription(description1); + } else { + Label description2 = new Label( + "Please select what to do!"); + layout.addComponent(description2); + + w.setAssistiveDescription(description1, + description2); + } + + w.setTabStopEnabled(tabStop.getValue()); + w.setTabStopTopAssistiveText(topTabStopMessage + .getValue()); + w.setTabStopBottomAssistiveText(bottomTabStopMessage + .getValue()); + + Button close = new Button("Close", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + w.close(); + } + }); + layout.addComponent(close); + Button iconButton = new Button("A button with icon"); + iconButton.setIcon(new ThemeResource( + "../runo/icons/16/ok.png")); + layout.addComponent(iconButton); + + event.getButton().getUI().addWindow(w); + iconButton.focus(); + + if (tabOrder.getValue()) { + close.setTabIndex(5); + } + } + + }); + getLayout().addComponent(simple); + + Button complex = new Button("Open Entry Dialog", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + FormLayout form = new FormLayout(); + + final Window w = new Window("Form Window", form); + w.center(); + w.setModal(modal.getValue()); + w.setAssistivePrefix(prefix.getValue()); + w.setAssistivePostfix(postfix.getValue()); + + Label description1 = new Label( + "Please fill in your data"); + form.addComponent(description1); + + if (!additionalDescription.getValue()) { + w.setAssistiveDescription(description1); + } else { + Label description2 = new Label( + "and press the button save."); + form.addComponent(description2); + + w.setAssistiveDescription(description1, + description2); + } + + w.setTabStopEnabled(tabStop.getValue()); + w.setTabStopTopAssistiveText(topTabStopMessage + .getValue()); + w.setTabStopBottomAssistiveText(bottomTabStopMessage + .getValue()); + + TextField name = new TextField("Name:"); + form.addComponent(name); + + form.addComponent(new TextField("Address")); + + Button saveButton = new Button("Save", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + w.close(); + } + }); + form.addComponent(saveButton); + + event.getButton().getUI().addWindow(w); + name.focus(); + + if (tabOrder.getValue()) { + name.setTabIndex(5); + } + } + }); + getLayout().addComponent(complex); + + getLayout().addComponent(modal); + getLayout().addComponent(additionalDescription); + getLayout().addComponent(tabStop); + getLayout().addComponent(tabOrder); + + getLayout().addComponent(prefix); + getLayout().addComponent(postfix); + + getLayout().addComponent(topTabStopMessage); + getLayout().addComponent(bottomTabStopMessage); + + } + + @Override + protected String getTestDescription() { + return "Test for WAI-ARIA implementation"; + } + + @Override + protected Integer getTicketNumber() { + return 11821; + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html b/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html index 8374a90b52..6fd99caa19 100644 --- a/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html +++ b/uitest/src/com/vaadin/tests/components/window/SubWindowOrder.html @@ -90,7 +90,7 @@ <!--Close window 4, which is the topmost window--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[3]</td> <td>11,15</td> </tr> <tr> @@ -101,7 +101,7 @@ <!--Close Dialog 3 (topmost)--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[3]</td> <td>6,8</td> </tr> <!--Make Dialog 5 (topmost) non-modal--> @@ -139,7 +139,7 @@ <!--Close dialog 5--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[3]</td> <td>10,5</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html index 63e371e379..575eb652b7 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.html @@ -44,9 +44,9 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]</td> - <td></td> + <td>-1000</td> </tr> <!--Show tooltip in Window--> <tr> @@ -76,10 +76,11 @@ <td></td> </tr> <tr> - <td>assertElementNotPresent</td> + <td>assertElementPositionLeft</td> <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td> - <td></td> + <td>-1000</td> </tr> + </tbody></table> </body> </html> diff --git a/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html b/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html index a9a6fd621e..85ab67e4f6 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html +++ b/uitest/src/com/vaadin/tests/components/window/WindowCaptionTest.html @@ -3,7 +3,6 @@ <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://arturwin.office.itmill.com:8888/" /> <title>New Test</title> </head> <body> @@ -18,7 +17,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>Short</td> </tr> <tr> @@ -43,7 +42,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>This is a semi-long text that might wrap.</td> </tr> <tr> @@ -68,7 +67,7 @@ </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html b/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html index dcdfa05687..a27963a066 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html +++ b/uitest/src/com/vaadin/tests/components/window/WindowMaximizeRestoreTest.html @@ -3,7 +3,6 @@ <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/run/" /> <title>WindowMaximizeRestoreTest</title> </head> <body> @@ -19,59 +18,59 @@ <!--Test maximize-restore button--> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <tr> <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>Window 1</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>7,8</td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-restorebox</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>9,7</td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <!--test double click on header--> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-restorebox</td> </tr> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <!--Resizable = false should hide max-restore button--> <tr> <td>assertVisible</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td></td> </tr> <tr> @@ -81,7 +80,7 @@ </tr> <tr> <td>assertNotVisible</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td></td> </tr> <!--Test server side max-restore--> @@ -92,7 +91,7 @@ </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-restorebox</td> </tr> <tr> @@ -102,28 +101,28 @@ </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <!--test double click on header doesn't work--> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td></td> </tr> <tr> <td>assertCSSClass</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>v-window-maximizebox</td> </tr> <tr> @@ -149,7 +148,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>10,8</td> </tr> <tr> @@ -175,7 +174,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[2]</td> <td>6,11</td> </tr> <tr> @@ -185,7 +184,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[3]</td> <td>7,5</td> </tr> <tr> @@ -210,12 +209,12 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[1]/domChild[0]/domChild[0]/domChild[2]</td> <td>6,11</td> </tr> <tr> <td>doubleClickAt</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>113,10</td> </tr> <tr> @@ -226,27 +225,27 @@ <!--Test that size and position is preserved when maximizing and restoring--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>8,4</td> </tr> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td> <td>-200,-200</td> </tr> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[4]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[5]/domChild[0]</td> <td>+100,+100</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>6,5</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowMaximizeRestoreTest::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> <td>5,8</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html index fa63e5e1e6..3ea1f8f732 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html +++ b/uitest/src/com/vaadin/tests/components/window/WindowWithInvalidCloseListener.html @@ -18,7 +18,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>vaadin=runcomvaadintestscomponentswindowWindowWithInvalidCloseListener::/VWindow[0]/domChild[0]/domChild[0]/domChild[3]</td> <td>6,7</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java b/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java index 4f83f5d0fd..2c202af02b 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java +++ b/uitest/src/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java @@ -7,7 +7,6 @@ import com.vaadin.data.util.BeanItem; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; -import com.vaadin.tests.data.bean.Person; import com.vaadin.tests.data.bean.PersonWithBeanValidationAnnotations; import com.vaadin.tests.data.bean.Sex; import com.vaadin.tests.util.Log; @@ -90,8 +89,10 @@ public class FieldBinderWithBeanValidation extends TestBase { p)); } - public static Person getPerson(FieldGroup binder) { - return ((BeanItem<Person>) binder.getItemDataSource()).getBean(); + public static PersonWithBeanValidationAnnotations getPerson( + FieldGroup binder) { + return ((BeanItem<PersonWithBeanValidationAnnotations>) binder + .getItemDataSource()).getBean(); } @Override diff --git a/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html b/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html index b7c40b4d9e..7c6f9ceb39 100644 --- a/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html +++ b/uitest/src/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html @@ -1,17 +1,17 @@ - <?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> +<?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:88888/" /> +<title>IntegerRangeValidator</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">IntegerRangeValidator</td></tr> +</thead><tbody> +<tr> <td>open</td> <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td> <td></td> @@ -82,12 +82,7 @@ </tr> <tr> <td>showTooltip</td> - <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td> - <td></td> -</tr> -<tr> - <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]</td> + <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[5]/VTextField[0]</td> <td></td> </tr> <tr> @@ -95,7 +90,7 @@ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td> <td>Must be between 0 and 150, -1 is not</td> </tr> -</tbody></table> - </body> - </html> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java index be2768a5f7..8485bba499 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a1; import java.text.NumberFormat; import java.util.Locale; -import com.vaadin.data.util.converter.StringToNumberConverter; +import com.vaadin.data.util.converter.StringToDoubleConverter; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Table; @@ -30,14 +30,14 @@ public class FormatTableValue extends AbstractTestUI { table.getItem(itemId).getItemProperty(DEFAULT_PROPERTY) .setValue(3.1415); - table.setConverter(PERCENT_PROPERTY, new StringToNumberConverter() { + table.setConverter(PERCENT_PROPERTY, new StringToDoubleConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getPercentInstance(locale); } }); - table.setConverter(CURRENCY_PROPERTY, new StringToNumberConverter() { + table.setConverter(CURRENCY_PROPERTY, new StringToDoubleConverter() { @Override protected NumberFormat getFormat(Locale locale) { return NumberFormat.getCurrencyInstance(locale); diff --git a/uitest/src/com/vaadin/tests/util/TestUtils.java b/uitest/src/com/vaadin/tests/util/TestUtils.java index 5c6315a23a..dcd28c3413 100644 --- a/uitest/src/com/vaadin/tests/util/TestUtils.java +++ b/uitest/src/com/vaadin/tests/util/TestUtils.java @@ -99,22 +99,13 @@ public class TestUtils { "YE", "ZAMBIA", "ZM", "ZIMBABWE", "ZW" }; /** - * Crossbrowser hack to dynamically add css current window. Can be used to - * keep tests css in source files. + * Injects css into the current window. Can be used to keep tests css in + * source files. * * @param cssString */ public static void injectCSS(UI w, String cssString) { - String script = "if ('\\v'=='v') /* ie only */ {\n" - + " document.createStyleSheet().cssText = '" - + cssString - + "';\n" - + " } else {var tag = document.createElement('style'); tag.type = 'text/css';" - + " document.getElementsByTagName('head')[0].appendChild(tag);tag[ (typeof " - + "document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' " - + ": 'innerHTML'] = '" + cssString + "';}"; - - w.getPage().getJavaScript().execute(script); + w.getPage().getStyles().add(cssString); } public static void installPerformanceReporting(TextArea targetTextArea) { |