]> source.dussan.org Git - vaadin-framework.git/commitdiff
Convert old theme test to new MultiBrowserThemeTest
authorArtur Signell <artur@vaadin.com>
Thu, 3 Sep 2015 07:53:56 +0000 (10:53 +0300)
committerArtur Signell <artur@vaadin.com>
Thu, 3 Sep 2015 15:42:12 +0000 (18:42 +0300)
Change-Id: Ia99fc3d9474d7cd63402b01e3784ffea7f05a760

uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java [deleted file]
uitest/src/com/vaadin/tests/components/uitest/ChameleonThemeTest.java [deleted file]
uitest/src/com/vaadin/tests/components/uitest/LiferayThemeTest.java [deleted file]
uitest/src/com/vaadin/tests/components/uitest/ReindeerThemeTest.java [deleted file]
uitest/src/com/vaadin/tests/components/uitest/RunoThemeTest.java [deleted file]
uitest/src/com/vaadin/tests/components/uitest/ThemeTest.java
uitest/src/com/vaadin/tests/tb3/MultiBrowserThemeTest.java

diff --git a/uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java
deleted file mode 100644 (file)
index 6a7174b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.uitest;
-
-public class BaseThemeTest extends ThemeTest {
-    @Override
-    protected String getTheme() {
-        return "base";
-    }
-}
diff --git a/uitest/src/com/vaadin/tests/components/uitest/ChameleonThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/ChameleonThemeTest.java
deleted file mode 100644 (file)
index 8c4349a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.uitest;
-
-import java.io.IOException;
-
-public class ChameleonThemeTest extends ThemeTest {
-    @Override
-    protected String getTheme() {
-        return "chameleon";
-    }
-
-    @Override
-    protected void testWindows() throws IOException {
-        super.testWindows();
-
-        // chameleon theme only
-        testWindow(4, "subwindow-opaque");
-    }
-}
diff --git a/uitest/src/com/vaadin/tests/components/uitest/LiferayThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/LiferayThemeTest.java
deleted file mode 100644 (file)
index 47c4c1b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.uitest;
-
-public class LiferayThemeTest extends ThemeTest {
-    @Override
-    protected String getTheme() {
-        return "liferay";
-    }
-}
diff --git a/uitest/src/com/vaadin/tests/components/uitest/ReindeerThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/ReindeerThemeTest.java
deleted file mode 100644 (file)
index cdeb4b0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.uitest;
-
-import java.io.IOException;
-
-public class ReindeerThemeTest extends ThemeTest {
-    @Override
-    protected String getTheme() {
-        return "reindeer";
-    }
-
-    @Override
-    protected void testWindows() throws IOException {
-        super.testWindows();
-
-        // reindeer theme only
-        testWindow(1, "subwindow-light");
-        testWindow(2, "subwindow-black");
-    }
-}
diff --git a/uitest/src/com/vaadin/tests/components/uitest/RunoThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/RunoThemeTest.java
deleted file mode 100644 (file)
index 073ab27..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.uitest;
-
-import java.io.IOException;
-
-public class RunoThemeTest extends ThemeTest {
-    @Override
-    protected String getTheme() {
-        return "runo";
-    }
-
-    @Override
-    protected void testWindows() throws IOException {
-        super.testWindows();
-
-        // runo theme only
-        testWindow(3, "subwindow-dialog");
-    }
-}
index 86847fc28e3824ca3e7cd59f504f565868efe052..f6d680de878e00ced269ade64b393a5c85de6d58 100644 (file)
@@ -13,11 +13,11 @@ import com.vaadin.testbench.elements.ComboBoxElement;
 import com.vaadin.testbench.elements.TableElement;
 import com.vaadin.testbench.elementsbase.ServerClass;
 import com.vaadin.testbench.parallel.BrowserUtil;
-import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.tests.tb3.MultiBrowserThemeTest;
 import com.vaadin.tests.tb3.newelements.FixedNotificationElement;
 import com.vaadin.tests.tb3.newelements.WindowElement;
 
-public abstract class ThemeTest extends MultiBrowserTest {
+public class ThemeTest extends MultiBrowserThemeTest {
 
     @ServerClass("com.vaadin.ui.DateField")
     public static class DateFieldElement extends
@@ -51,15 +51,9 @@ public abstract class ThemeTest extends MultiBrowserTest {
         return ThemeTestUI.class;
     }
 
-    protected abstract String getTheme();
-
     @Test
     public void testTheme() throws Exception {
-        openTestURL("theme=" + getTheme());
-        runThemeTest();
-    }
-
-    private void runThemeTest() throws IOException {
+        openTestURL();
         TabSheetElement themeTabSheet = $(TabSheetElement.class).first();
 
         // Labels tab
@@ -161,12 +155,26 @@ public abstract class ThemeTest extends MultiBrowserTest {
     }
 
     private void testTables() throws IOException {
+
         compareScreen("tables");
-        TableElement table = $(TableElement.class).first();
-        new Actions(driver).moveToElement(table.getCell(0, 1), 5, 5)
-                .contextClick().perform();
-        compareScreen("tables-contextmenu");
-        table.findElement(By.className("v-table-column-selector")).click();
+        final TableElement table = $(TableElement.class).first();
+        if (!BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
+            // Context click does not work in phantom js
+            new Actions(driver).moveToElement(table.getCell(0, 1), 5, 5)
+                    .contextClick().perform();
+            compareScreen("tables-contextmenu");
+
+            // Close context menu before opening collapsemenu
+            // (https://dev.vaadin.com/ticket/18770)
+            WebElement cm = findElement(By.className("v-contextmenu"));
+            cm.findElement(By.xpath("//div[text()='Save']")).click();
+        }
+
+        WebElement columnSelector = table.findElement(By
+                .className("v-table-column-selector"));
+        new Actions(driver).moveToElement(columnSelector, 5, 5).click()
+                .perform();
+
         compareScreen("tables-collapsemenu");
     }
 
index 9a02b29bc24bcea9542879416626aef7d0faf48e..bab4c3e80a28bf8e59798a8b08365d5f165fe30b 100644 (file)
@@ -39,6 +39,10 @@ public abstract class MultiBrowserThemeTest extends MultiBrowserTest {
         this.theme = theme;
     }
 
+    protected String getTheme() {
+        return theme;
+    }
+
     @Parameters
     public static Collection<String> getThemes() {
         return Arrays.asList(new String[] { "valo", "reindeer", "runo",