From e05e10eccf1886c1621421d584615a278dd44d62 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Thu, 14 Nov 2013 12:17:04 +0200 Subject: [PATCH] Added extra asserts to make test more safer to blind refactorings Change-Id: I5dd159640bdc4f188c291017032ca96ca8b85d11 --- .../components/datefield/DateFieldTestTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java index 557201e803..123fd167d0 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java @@ -35,9 +35,14 @@ public class DateFieldTestTest extends MultiBrowserTest { menu("Component"); menuSub("State"); menu("Required"); + assertRequiredIndicatorVisible(); assertNoErrorNotification(); } + private void assertRequiredIndicatorVisible() { + getDriver().findElement(By.className("v-required-field-indicator")); + } + private void assertNoErrorNotification() { try { getDriver().findElement( @@ -58,6 +63,8 @@ public class DateFieldTestTest extends MultiBrowserTest { menuSub("State"); menu("Required"); + assertRequiredIndicatorVisible(); + menu("Component"); menuSub("Features"); menuSub("Resolution"); @@ -100,8 +107,8 @@ public class DateFieldTestTest extends MultiBrowserTest { * @param string */ private void menuSub(String string) { - getDriver().findElement( - By.xpath("//span[text() = '" + string + "']")).click(); + getDriver().findElement(By.xpath("//span[text() = '" + string + "']")) + .click(); new Actions(getDriver()).moveByOffset(100, 0).build().perform(); } @@ -110,8 +117,8 @@ public class DateFieldTestTest extends MultiBrowserTest { * @param string */ private void menu(String string) { - getDriver().findElement( - By.xpath("//span[text() = '" + string + "']")).click(); + getDriver().findElement(By.xpath("//span[text() = '" + string + "']")) + .click(); } -- 2.39.5