aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorBuild Agent <build@vaadin.com>2014-03-31 22:24:10 +0300
committerBuild Agent <build@vaadin.com>2014-03-31 22:24:10 +0300
commit9422946a4009f19ebb04c83c94bae023551a8db3 (patch)
treec842c76193ca18c1ebd2b2f99fb5debcdd384532 /uitest
parent42789ab0836451aea7bc1964e0572178ef0f8ded (diff)
parentd0bc54ba4b487fe461cc950de02ec57187c654ad (diff)
downloadvaadin-framework-9422946a4009f19ebb04c83c94bae023551a8db3.tar.gz
vaadin-framework-9422946a4009f19ebb04c83c94bae023551a8db3.zip
Merge changes from origin/7.1
d0bc54b Prevent popup open when datafield is disabled (#13508). Change-Id: I3f15fa2d0774dfa0c91312d79822be94afcb0d34
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java46
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java52
2 files changed, 98 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java
new file mode 100644
index 0000000000..c48d2383a7
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.datefield;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.DateField;
+
+/**
+ *
+ * @since 7.1
+ * @author Vaadin Ltd
+ */
+public class DisabledDateFieldPopup extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ DateField field = new DateField();
+ field.setEnabled(false);
+ addComponent(field);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Don't open popup calendar if datefield is disabled";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 13508;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java
new file mode 100644
index 0000000000..dc287c19da
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.datefield;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ *
+ * @since 7.1
+ * @author Vaadin Ltd
+ */
+public class DisabledDateFieldPopupTest extends MultiBrowserTest {
+
+ @Test
+ public void testPopup() {
+ openTestURL();
+
+ WebElement button = driver.findElement(By
+ .className("v-datefield-button"));
+ button.click();
+
+ Assert.assertFalse(
+ "Calendar popup should not be opened for disabled date field on mouse click",
+ isElementPresent(By.className("v-datefield-popup")));
+
+ button.sendKeys(Keys.ARROW_DOWN);
+
+ Assert.assertFalse("Calendar popup should not be opened for "
+ + "disabled date fild on down key",
+ isElementPresent(By.className("v-datefield-popup")));
+
+ }
+}