diff options
author | Artur Signell <artur@vaadin.com> | 2012-08-30 17:24:36 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-08-30 17:24:36 +0300 |
commit | 7b25b3886ea95bc6495506fbe9472e45fcbde684 (patch) | |
tree | 0b93cb65dab437feb46720659a63b8f1ef48f7f4 /uitest/src/com/vaadin/tests/components/notification | |
parent | 8941056349e302e687e40e94c13709e75f256d73 (diff) | |
download | vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.tar.gz vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.zip |
Renamed tests -> uitest and tests/testbench -> uitest/src (#9299)
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/notification')
9 files changed, 654 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html b/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html new file mode 100644 index 0000000000..1ab75e1176 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/CloseErrorNotificationWithEscape.html @@ -0,0 +1,47 @@ +<?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>CloseErrorNotificationWithEscape</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">CloseErrorNotificationWithEscape</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.Notifications?restartApplication</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Error</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>Hello world</td> +</tr> +<tr> + <td>keyDown</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]/HTML[0]/domChild[0]</td> + <td>\27</td> +</tr> +<!-- Fade delay is 400 ms by default - VNotification --> +<tr> + <td>waitForElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::Root/VNotification[0]</td> + <td></td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/notification/Notifications.html b/uitest/src/com/vaadin/tests/components/notification/Notifications.html new file mode 100644 index 0000000000..c9016cfd6f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/Notifications.html @@ -0,0 +1,296 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.Notifications?restartApplication</td> + <td></td> +</tr> +<tr> + <td>focus</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Error</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Humanized</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>human-hello-world</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Error</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>error-hello-world</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>pause</td> + <td>500</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Warning</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>warning-hello-world</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Tray</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tray-hello-world</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td> + <td>Hello world<br/>Second row<br/>Third row which is very, very much longer than the other two rows</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Humanized</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>human-three-rows</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Error</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>error-three-rows</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>pause</td> + <td>500</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Warning</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>warning-three-rows</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Tray</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tray-three-rows</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td> + <td>82,107</td> +</tr> +<tr> + <td>type</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td> + <td>A very long row that should cause the notification to wrap onto several lines. Still the notification box should only be as wide as needed. Adding even more text here so that the tray notification also wraps...</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Humanized</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>human-long-wrapped-row</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Error</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>error-long-wrapped-row</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>pause</td> + <td>500</td> + <td></td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Warning</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>warning-long-wrapped-row</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>select</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VNativeSelect[0]/domChild[0]</td> + <td>label=Tray</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotifications::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tray-long-wrapped-row</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/notification/Notifications.java b/uitest/src/com/vaadin/tests/components/notification/Notifications.java new file mode 100644 index 0000000000..10fef434ca --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/Notifications.java @@ -0,0 +1,60 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.server.Page; +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.NativeSelect; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.TextArea; + +public class Notifications extends TestBase implements ClickListener { + + private static final String CAPTION = "CAPTION"; + private TextArea tf; + private NativeSelect type; + + @SuppressWarnings("deprecation") + @Override + protected void setup() { + tf = new TextArea("Text", "Hello world"); + tf.setRows(10); + addComponent(tf); + type = new NativeSelect(); + type.setNullSelectionAllowed(false); + type.addContainerProperty(CAPTION, String.class, ""); + type.setItemCaptionPropertyId(CAPTION); + type.addItem(Notification.TYPE_HUMANIZED_MESSAGE) + .getItemProperty(CAPTION).setValue("Humanized"); + type.addItem(Notification.TYPE_ERROR_MESSAGE).getItemProperty(CAPTION) + .setValue("Error"); + type.addItem(Notification.TYPE_WARNING_MESSAGE) + .getItemProperty(CAPTION).setValue("Warning"); + type.addItem(Notification.TYPE_TRAY_NOTIFICATION) + .getItemProperty(CAPTION).setValue("Tray"); + type.setValue(type.getItemIds().iterator().next()); + addComponent(type); + Button showNotification = new Button("Show notification", this); + addComponent(showNotification); + } + + @Override + protected String getDescription() { + return "Generic test case for notifications"; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + + @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/notification/NotificationsAndModalWindow.html b/uitest/src/com/vaadin/tests/components/notification/NotificationsAndModalWindow.html new file mode 100644 index 0000000000..35d22da46e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsAndModalWindow.html @@ -0,0 +1,42 @@ +<?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>NotificationsAndModalWindow</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">NotificationsAndModalWindow</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.NotificationsAndModalWindow?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsAndModalWindow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>closeNotification</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsAndModalWindow::Root/VNotification[1]</td> + <td>0,0</td> +</tr> +<tr> + <td>closeNotification</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsAndModalWindow::Root/VNotification[0]</td> + <td>0,0</td> +</tr> +<tr> + <td>assertElementNotPresent</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsAndModalWindow::Root/VNotification[0]</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java b/uitest/src/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java new file mode 100644 index 0000000000..25bc05c771 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java @@ -0,0 +1,40 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Window; + +public class NotificationsAndModalWindow extends TestBase { + + @Override + protected void setup() { + getMainWindow().showNotification("Notification 1", + Notification.TYPE_WARNING_MESSAGE); + getMainWindow().showNotification("Notification 2", + Notification.TYPE_WARNING_MESSAGE); + + Button b = new Button("Button"); + b.addListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + Window w = new Window("This is a window"); + w.setModal(true); + getMainWindow().addWindow(w); + } + }); + addComponent(b); + } + + @Override + protected String getDescription() { + return "Press the button when both two notifications are visible to add a modal window to the app. When the modal window is visible, the notifications should disappear normally."; + } + + @Override + protected Integer getTicketNumber() { + return 7136; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html b/uitest/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html new file mode 100644 index 0000000000..455952fb71 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html @@ -0,0 +1,51 @@ +<?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">NotificationsHtmlAllowed</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.NotificationsHtmlAllowed?restartApplication</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>view-html</td> +</tr> +<tr> + <td>closeNotification</td> + <td>//body/div[2]</td> + <td>0,0</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td> + <td>63,3</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>view-plain</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java b/uitest/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java new file mode 100644 index 0000000000..89e97c0b6a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java @@ -0,0 +1,59 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.server.Page; +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.CheckBox; +import com.vaadin.ui.Notification; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; + +public class NotificationsHtmlAllowed extends TestBase implements ClickListener { + + private TextArea messageField; + private CheckBox htmlAllowedBox; + private TextField captionField; + + @Override + protected void setup() { + captionField = new TextField("Caption", "Hello <u>world</u>"); + addComponent(captionField); + captionField.focus(); + + messageField = new TextArea("Message", + "Hello <i>world</i>\nWith a newline <br/>And a html line break"); + messageField.setRows(10); + addComponent(messageField); + + htmlAllowedBox = new CheckBox("Html content allowed", true); + addComponent(htmlAllowedBox); + + Button showNotification = new Button("Show notification", this); + addComponent(showNotification); + } + + @Override + protected String getDescription() { + return "Test case for htmlAllowed in notifications"; + } + + @Override + protected Integer getTicketNumber() { + return 6097; + } + + @Override + public void buttonClick(ClickEvent event) { + Notification n = makeNotification(); + n.show(Page.getCurrent()); + } + + private Notification makeNotification() { + Notification n = new Notification(captionField.getValue(), + messageField.getValue(), Notification.TYPE_HUMANIZED_MESSAGE, + htmlAllowedBox.getValue()); + return n; + } +} diff --git a/uitest/src/com/vaadin/tests/components/notification/SemiTransparentNotification.java b/uitest/src/com/vaadin/tests/components/notification/SemiTransparentNotification.java new file mode 100755 index 0000000000..1745c11982 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/SemiTransparentNotification.java @@ -0,0 +1,32 @@ +package com.vaadin.tests.components.notification; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.LoremIpsum; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; + +public class SemiTransparentNotification extends TestBase { + + @Override + protected void setup() { + Label l = new Label(LoremIpsum.get(10000)); + getLayout().setSizeFull(); + addComponent(l); + Notification + .show(" This should be a <br/><b>SEMI-TRANSPARENT</b><br/> notification", + Notification.TYPE_WARNING_MESSAGE); + } + + @Override + protected String getDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/notification/SemitransparentNotification.html b/uitest/src/com/vaadin/tests/components/notification/SemitransparentNotification.html new file mode 100755 index 0000000000..f125b98ee1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/notification/SemitransparentNotification.html @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.notification.SemiTransparentNotification</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>semitransparent-warning</td> +</tr> + +</tbody></table> +</body> +</html> |