diff options
author | Pontus Boström <pontus@vaadin.com> | 2015-11-20 17:08:44 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-05-12 07:05:33 +0000 |
commit | dfcc4949ca445b55bc004ef96da8ae28aa343018 (patch) | |
tree | a91d64b5a2a7cb5671b1b75035fb41aec961db3a /uitest/src | |
parent | b3b5c062b02ca5edfc5527090c027145704ee51a (diff) | |
download | vaadin-framework-dfcc4949ca445b55bc004ef96da8ae28aa343018.tar.gz vaadin-framework-dfcc4949ca445b55bc004ef96da8ae28aa343018.zip |
Fixed tooltips for sub-windows (#19073)
The subwindows tooltip is now also shown in header and footer of the
subwindow. Added also tests for the feature.
Change-Id: I933dad9e8530ce20b930fe22caf9e79a3ad3e3d2
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/window/ToolTipInWindow.java | 46 | ||||
-rw-r--r-- | uitest/src/test/java/com/vaadin/tests/components/window/ToolTipInWindowTest.java | 77 |
2 files changed, 123 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/ToolTipInWindow.java b/uitest/src/main/java/com/vaadin/tests/components/window/ToolTipInWindow.java new file mode 100644 index 0000000000..144b5a0d3f --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/window/ToolTipInWindow.java @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2015 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.window; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; +import com.vaadin.ui.Window; + +/** + * Test to demonstrate that tooltips are shown for both Window header and + * content + * + * @author Vaadin Ltd + */ +public class ToolTipInWindow extends AbstractTestUI { + + Window window; + + @Override + protected void setup(VaadinRequest request) { + + window = new Window("Caption", new Label("A label content")); + window.setPositionX(300); + window.setPositionY(200); + window.setWidth("200px"); + window.setHeight("200px"); + window.setDescription("Tooltip"); + addWindow(window); + + } + +} diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/ToolTipInWindowTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/ToolTipInWindowTest.java new file mode 100644 index 0000000000..40332e7730 --- /dev/null +++ b/uitest/src/test/java/com/vaadin/tests/components/window/ToolTipInWindowTest.java @@ -0,0 +1,77 @@ +/* + * Copyright 2000-2015 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.window; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ToolTipInWindowTest extends MultiBrowserTest { + + @Test + public void testToolTipInHeader() throws Exception { + + openTestURL(); + + WebElement header = driver.findElement(By + .className("v-window-outerheader")); + new Actions(driver).moveToElement( + driver.findElement(By.className("v-ui")), 0, 0).perform(); + sleep(500); + new Actions(driver).moveToElement(header).perform(); + sleep(1100); + + WebElement ttip = findElement(By.className("v-tooltip")); + assertNotNull(ttip); + assertEquals("Tooltip", ttip.getText()); + + } + + @Test + public void testToolTipInContent() throws Exception { + + openTestURL(); + + WebElement header = driver.findElement(By + .className("v-window-contents")); + new Actions(driver).moveToElement( + driver.findElement(By.className("v-ui")), 0, 300).perform(); + sleep(500); + new Actions(driver).moveToElement(header).perform(); + sleep(1000); + + WebElement ttip = findElement(By.className("v-tooltip")); + assertNotNull(ttip); + assertEquals("Tooltip", ttip.getText()); + + } + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + // Test with the same browsers as in the other tooltip tests + return getBrowsersExcludingIE(); + } + +} |