diff options
author | Artur Signell <artur@vaadin.com> | 2015-09-04 22:10:50 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2015-09-04 22:11:29 +0300 |
commit | dcd482b4175bc48a1612caf9b0012d53e12a73d0 (patch) | |
tree | 0608864f2604b45da5b9aa08a4edd60bd384400f | |
parent | f46be1b2792755cb7d9b111068dd6cf202398c4a (diff) | |
download | vaadin-framework-dcd482b4175bc48a1612caf9b0012d53e12a73d0.tar.gz vaadin-framework-dcd482b4175bc48a1612caf9b0012d53e12a73d0.zip |
Revert "Convert old theme test to new MultiBrowserThemeTest"
Accidentally included, will be done separately later
This reverts commit 054cff009fa1cf46bef9492a657fc23cb396918b.
Change-Id: I63f88233edaaa4f7aeae8432f9ca25ab9b9c3e92
7 files changed, 160 insertions, 26 deletions
diff --git a/uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java new file mode 100644 index 0000000000..6a7174bf99 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java @@ -0,0 +1,23 @@ +/* + * 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 new file mode 100644 index 0000000000..8c4349ad5f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/uitest/ChameleonThemeTest.java @@ -0,0 +1,33 @@ +/* + * 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 new file mode 100644 index 0000000000..47c4c1baae --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/uitest/LiferayThemeTest.java @@ -0,0 +1,23 @@ +/* + * 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 new file mode 100644 index 0000000000..cdeb4b0606 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/uitest/ReindeerThemeTest.java @@ -0,0 +1,34 @@ +/* + * 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 new file mode 100644 index 0000000000..073ab27566 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/uitest/RunoThemeTest.java @@ -0,0 +1,33 @@ +/* + * 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"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/uitest/ThemeTest.java b/uitest/src/com/vaadin/tests/components/uitest/ThemeTest.java index f6d680de87..86847fc28e 100644 --- a/uitest/src/com/vaadin/tests/components/uitest/ThemeTest.java +++ b/uitest/src/com/vaadin/tests/components/uitest/ThemeTest.java @@ -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.MultiBrowserThemeTest; +import com.vaadin.tests.tb3.MultiBrowserTest; import com.vaadin.tests.tb3.newelements.FixedNotificationElement; import com.vaadin.tests.tb3.newelements.WindowElement; -public class ThemeTest extends MultiBrowserThemeTest { +public abstract class ThemeTest extends MultiBrowserTest { @ServerClass("com.vaadin.ui.DateField") public static class DateFieldElement extends @@ -51,9 +51,15 @@ public class ThemeTest extends MultiBrowserThemeTest { return ThemeTestUI.class; } + protected abstract String getTheme(); + @Test public void testTheme() throws Exception { - openTestURL(); + openTestURL("theme=" + getTheme()); + runThemeTest(); + } + + private void runThemeTest() throws IOException { TabSheetElement themeTabSheet = $(TabSheetElement.class).first(); // Labels tab @@ -155,26 +161,12 @@ public class ThemeTest extends MultiBrowserThemeTest { } private void testTables() throws IOException { - compareScreen("tables"); - 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(); - + 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(); compareScreen("tables-collapsemenu"); } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserThemeTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserThemeTest.java index bab4c3e80a..9a02b29bc2 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserThemeTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserThemeTest.java @@ -39,10 +39,6 @@ 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", |