From 98be6b1978f3ff03a9486f34c22d11cc134bf1c9 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 16 Apr 2014 15:13:26 +0300 Subject: [PATCH] Replace DragStartModes TB2 test with TB3 test Change-Id: Ief8c36aeeff2026b4beb7d73ab61f13721a2fd4f --- .../draganddropwrapper/DragStartModes.html | 62 ------------------- .../DragStartModesTest.java | 46 ++++++++++++++ 2 files changed, 46 insertions(+), 62 deletions(-) delete mode 100644 uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html create mode 100644 uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html deleted file mode 100644 index 3e7a7cb0a7..0000000000 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - -DragStartModes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DragStartModes
open/run/com.vaadin.tests.components.draganddropwrapper.DragStartModes?restartApplication
dragvaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::PID_SlabelCOMPONENT50,10
mouseMoveAtvaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]50,10
screenCapturedrag-mode-component
dropvaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]50,10
dragvaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::PID_SlabelWRAPPER50,10
mouseMoveAtvaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]50,10
screenCapturedrag-mode-wrapper
dropvaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]50,10
- - diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java new file mode 100644 index 0000000000..25aef1b815 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java @@ -0,0 +1,46 @@ +/* + * 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.draganddropwrapper; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DragStartModesTest extends MultiBrowserTest { + + @Test + public void testDragStartModes() throws IOException { + openTestURL(); + WebElement dropTarget = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]"); + dragToTarget("COMPONENT", dropTarget); + dragToTarget("WRAPPER", dropTarget); + } + + private void dragToTarget(String dragMode, WebElement dropTarget) + throws IOException { + WebElement draggable = vaadinElementById("label" + dragMode); + new Actions(driver).moveToElement(draggable, 10, 10).clickAndHold() + .moveByOffset(5, 0).perform(); + new Actions(driver).moveToElement(dropTarget, 12, 10).perform(); + compareScreen("dragMode" + dragMode); + new Actions(driver).release().perform(); + } + +} -- 2.39.5