summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2015-07-01 17:15:07 +0300
committerHenri Sara <hesara@vaadin.com>2015-07-01 17:15:46 +0300
commit9b036cd88b9911505c7cd6d452c2a3257ae7fe9c (patch)
tree8edce6a80d303f868c2702b719c8228577c84cac
parent5460f5ec736f479795d3301acb73d62040c99311 (diff)
parentbab0975e1288af9079780a030c439b0c2be832ac (diff)
downloadvaadin-framework-9b036cd88b9911505c7cd6d452c2a3257ae7fe9c.tar.gz
vaadin-framework-9b036cd88b9911505c7cd6d452c2a3257ae7fe9c.zip
Merge branch 'master' into grid-unbuffered-editor7.6.0.alpha2
Change-Id: I00e60554b57bb57864ea613fffda2b7882628ce2
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.java46
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInputTest.java61
-rw-r--r--uitest/src/com/vaadin/tests/components/media/AudioTest.java4
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1710.java12
-rw-r--r--uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.html75
5 files changed, 119 insertions, 79 deletions
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.java
new file mode 100644
index 0000000000..6b0e42666f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.java
@@ -0,0 +1,46 @@
+/*
+ * 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.combobox;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.CheckBox;
+
+public class ComboBoxNoTextInput extends ComboBoxSelecting {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ super.setup(request);
+ comboBox.setTextInputAllowed(true);
+
+ final CheckBox textInputCheckBox = new CheckBox("Text Input", true);
+ textInputCheckBox.setId("textInput");
+ textInputCheckBox.addValueChangeListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ comboBox.setTextInputAllowed(textInputCheckBox.getValue());
+ }
+ });
+ addComponent(textInputCheckBox);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "ComboBox should open popup on click when text input is not allowed.";
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInputTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInputTest.java
new file mode 100644
index 0000000000..cb4cd54559
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxNoTextInputTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.combobox;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.By;
+import com.vaadin.testbench.commands.TestBenchElementCommands;
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.ComboBoxElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class ComboBoxNoTextInputTest extends MultiBrowserTest {
+
+ @Test
+ public void testComboBoxNoTextInputPopupOpensOnClick() throws Exception {
+ openTestURL();
+
+ // deactivate text input
+ click($(CheckBoxElement.class).id("textInput"));
+
+ // click and check that popup appears
+ ComboBoxElement cb = $(ComboBoxElement.class).first();
+ click(cb);
+ // popup is opened lazily
+ waitForElementPresent(By.vaadin("//com.vaadin.ui.ComboBox[0]#popup"));
+ }
+
+ @Test
+ public void testComboBoxWithTextInputNoPopupOpensOnClick() throws Exception {
+ openTestURL();
+
+ // click and check that no popup appears
+ ComboBoxElement cb = $(ComboBoxElement.class).first();
+ click(cb);
+ // popup is opened lazily
+ sleep(1000);
+ Assert.assertFalse(cb.isElementPresent(By.vaadin("#popup")));
+ }
+
+ private void click(ComboBoxElement cb) throws Exception {
+ WebElement element = cb.findElement(By.vaadin("#textbox"));
+ ((TestBenchElementCommands) element).click(8, 7);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/media/AudioTest.java b/uitest/src/com/vaadin/tests/components/media/AudioTest.java
index c77583096d..1e1e26346c 100644
--- a/uitest/src/com/vaadin/tests/components/media/AudioTest.java
+++ b/uitest/src/com/vaadin/tests/components/media/AudioTest.java
@@ -50,15 +50,19 @@ public class AudioTest extends TestBase {
CheckBox checkBox = new CheckBox("Show controls",
new MethodProperty<Boolean>(audio, "showControls"));
+ checkBox.setImmediate(true);
addComponent(checkBox);
checkBox = new CheckBox("HtmlContentAllowed",
new MethodProperty<Boolean>(audio, "htmlContentAllowed"));
+ checkBox.setImmediate(true);
addComponent(checkBox);
checkBox = new CheckBox("muted", new MethodProperty<Boolean>(audio,
"muted"));
+ checkBox.setImmediate(true);
addComponent(checkBox);
checkBox = new CheckBox("autoplay", new MethodProperty<Boolean>(audio,
"autoplay"));
+ checkBox.setImmediate(true);
addComponent(checkBox);
Button b = new Button("Change", new Button.ClickListener() {
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1710.java b/uitest/src/com/vaadin/tests/tickets/Ticket1710.java
index e4687b6e37..3dda830607 100644
--- a/uitest/src/com/vaadin/tests/tickets/Ticket1710.java
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1710.java
@@ -270,13 +270,17 @@ public class Ticket1710 extends com.vaadin.server.LegacyApplication {
controls.addComponent(new Label("width"));
controls.addComponent(new TextField(new MethodProperty<Float>(
testedLayout, "width")));
- controls.addComponent(new CheckBox("%",
- new MethodProperty<Boolean>(this, "widthPercents")));
+ CheckBox widthPercentsCheckBox = new CheckBox("%",
+ new MethodProperty<Boolean>(this, "widthPercents"));
+ widthPercentsCheckBox.setImmediate(true);
+ controls.addComponent(widthPercentsCheckBox);
controls.addComponent(new Label("height"));
controls.addComponent(new TextField(new MethodProperty<Float>(
testedLayout, "height")));
- controls.addComponent(new CheckBox("%",
- new MethodProperty<Boolean>(this, "heightPercents")));
+ CheckBox heightPercentsCheckBox = new CheckBox("%",
+ new MethodProperty<Boolean>(this, "heightPercents"));
+ heightPercentsCheckBox.setImmediate(true);
+ controls.addComponent(heightPercentsCheckBox);
controls.addComponent(marginLeft);
controls.addComponent(marginRight);
controls.addComponent(marginTop);
diff --git a/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.html b/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.html
deleted file mode 100644
index 2066da47c1..0000000000
--- a/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxNoTextInput.html
+++ /dev/null
@@ -1,75 +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:8080/" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.combobox.ComboBoxes2?restartApplication</td>
- <td></td>
-</tr>
-<!--Disabled text input-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_Smenu#item0</td>
- <td>34,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VOverlay[0]/VMenuBar[0]#item0</td>
- <td>21,3</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VOverlay[1]/VMenuBar[0]#item8</td>
- <td>52,7</td>
-</tr>
-<!--Check that clicking the text field opens the popup-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td>
- <td>37,8</td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item0</td>
- <td></td>
-</tr>
-<!--Enabled text input again-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_Smenu#item0</td>
- <td>35,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VOverlay[0]/VMenuBar[0]#item0</td>
- <td>14,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VOverlay[1]/VMenuBar[0]#item8</td>
- <td>34,6</td>
-</tr>
-<!--Check that clicking the text field does not open the popup-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td>
- <td>42,9</td>
-</tr>
-<tr>
- <td>assertElementNotPresent</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item0</td>
- <td></td>
-</tr>
-</tbody></table>
-</body>
-</html>