From 1b218a1f9f4713d23b8563acd6257fb912afcc15 Mon Sep 17 00:00:00 2001 From: Juuso Valli Date: Mon, 21 Jul 2014 09:14:06 +0300 Subject: Remove obsolete TB2 tooltip test, update TB4 test (#14019) Change-Id: I02b68886b888ee0a0d99b41138755f0ea6e2a53d --- .../tests/components/button/ButtonTooltips.html | 37 ---------------------- .../com/vaadin/tests/tooltip/ButtonTooltips.java | 16 ++++++---- .../vaadin/tests/tooltip/ButtonTooltipsTest.java | 12 +++---- 3 files changed, 16 insertions(+), 49 deletions(-) delete mode 100644 uitest/src/com/vaadin/tests/components/button/ButtonTooltips.html diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonTooltips.html b/uitest/src/com/vaadin/tests/components/button/ButtonTooltips.html deleted file mode 100644 index 13fdf52c76..0000000000 --- a/uitest/src/com/vaadin/tests/components/button/ButtonTooltips.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -New Test - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.components.button.ButtonTooltips?restartApplication
showTooltipvaadin=runcomvaadintestscomponentsbuttonButtonTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]0,0
showTooltipvaadin=runcomvaadintestscomponentsbuttonButtonTooltips::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]0,0
screenCapture
- - diff --git a/uitest/src/com/vaadin/tests/tooltip/ButtonTooltips.java b/uitest/src/com/vaadin/tests/tooltip/ButtonTooltips.java index d212a13058..c341aa689b 100644 --- a/uitest/src/com/vaadin/tests/tooltip/ButtonTooltips.java +++ b/uitest/src/com/vaadin/tests/tooltip/ButtonTooltips.java @@ -1,14 +1,18 @@ package com.vaadin.tests.tooltip; -import com.vaadin.tests.components.TestBase; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.VerticalLayout; -public class ButtonTooltips extends TestBase { +public class ButtonTooltips extends AbstractTestUI { + + public static final String shortDescription = "Another"; + public static final String longDescription = "long descidescidescpription"; @Override - protected String getDescription() { + protected String getTestDescription() { return "Button tooltip's size gets messed up if moving from one tooltip to another before a timer expires."; } @@ -18,12 +22,12 @@ public class ButtonTooltips extends TestBase { } @Override - protected void setup() { + protected void setup(VaadinRequest request) { VerticalLayout vl = new VerticalLayout(); Button button = new Button("One"); - button.setDescription("long descidescidescpription"); + button.setDescription(longDescription); Button button2 = new Button("Two"); - button2.setDescription("Another"); + button2.setDescription(shortDescription); vl.addComponent(button); vl.addComponent(button2); vl.setComponentAlignment(button, Alignment.TOP_RIGHT); diff --git a/uitest/src/com/vaadin/tests/tooltip/ButtonTooltipsTest.java b/uitest/src/com/vaadin/tests/tooltip/ButtonTooltipsTest.java index d64dd900a7..08436b1332 100644 --- a/uitest/src/com/vaadin/tests/tooltip/ButtonTooltipsTest.java +++ b/uitest/src/com/vaadin/tests/tooltip/ButtonTooltipsTest.java @@ -1,12 +1,12 @@ /* * 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 @@ -26,7 +26,7 @@ import com.vaadin.tests.tb3.TooltipTest; /** * Tests that tooltip sizes do not change when moving between adjacent elements - * + * * @author Vaadin Ltd */ public class ButtonTooltipsTest extends TooltipTest { @@ -38,12 +38,12 @@ public class ButtonTooltipsTest extends TooltipTest { WebElement buttonOne = $(ButtonElement.class).caption("One").first(); WebElement buttonTwo = $(ButtonElement.class).caption("Two").first(); - checkTooltip(buttonOne, "long descidescidescpription"); + checkTooltip(buttonOne, ButtonTooltips.longDescription); int originalWidth = getTooltipElement().getSize().getWidth(); int originalHeight = getTooltipElement().getSize().getHeight(); clearTooltip(); - checkTooltip(buttonTwo, "Another"); + checkTooltip(buttonTwo, ButtonTooltips.shortDescription); moveMouseTo(buttonOne, 5, 5); sleep(100); assertThat(getTooltipElement().getSize().getWidth(), is(originalWidth)); -- cgit v1.2.3