diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2017-11-28 13:34:00 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-12-07 12:19:06 +0200 |
commit | 94affc85ffa8cad01f48dab8c54b3d782cbcdf36 (patch) | |
tree | db103a8f396276187219e747614a316df2f58d88 /uitest | |
parent | 69a49a1f5e0c9f1a31a15145525f9d47e6617e0e (diff) | |
download | vaadin-framework-94affc85ffa8cad01f48dab8c54b3d782cbcdf36.tar.gz vaadin-framework-94affc85ffa8cad01f48dab8c54b3d782cbcdf36.zip |
Fix styling of Window control buttons to show focus (#10285)
Fixes #8918
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/themes/valo/WindowControlButtonFocus.java | 25 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/themes/valo/WindowControlButtonFocusTest.java | 48 |
2 files changed, 73 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/WindowControlButtonFocus.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/WindowControlButtonFocus.java new file mode 100644 index 0000000000..ce30991be1 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/WindowControlButtonFocus.java @@ -0,0 +1,25 @@ +package com.vaadin.tests.themes.valo; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; +import com.vaadin.ui.Window; + +public class WindowControlButtonFocus extends AbstractTestUI { + @Override + protected void setup(VaadinRequest request) { + Window window = new Window("Window", new Label()); + window.center(); + addWindow(window); + } + + @Override + protected Integer getTicketNumber() { + return 8918; + } + + @Override + protected String getTestDescription() { + return "Window control buttons should have noticeable focus styles."; + } +} diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/WindowControlButtonFocusTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/WindowControlButtonFocusTest.java new file mode 100644 index 0000000000..fb095c07b4 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/WindowControlButtonFocusTest.java @@ -0,0 +1,48 @@ +package com.vaadin.tests.themes.valo; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.WindowElement; +import com.vaadin.testbench.parallel.Browser; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class WindowControlButtonFocusTest extends MultiBrowserTest { + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + return Arrays.asList(Browser.CHROME.getDesiredCapabilities(), + Browser.IE11.getDesiredCapabilities()); + } + + @Test + public void focusMaximize() throws IOException, InterruptedException { + openTestURL(); + + WebElement window = $(WindowElement.class).first(); + WebElement maximize = window + .findElement(By.className("v-window-maximizebox")); + + executeScript("arguments[0].focus()", maximize); + compareScreen(window, "maximize-focused"); + } + + @Test + public void focusClose() throws IOException { + openTestURL(); + + WebElement window = $(WindowElement.class).first(); + WebElement close = window + .findElement(By.className("v-window-closebox")); + + executeScript("arguments[0].focus()", close); + compareScreen(window, "close-focused"); + } + +} |