From: Sauli Tähkäpää Date: Mon, 26 May 2014 13:06:06 +0000 (+0300) Subject: Convert DateFieldReadOnlyTest TB2 -> TB4. X-Git-Tag: 7.2.1~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=24b3b39af83c5f19b018370056bac399c5265506;p=vaadin-framework.git Convert DateFieldReadOnlyTest TB2 -> TB4. Change-Id: Iab81b1e5992d47c956f9d0440ece98fa546ee927 --- diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html b/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html deleted file mode 100644 index ee19b52324..0000000000 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - -DateFieldReadOnly - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateFieldReadOnly
open/run/com.vaadin.tests.components.datefield.DateFieldReadOnly?restartApplication
focusvaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]
screenCapturereadonly
clickvaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]/domChild[1]
focusvaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::Root/VOverlay[0]/VCalendarPanel[0]/VCalendarPanel$VTime[0]/ListBox[0]
screenCapturereadwrite-popup
mouseClickvaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
focusvaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]
screenCapturereadonly
- - diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java new file mode 100644 index 0000000000..96e17344ec --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java @@ -0,0 +1,43 @@ +package com.vaadin.tests.components.datefield; + + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.DateFieldElement; +import com.vaadin.tests.tb3.AbstractTB3Test; +import com.vaadin.tests.tb3.MultiBrowserTest; +import org.junit.Test; +import org.openqa.selenium.Keys; + +import java.io.IOException; + +public class DateFieldReadOnlyTest extends MultiBrowserTest { + + @Test + public void readOnlyDateFieldPopupShouldNotOpen() throws IOException, InterruptedException { + openTestURL(); + + compareScreen("readonly"); + toggleReadOnly(); + + openPopup(); + compareScreen("readwrite-popup"); + + closePopup(); + toggleReadOnly(); + compareScreen("readonly"); + } + + private void closePopup() { + findElement(By.className("v-datefield-calendarpanel")).sendKeys(Keys.RETURN); + } + + private void openPopup() { + //waiting for openPopup() in TB4 beta1: http://dev.vaadin.com/ticket/13766 + $(DateFieldElement.class).first().findElement(By.tagName("button")).click(); + } + + private void toggleReadOnly() { + $(ButtonElement.class).caption("Switch read-only").first().click(); + } +}