diff options
author | Pekka Hyvönen <pekka@vaadin.com> | 2015-04-22 17:17:18 +0300 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2015-04-22 17:53:46 +0300 |
commit | ec4e470e401a1a8f55b427b04dee08c39ed63d8b (patch) | |
tree | f2af8ebcb46b5fb7f5301c71ac070cb3f035d0dc /uitest | |
parent | d0d0875430a6d1d57bd2ebb7d4c827c04e1c7731 (diff) | |
download | vaadin-framework-ec4e470e401a1a8f55b427b04dee08c39ed63d8b.tar.gz vaadin-framework-ec4e470e401a1a8f55b427b04dee08c39ed63d8b.zip |
Fixed theming issues with Grid's Sidebar (#17412)
- if columns hidable when grid rendered, sidebar button had invalid height
- removed border radius from grid sidebar
- inherit font color for grid sidebar button
Change-Id: Ib35d917b35e701bd736a28f19b34dbece7fcbe71
Diffstat (limited to 'uitest')
3 files changed, 50 insertions, 18 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java index 2abd603ae4..8c60deaf3c 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java @@ -291,7 +291,9 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { // Set varying column widths for (int col = 0; col < COLUMNS; col++) { - grid.getColumn(getColumnProperty(col)).setWidth(100 + col * 50); + Column column = grid.getColumn(getColumnProperty(col)); + column.setWidth(100 + col * 50); + column.setHidable(isColumnHidableByDefault(col)); } grid.addSortListener(new SortListener() { @@ -334,6 +336,14 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { return grid; } + protected boolean isColumnHidableByDefault(int col) { + return false; + } + + protected boolean isColumnHiddenByDefault(int col) { + return false; + } + private void addInternalActions() { createClickAction("Update column order without updating client", "Internals", new Command<Grid, Void>() { @@ -828,8 +838,8 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }, c); - createBooleanAction("Hidable", getColumnProperty(c), false, - new Command<Grid, Boolean>() { + createBooleanAction("Hidable", getColumnProperty(c), + isColumnHidableByDefault(c), new Command<Grid, Boolean>() { @Override public void execute(Grid c, Boolean hidable, Object propertyId) { @@ -837,8 +847,8 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { } }, getColumnProperty(c)); - createBooleanAction("Hidden", getColumnProperty(c), false, - new Command<Grid, Boolean>() { + createBooleanAction("Hidden", getColumnProperty(c), + isColumnHiddenByDefault(c), new Command<Grid, Boolean>() { @Override public void execute(Grid c, Boolean hidden, Object propertyId) { diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSidebarFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSidebarFeatures.java new file mode 100644 index 0000000000..9494988cf4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridSidebarFeatures.java @@ -0,0 +1,24 @@ +/* + * 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.grid.basicfeatures; + +public class GridSidebarFeatures extends GridBasicFeatures { + + @Override + protected boolean isColumnHidableByDefault(int col) { + return true; + } +} diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java index 79327993b0..5262156b41 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSidebarThemeTest.java @@ -19,13 +19,11 @@ import java.io.IOException; import java.util.List; import org.junit.Test; -import org.openqa.selenium.By; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.remote.DesiredCapabilities; -import org.openqa.selenium.support.ui.ExpectedConditions; -import com.vaadin.testbench.parallel.Browser; import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; +import com.vaadin.tests.components.grid.basicfeatures.GridSidebarFeatures; public class GridSidebarThemeTest extends GridBasicFeaturesTest { @@ -34,18 +32,18 @@ public class GridSidebarThemeTest extends GridBasicFeaturesTest { runTestSequence("valo"); } + @Test + public void testValoDark() throws Exception { + runTestSequence("tests-valo-dark"); + } + + @Override + protected Class<?> getUIClass() { + return GridSidebarFeatures.class; + } + private void runTestSequence(String theme) throws IOException { openTestURL("theme=" + theme); - if (getDesiredCapabilities().getBrowserName().equals( - Browser.CHROME.getDesiredCapabilities().getBrowserName())) { - waitUntil(ExpectedConditions.elementToBeClickable(By.id("menu")), 2); - getDriver().findElement(By.id("menu")).click(); - selectMenu("Columns"); - selectMenu("All columns hidable"); - waitUntilLoadingIndicatorNotVisible(); - } else { - selectMenuPath("Component", "Columns", "All columns hidable"); - } compareScreen(theme + "|SidebarClosed"); getSidebarOpenButton().click(); |