diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2014-05-26 16:06:06 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-27 07:31:44 +0000 |
commit | 6a1d111b7151c787ba4b3fc960bc85ba4e5ed98c (patch) | |
tree | 942384f6283076b9cb40556b98b2fc101d07e2bb | |
parent | 930fd30a937ef69ba45e501bdee78773bad5523f (diff) | |
download | vaadin-framework-6a1d111b7151c787ba4b3fc960bc85ba4e5ed98c.tar.gz vaadin-framework-6a1d111b7151c787ba4b3fc960bc85ba4e5ed98c.zip |
Convert DateFieldReadOnlyTest TB2 -> TB4.
Change-Id: Iab81b1e5992d47c956f9d0440ece98fa546ee927
-rw-r--r-- | uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html | 66 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java | 43 |
2 files changed, 43 insertions, 66 deletions
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 @@ -<?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="http://localhost:8888/" /> -<title>DateFieldReadOnly</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">DateFieldReadOnly</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.datefield.DateFieldReadOnly?restartApplication</td> - <td></td> -</tr> -<tr> - <td>focus</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>readonly</td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]/domChild[1]</td> - <td></td> -</tr> -<tr> - <td>focus</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::Root/VOverlay[0]/VCalendarPanel[0]/VCalendarPanel$VTime[0]/ListBox[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>readwrite-popup</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>focus</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>readonly</td> -</tr> -</tbody></table> -</body> -</html> 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(); + } +} |