]> source.dussan.org Git - vaadin-framework.git/commitdiff
Move old NativeSelect UI tests to compatibility package
authorJohannes Dahlström <johannesd@vaadin.com>
Thu, 8 Sep 2016 19:10:31 +0000 (22:10 +0300)
committerIlia Motornyi <elmot@vaadin.com>
Mon, 12 Sep 2016 08:58:42 +0000 (08:58 +0000)
Change-Id: I7d426de488747ce323e732f7ad45d30712fc6d61

uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java [deleted file]
uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelects.java [deleted file]
uitest/src/main/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectNull.java [new file with mode: 0644]
uitest/src/main/java/com/vaadin/v7/tests/components/nativeselect/NativeSelects.java [new file with mode: 0644]
uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java [deleted file]
uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java [deleted file]
uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectsFocusAndBlurListenerTests.java [deleted file]
uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectNullTest.java [new file with mode: 0644]
uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java [new file with mode: 0644]
uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectsFocusAndBlurListenerTests.java [new file with mode: 0644]

diff --git a/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java b/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelectNull.java
deleted file mode 100644 (file)
index 62b6c54..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-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);
-    }
-
-}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelects.java b/uitest/src/main/java/com/vaadin/tests/components/nativeselect/NativeSelects.java
deleted file mode 100644 (file)
index 74c1d7c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-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();
-    }
-
-}
diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectNull.java b/uitest/src/main/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectNull.java
new file mode 100644 (file)
index 0000000..ca49170
--- /dev/null
@@ -0,0 +1,25 @@
+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);
+    }
+
+}
diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/nativeselect/NativeSelects.java b/uitest/src/main/java/com/vaadin/v7/tests/components/nativeselect/NativeSelects.java
new file mode 100644 (file)
index 0000000..bb84e88
--- /dev/null
@@ -0,0 +1,18 @@
+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();
+    }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectNullTest.java
deleted file mode 100644 (file)
index 7a687cb..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-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));
-    }
-}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java
deleted file mode 100644 (file)
index d3bece6..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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();
-
-    }
-
-}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectsFocusAndBlurListenerTests.java b/uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectsFocusAndBlurListenerTests.java
deleted file mode 100644 (file)
index cd45f55..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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();
-
-    }
-
-}
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectNullTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectNullTest.java
new file mode 100644 (file)
index 0000000..cb33b9e
--- /dev/null
@@ -0,0 +1,19 @@
+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));
+    }
+}
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java b/uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java
new file mode 100644 (file)
index 0000000..ce85f7a
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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();
+
+    }
+
+}
diff --git a/uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectsFocusAndBlurListenerTests.java b/uitest/src/test/java/com/vaadin/v7/tests/components/nativeselect/NativeSelectsFocusAndBlurListenerTests.java
new file mode 100644 (file)
index 0000000..d0d9bcb
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * 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();
+
+    }
+
+}