aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/datefield
diff options
context:
space:
mode:
authorMikael Grankvist <mgrankvi@vaadin.com>2014-09-04 15:01:20 +0300
committerVaadin Code Review <review@vaadin.com>2014-09-05 06:57:39 +0000
commite38a4c3e21f3fcefe658216f769dd7b0c6c36383 (patch)
treecc03684668dca5ada1bfb451447d30f34974a284 /uitest/src/com/vaadin/tests/components/datefield
parent51bd03c8295c974344775d9d5cc1914ed68a3290 (diff)
downloadvaadin-framework-e38a4c3e21f3fcefe658216f769dd7b0c6c36383.tar.gz
vaadin-framework-e38a4c3e21f3fcefe658216f769dd7b0c6c36383.zip
Override IE disabled style for text field (#14565)
Change-Id: Ie48e56666c43450c47015067879fdc604c7ac843
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/datefield')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStates.java57
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStatesTest.java19
2 files changed, 76 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStates.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStates.java
new file mode 100644
index 0000000000..aae4a213c6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStates.java
@@ -0,0 +1,57 @@
+package com.vaadin.tests.components.datefield;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.PopupDateField;
+
+@SuppressWarnings("serial")
+public class PopupDateFieldStates extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final GridLayout gridLayout = new GridLayout(2, 2);
+ gridLayout.setSpacing(true);
+
+ gridLayout.addComponent(createPopupDateField(true, true));
+ gridLayout.addComponent(createPopupDateField(true, false));
+ gridLayout.addComponent(createPopupDateField(false, true));
+ gridLayout.addComponent(createPopupDateField(false, false));
+
+ getLayout().addComponent(gridLayout);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Test that PopupDateField is rendered consistently across browsers";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 14565;
+ }
+
+ private static PopupDateField createPopupDateField(final boolean enabled,
+ final boolean textFieldEnabled) {
+ final PopupDateField popupDatefield = new PopupDateField();
+
+ Calendar cal = GregorianCalendar.getInstance();
+ cal.set(Calendar.DATE, 3);
+ cal.set(Calendar.MONTH, Calendar.SEPTEMBER);
+ cal.set(Calendar.YEAR, 2014);
+ cal.set(Calendar.HOUR_OF_DAY, 8);
+ final Date currentDate = cal.getTime();
+
+ popupDatefield.setValue(currentDate);
+ popupDatefield.setCaption("Enabled: " + enabled
+ + ", Text field enabled: " + textFieldEnabled);
+ popupDatefield.setEnabled(enabled);
+ popupDatefield.setTextFieldEnabled(textFieldEnabled);
+ return popupDatefield;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStatesTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStatesTest.java
new file mode 100644
index 0000000000..8c5ba20ecc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldStatesTest.java
@@ -0,0 +1,19 @@
+package com.vaadin.tests.components.datefield;
+
+import java.io.IOException;
+
+import org.junit.Test;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class PopupDateFieldStatesTest extends MultiBrowserTest {
+
+ @Test
+ public void readOnlyDateFieldPopupShouldNotOpen() throws IOException,
+ InterruptedException {
+ openTestURL();
+
+ compareScreen("dateFieldStates");
+ }
+
+}