From 9c29442be7fbb150288ba4451ed9167bec2436ad Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 16 Apr 2014 14:01:34 +0300 Subject: Replace SelectionRangeDragging TB2 test with TB3 test Change-Id: Ic60e13b94e550c0457649ef093c8d6269a7efa19 --- .../components/table/CtrlShiftMultiselectTest.java | 78 ++++++++++++++++++++++ .../components/table/SelectionRangeDragging.html | 52 --------------- 2 files changed, 78 insertions(+), 52 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java delete mode 100644 uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java new file mode 100644 index 0000000000..db4ed9dcb5 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java @@ -0,0 +1,78 @@ +/* + * 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.table; + +import java.io.IOException; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +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 CtrlShiftMultiselectTest extends MultiBrowserTest { + + @Override + public List getBrowsersToTest() { + List browsers = super.getBrowsersToTest(); + browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + + return browsers; + } + + @Override + protected DesiredCapabilities getDesiredCapabilities() { + DesiredCapabilities cap = new DesiredCapabilities( + super.getDesiredCapabilities()); + cap.setCapability("requireWindowFocus", true); + return cap; + } + + @Test + public void testSelectionRangeDragging() throws IOException { + openTestURL(); + clickRow(3); + new Actions(driver).keyDown(Keys.SHIFT).perform(); + clickRow(8); + new Actions(driver).keyUp(Keys.SHIFT).perform(); + dragRows(5, 700, 0); + compareScreen("draggedMultipleRows"); + new Actions(driver).release().perform(); + } + + private void clickRow(int index) { + List rows = getAllRows(); + rows.get(index).click(); + } + + private void dragRows(int dragIdx, int xOffset, int yOffset) { + List rows = getAllRows(); + new Actions(driver).moveToElement(rows.get(dragIdx)).clickAndHold() + .moveByOffset(5, 0).perform(); + new Actions(driver).moveByOffset(xOffset - 5, yOffset).perform(); + + } + + private List getAllRows() { + WebElement table = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]"); + return table.findElements(By.cssSelector(".v-table-table tr")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html b/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html deleted file mode 100644 index 1e911699d1..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -New Test - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
New Test
open/run/com.vaadin.tests.components.table.CtrlShiftMultiselect?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[1]/domChild[0]112,12
mouseClickvaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[10]/domChild[1]/domChild[0]82,16:shift
dragvaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[8]/domChild[1]/domChild[0]87,1
mouseMoveAtvaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]700,210
screenCapturemultiple-rows-dragged
dropvaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]700,210
- - -- cgit v1.2.3