Browse Source

Revert "Convert old theme test to new MultiBrowserThemeTest"

Accidentally included, will be done separately later

This reverts commit 054cff009f.

Change-Id: I63f88233edaaa4f7aeae8432f9ca25ab9b9c3e92
tags/7.6.0.alpha5
Artur Signell 8 years ago
parent
commit
dcd482b417

+ 23
- 0
uitest/src/com/vaadin/tests/components/uitest/BaseThemeTest.java View File

@@ -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";
}
}

+ 33
- 0
uitest/src/com/vaadin/tests/components/uitest/ChameleonThemeTest.java View File

@@ -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");
}
}

+ 23
- 0
uitest/src/com/vaadin/tests/components/uitest/LiferayThemeTest.java View File

@@ -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";
}
}

+ 34
- 0
uitest/src/com/vaadin/tests/components/uitest/ReindeerThemeTest.java View File

@@ -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");
}
}

+ 33
- 0
uitest/src/com/vaadin/tests/components/uitest/RunoThemeTest.java View File

@@ -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");
}
}

+ 14
- 22
uitest/src/com/vaadin/tests/components/uitest/ThemeTest.java View 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.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");
}


+ 0
- 4
uitest/src/com/vaadin/tests/tb3/MultiBrowserThemeTest.java View File

@@ -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",

Loading…
Cancel
Save