2 * Copyright 2000-2016 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.tests.components.grid.basicfeatures.server;
18 import java.io.IOException;
19 import java.util.List;
21 import org.junit.Test;
22 import org.openqa.selenium.interactions.Actions;
23 import org.openqa.selenium.remote.DesiredCapabilities;
25 import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
26 import com.vaadin.tests.components.grid.basicfeatures.GridSidebarFeatures;
28 public class GridSidebarThemeTest extends GridBasicFeaturesTest {
31 public void testValo() throws Exception {
32 runTestSequence("valo");
36 public void testValoDark() throws Exception {
37 runTestSequence("tests-valo-dark");
41 protected Class<?> getUIClass() {
42 return GridSidebarFeatures.class;
45 private void runTestSequence(String theme) throws IOException {
46 openTestURL("theme=" + theme);
48 compareScreen(theme + "-SidebarClosed");
49 getSidebarOpenButton().click();
51 compareScreen(theme + "-SidebarOpen");
53 new Actions(getDriver()).moveToElement(getColumnHidingToggle(2), 5, 5)
56 compareScreen(theme + "-OnMouseOverNotHiddenToggle");
58 getColumnHidingToggle(2).click();
59 getColumnHidingToggle(3).click();
60 getColumnHidingToggle(6).click();
62 new Actions(getDriver()).moveToElement(getSidebarOpenButton())
66 compareScreen(theme + "-TogglesTriggered");
68 new Actions(getDriver()).moveToElement(getColumnHidingToggle(2))
72 compareScreen(theme + "-OnMouseOverHiddenToggle");
74 getSidebarOpenButton().click();
76 compareScreen(theme + "-SidebarClosed2");
80 public List<DesiredCapabilities> getBrowsersToTest() {
81 // phantom JS looks wrong from the beginning, so not tested
82 return getBrowsersExcludingPhantomJS();