+++ /dev/null
-package com.vaadin.tests.components.nativeselect;
-
-import com.vaadin.server.VaadinRequest;
-import com.vaadin.tests.components.AbstractTestUIWithLog;
-import com.vaadin.v7.data.Property.ValueChangeEvent;
-import com.vaadin.v7.data.Property.ValueChangeListener;
-import com.vaadin.v7.ui.NativeSelect;
-
-public class NativeSelectNull extends AbstractTestUIWithLog {
- @Override
- protected void setup(VaadinRequest request) {
- NativeSelect nativeSelect = new NativeSelect();
- nativeSelect.addItem("Item");
- nativeSelect.addValueChangeListener(new ValueChangeListener() {
-
- @Override
- public void valueChange(ValueChangeEvent event) {
- log("Value: " + event.getProperty().getValue());
-
- }
- });
- addComponent(nativeSelect);
- }
-
-}
+++ /dev/null
-package com.vaadin.tests.components.nativeselect;
-
-import com.vaadin.tests.components.select.AbstractSelectTestCase;
-import com.vaadin.v7.ui.NativeSelect;
-
-public class NativeSelects extends AbstractSelectTestCase<NativeSelect> {
-
- @Override
- protected Class<NativeSelect> getTestClass() {
- return NativeSelect.class;
- }
-
- @Override
- protected void createActions() {
- super.createActions();
- }
-
-}
--- /dev/null
+package com.vaadin.v7.tests.components.nativeselect;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.v7.data.Property.ValueChangeEvent;
+import com.vaadin.v7.data.Property.ValueChangeListener;
+import com.vaadin.v7.ui.NativeSelect;
+
+public class NativeSelectNull extends AbstractTestUIWithLog {
+ @Override
+ protected void setup(VaadinRequest request) {
+ NativeSelect nativeSelect = new NativeSelect();
+ nativeSelect.addItem("Item");
+ nativeSelect.addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ log("Value: " + event.getProperty().getValue());
+
+ }
+ });
+ addComponent(nativeSelect);
+ }
+
+}
--- /dev/null
+package com.vaadin.v7.tests.components.nativeselect;
+
+import com.vaadin.tests.components.select.AbstractSelectTestCase;
+import com.vaadin.v7.ui.NativeSelect;
+
+public class NativeSelects extends AbstractSelectTestCase<NativeSelect> {
+
+ @Override
+ protected Class<NativeSelect> getTestClass() {
+ return NativeSelect.class;
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+ }
+
+}
+++ /dev/null
-package com.vaadin.tests.components.nativeselect;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2;
-import com.vaadin.v7.testbench.customelements.NativeSelectElement;
-
-public class NativeSelectNullTest extends SingleBrowserTestPhantomJS2 {
- @Test
- public void selectNull() {
- openTestURL();
- NativeSelectElement select = $(NativeSelectElement.class).first();
- select.selectByText("Item");
- Assert.assertEquals("1. Value: Item", getLogRow(0));
- select.selectByText("");
- Assert.assertEquals("2. Value: null", getLogRow(0));
- }
-}
+++ /dev/null
-/*
- * Copyright 2000-2016 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.nativeselect;
-
-import java.util.List;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.Keys;
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.remote.DesiredCapabilities;
-
-import com.vaadin.testbench.parallel.Browser;
-import com.vaadin.tests.tb3.MultiBrowserTest;
-
-public class NativeSelectsAndChromeKeyboardNavigationTest
- extends MultiBrowserTest {
-
- @Override
- public List<DesiredCapabilities> getBrowsersToTest() {
- return getBrowserCapabilities(Browser.CHROME);
- }
-
- @Test
- public void testValueChangeListenerWithKeyboardNavigation()
- throws InterruptedException {
- setDebug(true);
- openTestURL();
- Thread.sleep(1000);
- menu("Component");
- menuSub("Listeners");
- menuSub("Value change listener");
-
- getDriver().findElement(By.tagName("body")).click();
-
- WebElement select = getDriver().findElement(By.tagName("select"));
- select.sendKeys(Keys.ARROW_DOWN);
- select.sendKeys(Keys.ARROW_DOWN);
- select.sendKeys(Keys.ARROW_DOWN);
-
- String bodytext = getDriver().findElement(By.tagName("body")).getText();
-
- Assert.assertTrue(bodytext.contains("new value: 'Item 1'"));
- Assert.assertTrue(bodytext.contains("new value: 'Item 2'"));
- Assert.assertTrue(bodytext.contains("new value: 'Item 3'"));
-
- }
-
- @Override
- protected Class<?> getUIClass() {
- return NativeSelects.class;
- }
-
- private void menuSub(String string) {
- getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
- .click();
- new Actions(getDriver()).moveByOffset(100, 0).build().perform();
- }
-
- private void menu(String string) {
- getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
- .click();
-
- }
-
-}
+++ /dev/null
-/*
- * Copyright 2000-2016 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.nativeselect;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.openqa.selenium.By;
-import org.openqa.selenium.interactions.Actions;
-
-import com.vaadin.testbench.parallel.BrowserUtil;
-import com.vaadin.tests.tb3.MultiBrowserTest;
-import com.vaadin.v7.testbench.customelements.NativeSelectElement;
-
-public class NativeSelectsFocusAndBlurListenerTests extends MultiBrowserTest {
-
- @Test
- public void testFocusAndBlurListener() throws InterruptedException {
- setDebug(true);
- openTestURL();
- Thread.sleep(200);
- menu("Component");
- menuSub("Listeners");
- menuSub("Focus listener");
- menu("Component");
- menuSub("Listeners");
- menuSub("Blur listener");
-
- findElement(By.tagName("body")).click();
-
- NativeSelectElement s = $(NativeSelectElement.class).first();
- s.selectByText("Item 3");
- getDriver().findElement(By.tagName("body")).click();
-
- // Somehow selectByText causes focus + blur + focus + blur on
- // Chrome/PhantomJS
- if (BrowserUtil.isChrome(getDesiredCapabilities())
- || BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
- Assert.assertEquals("4. FocusEvent", getLogRow(1));
- Assert.assertEquals("5. BlurEvent", getLogRow(0));
- } else {
- Assert.assertEquals("2. FocusEvent", getLogRow(1));
- Assert.assertEquals("3. BlurEvent", getLogRow(0));
- }
-
- }
-
- @Override
- protected Class<?> getUIClass() {
- return NativeSelects.class;
- }
-
- private void menuSub(String string) {
- getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
- .click();
- new Actions(getDriver()).moveByOffset(100, 0).build().perform();
- }
-
- private void menu(String string) {
- getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
- .click();
-
- }
-
-}
--- /dev/null
+package com.vaadin.v7.tests.components.nativeselect;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.tests.tb3.SingleBrowserTestPhantomJS2;
+import com.vaadin.v7.testbench.customelements.NativeSelectElement;
+
+public class NativeSelectNullTest extends SingleBrowserTestPhantomJS2 {
+ @Test
+ public void selectNull() {
+ openTestURL();
+ NativeSelectElement select = $(NativeSelectElement.class).first();
+ select.selectByText("Item");
+ Assert.assertEquals("1. Value: Item", getLogRow(0));
+ select.selectByText("");
+ Assert.assertEquals("2. Value: null", getLogRow(0));
+ }
+}
--- /dev/null
+/*
+ * Copyright 2000-2016 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.v7.tests.components.nativeselect;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.testbench.parallel.Browser;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.v7.tests.components.nativeselect.NativeSelects;
+
+public class NativeSelectsAndChromeKeyboardNavigationTest
+ extends MultiBrowserTest {
+
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ return getBrowserCapabilities(Browser.CHROME);
+ }
+
+ @Test
+ public void testValueChangeListenerWithKeyboardNavigation()
+ throws InterruptedException {
+ setDebug(true);
+ openTestURL();
+ Thread.sleep(1000);
+ menu("Component");
+ menuSub("Listeners");
+ menuSub("Value change listener");
+
+ getDriver().findElement(By.tagName("body")).click();
+
+ WebElement select = getDriver().findElement(By.tagName("select"));
+ select.sendKeys(Keys.ARROW_DOWN);
+ select.sendKeys(Keys.ARROW_DOWN);
+ select.sendKeys(Keys.ARROW_DOWN);
+
+ String bodytext = getDriver().findElement(By.tagName("body")).getText();
+
+ Assert.assertTrue(bodytext.contains("new value: 'Item 1'"));
+ Assert.assertTrue(bodytext.contains("new value: 'Item 2'"));
+ Assert.assertTrue(bodytext.contains("new value: 'Item 3'"));
+
+ }
+
+ @Override
+ protected Class<?> getUIClass() {
+ return NativeSelects.class;
+ }
+
+ private void menuSub(String string) {
+ getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
+ .click();
+ new Actions(getDriver()).moveByOffset(100, 0).build().perform();
+ }
+
+ private void menu(String string) {
+ getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
+ .click();
+
+ }
+
+}
--- /dev/null
+/*
+ * Copyright 2000-2016 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.v7.tests.components.nativeselect;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.parallel.BrowserUtil;
+import com.vaadin.tests.components.nativeselect.NativeSelects;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.v7.testbench.customelements.NativeSelectElement;
+
+public class NativeSelectsFocusAndBlurListenerTests extends MultiBrowserTest {
+
+ @Test
+ public void testFocusAndBlurListener() throws InterruptedException {
+ setDebug(true);
+ openTestURL();
+ Thread.sleep(200);
+ menu("Component");
+ menuSub("Listeners");
+ menuSub("Focus listener");
+ menu("Component");
+ menuSub("Listeners");
+ menuSub("Blur listener");
+
+ findElement(By.tagName("body")).click();
+
+ NativeSelectElement s = $(NativeSelectElement.class).first();
+ s.selectByText("Item 3");
+ getDriver().findElement(By.tagName("body")).click();
+
+ // Somehow selectByText causes focus + blur + focus + blur on
+ // Chrome/PhantomJS
+ if (BrowserUtil.isChrome(getDesiredCapabilities())
+ || BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+ Assert.assertEquals("4. FocusEvent", getLogRow(1));
+ Assert.assertEquals("5. BlurEvent", getLogRow(0));
+ } else {
+ Assert.assertEquals("2. FocusEvent", getLogRow(1));
+ Assert.assertEquals("3. BlurEvent", getLogRow(0));
+ }
+
+ }
+
+ @Override
+ protected Class<?> getUIClass() {
+ return NativeSelects.class;
+ }
+
+ private void menuSub(String string) {
+ getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
+ .click();
+ new Actions(getDriver()).moveByOffset(100, 0).build().perform();
+ }
+
+ private void menu(String string) {
+ getDriver().findElement(By.xpath("//span[text() = '" + string + "']"))
+ .click();
+
+ }
+
+}