summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti@vaadin.com>2013-11-14 12:17:04 +0200
committerMatti Tahvonen <matti@vaadin.com>2013-11-14 12:17:04 +0200
commite05e10eccf1886c1621421d584615a278dd44d62 (patch)
tree478ac81da6216a7edb98b79ba108dd1ba79b3419
parent07b1a9d75a139e6ee30e35b13bd4f8108c0350b3 (diff)
downloadvaadin-framework-e05e10eccf1886c1621421d584615a278dd44d62.tar.gz
vaadin-framework-e05e10eccf1886c1621421d584615a278dd44d62.zip
Added extra asserts to make test more safer to blind refactorings
Change-Id: I5dd159640bdc4f188c291017032ca96ca8b85d11
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java15
1 files 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();
}