summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2014-04-16 14:01:34 +0300
committerVaadin Code Review <review@vaadin.com>2014-04-16 11:43:05 +0000
commit9c29442be7fbb150288ba4451ed9167bec2436ad (patch)
treeb54bebfe6ff1230e9d337a08f710c20c41dcbe4b /uitest
parente77e73cf64768845608ad25202cb97772fc7ab7b (diff)
downloadvaadin-framework-9c29442be7fbb150288ba4451ed9167bec2436ad.tar.gz
vaadin-framework-9c29442be7fbb150288ba4451ed9167bec2436ad.zip
Replace SelectionRangeDragging TB2 test with TB3 test
Change-Id: Ic60e13b94e550c0457649ef093c8d6269a7efa19
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java78
-rw-r--r--uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html52
2 files changed, 78 insertions, 52 deletions
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<DesiredCapabilities> getBrowsersToTest() {
+ List<DesiredCapabilities> 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<WebElement> rows = getAllRows();
+ rows.get(index).click();
+ }
+
+ private void dragRows(int dragIdx, int xOffset, int yOffset) {
+ List<WebElement> rows = getAllRows();
+ new Actions(driver).moveToElement(rows.get(dragIdx)).clickAndHold()
+ .moveByOffset(5, 0).perform();
+ new Actions(driver).moveByOffset(xOffset - 5, yOffset).perform();
+
+ }
+
+ private List<WebElement> 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 @@
-<?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.components.table.CtrlShiftMultiselect?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=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]</td>
- <td>112,12</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=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]</td>
- <td>82,16:shift</td>
-</tr>
-<tr>
- <td>drag</td>
- <td>vaadin=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]</td>
- <td>87,1</td>
-</tr>
-<tr>
- <td>mouseMoveAt</td>
- <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td>
- <td>700,210</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>multiple-rows-dragged</td>
-</tr>
-<tr>
- <td>drop</td>
- <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td>
- <td>700,210</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>