diff options
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/themes/valo/NotificationStyle.java | 19 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java | 15 |
2 files changed, 25 insertions, 9 deletions
diff --git a/uitest/src/com/vaadin/tests/themes/valo/NotificationStyle.java b/uitest/src/com/vaadin/tests/themes/valo/NotificationStyle.java index c7abcf9303..e918bb64d0 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/NotificationStyle.java +++ b/uitest/src/com/vaadin/tests/themes/valo/NotificationStyle.java @@ -32,14 +32,29 @@ public class NotificationStyle extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Button button = new Button("Show notification", + Button button = new Button("Show notification with h1", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { Notification notification = new Notification( "<p>Caption</p>", - "<div style='display:inline-block;'><h1>Description</h1></div>"); + "<div style='display:inline-block;'><h1>Description</h1>" + + "<p class='tested-p'>tested p</p></div>"); + notification.setHtmlContentAllowed(true); + notification.setDelayMsec(50000); + notification.show(getPage()); + } + }); + addComponent(button); + button = new Button("Show notification with p", + new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + Notification notification = new Notification( + "<p>Caption</p>", + "Description text<p class='tested-p'>tested p text</p>"); notification.setHtmlContentAllowed(true); notification.setDelayMsec(50000); notification.show(getPage()); diff --git a/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java b/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java index 829ad27a94..b2db29443a 100644 --- a/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java +++ b/uitest/src/com/vaadin/tests/themes/valo/NotificationStyleTest.java @@ -57,19 +57,20 @@ public class NotificationStyleTest extends MultiBrowserTest { public void testNotificationPStyle() { openTestURL(); - $(ButtonElement.class).first().click(); + $(ButtonElement.class).get(1).click(); new Actions(getDriver()).moveByOffset(10, 10).perform(); waitUntil(notificationPresentCondition(), 2); WebElement notification = findElement(By.className("v-Notification")); - List<WebElement> headers = notification.findElements(By.tagName("p")); - String lineHeight = headers.get(0).getCssValue("line-height"); - String lineHeightInnerHeader = headers.get(1) - .getCssValue("line-height"); + WebElement description = notification.findElement(By + .className("v-Notification-description")); + String display = description.getCssValue("display"); + String displayP2 = notification.findElement( + By.className("tested-p")).getCssValue("display"); Assert.assertNotEquals("Styles for notification defined 'p' tag " - + "and custom HTML tag are the same", lineHeight, - lineHeightInnerHeader); + + "and custom HTML tag are the same", display, + displayP2); } private ExpectedCondition<Boolean> notificationPresentCondition() { |