]> source.dussan.org Git - vaadin-framework.git/blob
44e3d0c4d31d0c2d590287b4cdbff283716de1ec
[vaadin-framework.git] /
1 /*
2  * Copyright 2000-2016 Vaadin Ltd.
3  *
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
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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
14  * the License.
15  */
16 package com.vaadin.tests.components.grid.basicfeatures.server;
17
18 import java.io.IOException;
19 import java.util.List;
20
21 import org.junit.Test;
22 import org.openqa.selenium.interactions.Actions;
23 import org.openqa.selenium.remote.DesiredCapabilities;
24
25 import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
26 import com.vaadin.tests.components.grid.basicfeatures.GridSidebarFeatures;
27
28 public class GridSidebarThemeTest extends GridBasicFeaturesTest {
29
30     @Test
31     public void testValo() throws Exception {
32         runTestSequence("valo");
33     }
34
35     @Test
36     public void testValoDark() throws Exception {
37         runTestSequence("tests-valo-dark");
38     }
39
40     @Override
41     protected Class<?> getUIClass() {
42         return GridSidebarFeatures.class;
43     }
44
45     private void runTestSequence(String theme) throws IOException {
46         openTestURL("theme=" + theme);
47
48         compareScreen(theme + "-SidebarClosed");
49         getSidebarOpenButton().click();
50
51         compareScreen(theme + "-SidebarOpen");
52
53         new Actions(getDriver()).moveToElement(getColumnHidingToggle(2), 5, 5)
54                 .perform();
55
56         compareScreen(theme + "-OnMouseOverNotHiddenToggle");
57
58         getColumnHidingToggle(2).click();
59         getColumnHidingToggle(3).click();
60         getColumnHidingToggle(6).click();
61
62         new Actions(getDriver()).moveToElement(getSidebarOpenButton())
63                 .perform();
64         ;
65
66         compareScreen(theme + "-TogglesTriggered");
67
68         new Actions(getDriver()).moveToElement(getColumnHidingToggle(2))
69                 .perform();
70         ;
71
72         compareScreen(theme + "-OnMouseOverHiddenToggle");
73
74         getSidebarOpenButton().click();
75
76         compareScreen(theme + "-SidebarClosed2");
77     }
78
79     @Override
80     public List<DesiredCapabilities> getBrowsersToTest() {
81         // phantom JS looks wrong from the beginning, so not tested
82         return getBrowsersExcludingPhantomJS();
83     }
84 }