summaryrefslogtreecommitdiffstats
path: root/uitest/src
diff options
context:
space:
mode:
authorAnna Miroshnik <anna.miroshnik@arcadia.spb.ru>2014-10-24 20:07:36 +0400
committerVaadin Code Review <review@vaadin.com>2014-11-10 08:39:00 +0000
commit457e802e2fe59ec35089a55acdc7b0321a2d4a5a (patch)
treec819e335c9564fb72f270f2f1552c206fbf166f2 /uitest/src
parent6d1b5a7121d4029cc237e6effaa54e5478443e34 (diff)
downloadvaadin-framework-457e802e2fe59ec35089a55acdc7b0321a2d4a5a.tar.gz
vaadin-framework-457e802e2fe59ec35089a55acdc7b0321a2d4a5a.zip
DateField popup doesn't close when click on popup button (#14857)
Fix and tests. Change-Id: I99d92c32727323fae543a24dfb90e849c3338a8c
Diffstat (limited to 'uitest/src')
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosing.java43
-rw-r--r--uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosingTest.java42
2 files changed, 85 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosing.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosing.java
new file mode 100644
index 0000000000..60508a30d4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosing.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 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;
+
+public class DateFieldPopupClosing extends AbstractTestUI {
+
+ static final String DATEFIELD_ID = "datefield";
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final DateField df = new DateField();
+ df.setId(DATEFIELD_ID);
+ addComponent(df);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "DateField popup should be closed when click on popup button";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 14857;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosingTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosingTest.java
new file mode 100644
index 0000000000..ecbd6dd667
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldPopupClosingTest.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.components.datefield;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+
+import com.vaadin.testbench.elements.DateFieldElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class DateFieldPopupClosingTest extends MultiBrowserTest {
+ /*
+ * try to open/close many times (not one time) because this defect is
+ * reproduced randomly (depends on timer)
+ */
+ private static final int N = 100;
+
+ @Test
+ public void testDateFieldPopupClosing() throws InterruptedException,
+ IOException {
+ openTestURL();
+
+ for (int i = 0; i < N; i++) {
+ clickDateDatePickerButton();
+
+ waitUntil(ExpectedConditions.visibilityOfElementLocated(By
+ .className("v-datefield-popup")));
+
+ clickDateDatePickerButton();
+
+ waitUntil(ExpectedConditions.invisibilityOfElementLocated(By
+ .className("v-datefield-popup")));
+ }
+ }
+
+ private void clickDateDatePickerButton() {
+ DateFieldElement dateField = $(DateFieldElement.class).first();
+ dateField.findElement(By.tagName("button")).click();
+ }
+
+} \ No newline at end of file