diff options
3 files changed, 100 insertions, 33 deletions
diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java new file mode 100644 index 0000000000..e9b022eac2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java @@ -0,0 +1,46 @@ +/* + * Copyright 2000-2013 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.orderedlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.VerticalLayout; + +/** + * Test hovering over nested layout caption + * + * @author Vaadin Ltd + */ +public class NestedLayoutCaptionHover extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout test = new VerticalLayout(); + test.setCaption("inner layout"); + addComponent(new VerticalLayout(new VerticalLayout(new VerticalLayout( + test)))); + } + + @Override + protected String getTestDescription() { + return "Hovering over nested layout caption should not freeze the browser"; + } + + @Override + protected Integer getTicketNumber() { + return 12469; + } +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java new file mode 100644 index 0000000000..904a4dd6f0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2000-2013 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.orderedlayout; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.HasInputDevices; +import org.openqa.selenium.interactions.internal.Coordinates; +import org.openqa.selenium.internal.Locatable; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests hovering over caption in nested layout + */ +public class NestedLayoutCaptionHoverTest extends MultiBrowserTest { + + @Test + public void testTooltipInNestedLayout() { + openTestURL(); + + WebElement caption = getDriver().findElement( + By.className("v-captiontext")); + + assertEquals("inner layout", caption.getText()); + + // Hover over the caption + Coordinates coords = ((Locatable) caption).getCoordinates(); + ((HasInputDevices) getDriver()).getMouse().mouseMove(coords); + sleep(1000); + + // Verify that there's no error notification + WebElement error = vaadinElement("Root/VNotification[0]"); + assertNull("No error should be found", error); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionTooltip.html b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionTooltip.html deleted file mode 100644 index 4f574a92c7..0000000000 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionTooltip.html +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.applicationcontext.CloseSession?restartApplication&debug</td> - <td></td> -</tr> -<!-- Show tooltip for the Events caption --> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-4']/span</td> - <td></td> -</tr> -<!-- Verify that there's no error notification --> -<tr> - <td>assertElementNotPresent</td> - <td>vaadin=runcomvaadintestsapplicationcontextCloseSession::Root/VNotification[0]</td> - <td></td> -</tr> -</tbody></table> -</body> -</html> |