diff options
author | Artur Signell <artur@vaadin.com> | 2016-08-18 23:19:41 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-08-22 15:59:51 +0300 |
commit | c6b44ac8adc9b2ffd6290c98643a633f405dd6c6 (patch) | |
tree | 634982e9a789452ab8046e660a9170cc8b25623f /uitest-common | |
parent | ec8904f6b0ab77231d567daa35c9cc7138b6fe59 (diff) | |
download | vaadin-framework-c6b44ac8adc9b2ffd6290c98643a633f405dd6c6.tar.gz vaadin-framework-c6b44ac8adc9b2ffd6290c98643a633f405dd6c6.zip |
Move and rename server classes which go into the compatibility package
* Use com.vaadin.v7
* Use the same class name as in Vaadin 7
* Use a "vaadin7-" declarative prefix for Vaadin 7 components
Change-Id: I19a27f3835b18980b91a4f8f9464b2adde1a5fd5
Diffstat (limited to 'uitest-common')
26 files changed, 593 insertions, 0 deletions
diff --git a/uitest-common/src/main/java/com/vaadin/testbench/customelements/DateFieldElement.java b/uitest-common/src/main/java/com/vaadin/testbench/customelements/DateFieldElement.java new file mode 100644 index 0000000000..3c0348ee02 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/testbench/customelements/DateFieldElement.java @@ -0,0 +1,13 @@ +package com.vaadin.testbench.customelements; + +import org.openqa.selenium.By; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.ui.DateField") +public class DateFieldElement + extends com.vaadin.testbench.elements.DateFieldElement { + public void openPopup() { + findElement(By.tagName("button")).click(); + } +} diff --git a/uitest-common/src/main/java/com/vaadin/testbench/customelements/FixedNotificationElement.java b/uitest-common/src/main/java/com/vaadin/testbench/customelements/FixedNotificationElement.java new file mode 100644 index 0000000000..696cbeb95c --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/testbench/customelements/FixedNotificationElement.java @@ -0,0 +1,28 @@ +package com.vaadin.testbench.customelements; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.NotificationElement; +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.ui.Notification") +public class FixedNotificationElement extends NotificationElement { + @Override + public String getCaption() { + WebElement popup = findElement(By.className("popupContent")); + WebElement caption = popup.findElement(By.tagName("h1")); + return caption.getText(); + } + + @Override + public void close() { + click(5, 5); + WebDriverWait wait = new WebDriverWait(getDriver(), 10); + wait.until(ExpectedConditions + .not(ExpectedConditions.presenceOfAllElementsLocatedBy( + By.className("v-Notification")))); + } +} diff --git a/uitest-common/src/main/java/com/vaadin/testbench/customelements/MenuBarElement.java b/uitest-common/src/main/java/com/vaadin/testbench/customelements/MenuBarElement.java new file mode 100644 index 0000000000..55a0785e3d --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/testbench/customelements/MenuBarElement.java @@ -0,0 +1,15 @@ +package com.vaadin.testbench.customelements; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.ui.MenuBar") +public class MenuBarElement + extends com.vaadin.testbench.elements.MenuBarElement { + + public void openMenuPath(String... captions) { + for (String c : captions) { + findElement(By.vaadin("#" + c)).click(); + } + } +} diff --git a/uitest-common/src/main/java/com/vaadin/testbench/customelements/WindowElement.java b/uitest-common/src/main/java/com/vaadin/testbench/customelements/WindowElement.java new file mode 100644 index 0000000000..28d2dd63cc --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/testbench/customelements/WindowElement.java @@ -0,0 +1,76 @@ +package com.vaadin.testbench.customelements; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elementsbase.ServerClass; + +/* + Suggestions for new elemental api for Window + */ +@ServerClass("com.vaadin.ui.Window") +public class WindowElement extends com.vaadin.testbench.elements.WindowElement { + + private final String restoreBoxClass = "v-window-restorebox"; + private final String maximizeBoxClass = "v-window-maximizebox"; + private final String closeBoxClass = "v-window-closebox"; + + public void restore() { + if (isMaximized()) { + getRestoreButton().click(); + } else { + throw new AssertionError( + "Window is not maximized, cannot be restored."); + } + } + + private boolean isMaximized() { + return isElementPresent(By.className(restoreBoxClass)); + } + + private WebElement getRestoreButton() { + return findElement(By.className("v-window-restorebox")); + } + + public void maximize() { + if (!isMaximized()) { + getMaximizeButton().click(); + } else { + throw new AssertionError( + "Window is already maximized, cannot maximize."); + } + } + + private WebElement getMaximizeButton() { + return findElement(By.className(maximizeBoxClass)); + } + + public void move(int xOffset, int yOffset) { + Actions action = new Actions(getDriver()); + action.moveToElement( + findElement(org.openqa.selenium.By.className("v-window-wrap")), + 5, 5); + action.clickAndHold(); + action.moveByOffset(xOffset, yOffset); + action.release(); + action.build().perform(); + } + + /** + * @return the caption of the window + */ + @Override + public String getCaption() { + return findElement(By.className("v-window-header")).getText(); + } + + private WebElement getCloseButton() { + return findElement(By.className(closeBoxClass)); + } + + public void close() { + getCloseButton().click(); + + } +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/CalendarElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/CalendarElement.java new file mode 100644 index 0000000000..c43ebd80ba --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/CalendarElement.java @@ -0,0 +1,48 @@ +package com.vaadin.v7.testbench.customelements; + +import java.util.List; + +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.Calendar") +public class CalendarElement + extends com.vaadin.testbench.elements.CalendarElement { + public List<WebElement> getWeekNumbers() { + return findElements(By.className("v-calendar-week-number")); + } + + public boolean hasMonthView() { + return isElementPresent(By.className("v-calendar-week-numbers")); + } + + public boolean hasWeekView() { + return isElementPresent(By.className("v-calendar-header-week")); + } + + public List<WebElement> getDayNumbers() { + return findElements(By.className("v-calendar-day-number")); + } + + public List<WebElement> getMonthDays() { + return findElements(By.className("v-calendar-month-day")); + } + + public boolean hasDayView() { + return getDayHeaders().size() == 1; + } + + public List<WebElement> getDayHeaders() { + return findElements(By.className("v-calendar-header-day")); + } + + public void back() { + findElement(By.className("v-calendar-back")).click(); + } + + public void next() { + findElement(By.className("v-calendar-next")).click(); + } +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/CheckBoxElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/CheckBoxElement.java new file mode 100644 index 0000000000..9ab5ceae89 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/CheckBoxElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.CheckBox") +public class CheckBoxElement + extends com.vaadin.testbench.elements.CheckBoxElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ColorPickerAreaElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ColorPickerAreaElement.java new file mode 100644 index 0000000000..151dee9915 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ColorPickerAreaElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.ColorPickerArea") +public class ColorPickerAreaElement + extends com.vaadin.testbench.elements.ColorPickerAreaElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ColorPickerElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ColorPickerElement.java new file mode 100644 index 0000000000..749a54f967 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ColorPickerElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.ColorPicker") +public class ColorPickerElement + extends com.vaadin.testbench.elements.ColorPickerElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ComboBoxElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ComboBoxElement.java new file mode 100644 index 0000000000..d5208e6338 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ComboBoxElement.java @@ -0,0 +1,61 @@ +package com.vaadin.v7.testbench.customelements; + +import org.junit.Assert; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.ComboBox") +public class ComboBoxElement + extends com.vaadin.testbench.elements.ComboBoxElement { + + private static org.openqa.selenium.By bySuggestionPopup = By + .vaadin("#popup"); + + public WebElement getInputField() { + return findElement(By.vaadin("#textbox")); + } + + @Override + public String getText() { + return getInputField().getAttribute("value"); + } + + @Override + public void clear() { + getInputField().clear(); + } + + public WebElement getSuggestionPopup() { + return findElement(bySuggestionPopup); + } + + @Override + public void sendKeys(CharSequence... keysToSend) { + sendKeys(50, keysToSend); + } + + /** + * Use this method to simulate typing into an element, which may set its + * value. + * + * @param delay + * delay after sending each individual key (mainly needed for + * PhantomJS) + * @param keysToSend + * keys to type into the element + */ + public void sendKeys(int delay, CharSequence... keysToSend) { + WebElement input = getInputField(); + + for (CharSequence key : keysToSend) { + input.sendKeys(key); + try { + Thread.sleep(delay); + } catch (InterruptedException e) { + Assert.fail(e.getMessage()); + } + } + } +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/DateFieldElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/DateFieldElement.java new file mode 100644 index 0000000000..c69c2ad22c --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/DateFieldElement.java @@ -0,0 +1,24 @@ +/* + * Copyright 2000-2016 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.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.DateField") +public class DateFieldElement + extends com.vaadin.testbench.elements.DateFieldElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/GridElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/GridElement.java new file mode 100644 index 0000000000..0edd4d0f46 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/GridElement.java @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2012 Vaadin Ltd + * + * This program is available under Commercial Vaadin Add-On License 3.0 + * (CVALv3). + * + * See the file licensing.txt distributed with this software for more + * information about licensing. + * + * You should have received a copy of the license along with this program. + * If not, see <http://vaadin.com/license/cval-3>. + */ +package com.vaadin.v7.testbench.customelements; + +import org.openqa.selenium.NoSuchElementException; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elementsbase.ServerClass; + +/** + * TestBench Element API for Grid + * + * @since + * @author Vaadin Ltd + */ +@ServerClass("com.vaadin.v7.ui.Grid") +public class GridElement extends com.vaadin.testbench.elements.GridElement { + + /** + * Gets the element that contains the details of a row. + * + * @since + * @param rowIndex + * the index of the row for the details + * @return the element that contains the details of a row. <code>null</code> + * if no widget is defined for the detials row + * @throws NoSuchElementException + * if the given details row is currently not open + */ + public TestBenchElement getDetails(int rowIndex) + throws NoSuchElementException { + return getSubPart("#details[" + rowIndex + "]"); + } + + private TestBenchElement getSubPart(String subPartSelector) { + return (TestBenchElement) findElement(By.vaadin(subPartSelector)); + } + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/InlineDateFieldElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/InlineDateFieldElement.java new file mode 100644 index 0000000000..22618d73d5 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/InlineDateFieldElement.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2016 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.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +/** + * @author Vaadin Ltd + * + */ +@ServerClass("com.vaadin.v7.ui.InlineDateField") +public class InlineDateFieldElement + extends com.vaadin.testbench.elements.InlineDateFieldElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ListSelectElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ListSelectElement.java new file mode 100644 index 0000000000..ac59fd62e4 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ListSelectElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.ListSelect") +public class ListSelectElement + extends com.vaadin.testbench.elements.ListSelectElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/NativeSelectElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/NativeSelectElement.java new file mode 100644 index 0000000000..ffb116a6fb --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/NativeSelectElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.NativeSelect") +public class NativeSelectElement + extends com.vaadin.testbench.elements.NativeSelectElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/OptionGroupElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/OptionGroupElement.java new file mode 100644 index 0000000000..fed5533f18 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/OptionGroupElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.OptionGroup") +public class OptionGroupElement + extends com.vaadin.testbench.elements.OptionGroupElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/PasswordFieldElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/PasswordFieldElement.java new file mode 100644 index 0000000000..dccf14351f --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/PasswordFieldElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.PasswordField") +public class PasswordFieldElement + extends com.vaadin.testbench.elements.PasswordFieldElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/PopupDateFieldElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/PopupDateFieldElement.java new file mode 100644 index 0000000000..777e55ae0a --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/PopupDateFieldElement.java @@ -0,0 +1,28 @@ +/* + * Copyright 2000-2016 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.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +/** + * @author Vaadin Ltd + * + */ +@ServerClass("com.vaadin.v7.ui.PopupDateField") +public class PopupDateFieldElement + extends com.vaadin.testbench.elements.PopupDateFieldElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ProgressBarElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ProgressBarElement.java new file mode 100644 index 0000000000..7aaaf954d2 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/ProgressBarElement.java @@ -0,0 +1,56 @@ +/* + * Copyright 2000-2016 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.v7.testbench.customelements; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.ui.ProgressBar") +public class ProgressBarElement + extends com.vaadin.testbench.elements.ProgressBarElement { + + public double getValue() { + WebElement indicator = findElement( + By.className("v-progressbar-indicator")); + String width = getStyleAttribute(indicator, "width"); + if (!width.endsWith("%")) { + return 0; + } + + return Double.parseDouble(width.replace("%", "")) / 100.0; + } + + /** + * @since 7.5.6 + * @param indicator + * @param string + * @return + */ + private String getStyleAttribute(WebElement element, String styleName) { + String style = element.getAttribute("style"); + String[] styles = style.split(";"); + for (String s : styles) { + if (s.startsWith(styleName + ":")) { + return s.substring(styleName.length() + 1).trim(); + } + } + + return null; + } + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/RichTextAreaElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/RichTextAreaElement.java new file mode 100644 index 0000000000..f83d83393a --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/RichTextAreaElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.RichTextArea") +public class RichTextAreaElement + extends com.vaadin.testbench.elements.RichTextAreaElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/SelectElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/SelectElement.java new file mode 100644 index 0000000000..98080669a3 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/SelectElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.Select") +public class SelectElement + extends com.vaadin.testbench.elements.SelectElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TableElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TableElement.java new file mode 100644 index 0000000000..3737fa0e04 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TableElement.java @@ -0,0 +1,40 @@ +package com.vaadin.v7.testbench.customelements; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elementsbase.AbstractElement; +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.Table") +public class TableElement extends com.vaadin.testbench.elements.TableElement { + public CollapseMenu openCollapseMenu() { + getCollapseMenuToggle().click(); + WebElement cm = getDriver() + .findElement(By.xpath("//*[@id='PID_VAADIN_CM']")); + return wrapElement(cm, getCommandExecutor()).wrap(CollapseMenu.class); + } + + public static class CollapseMenu extends ContextMenuElement { + } + + public WebElement getCollapseMenuToggle() { + return findElement(By.className("v-table-column-selector")); + } + + public static class ContextMenuElement extends AbstractElement { + + public WebElement getItem(int index) { + return findElement( + By.xpath(".//table//tr[" + (index + 1) + "]//td/*")); + } + + } + + public ContextMenuElement getContextMenu() { + WebElement cm = getDriver().findElement(By.className("v-contextmenu")); + return wrapElement(cm, getCommandExecutor()) + .wrap(ContextMenuElement.class); + } + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TextAreaElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TextAreaElement.java new file mode 100644 index 0000000000..f4099985ad --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TextAreaElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.TextArea") +public class TextAreaElement + extends com.vaadin.testbench.elements.TextAreaElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TextFieldElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TextFieldElement.java new file mode 100644 index 0000000000..3329eed510 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TextFieldElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.TextField") +public class TextFieldElement + extends com.vaadin.testbench.elements.TextFieldElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TreeElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TreeElement.java new file mode 100644 index 0000000000..2ce3d84e78 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TreeElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.Tree") +public class TreeElement + extends com.vaadin.testbench.elements.TreeElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TreeTableElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TreeTableElement.java new file mode 100644 index 0000000000..f236fc863a --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TreeTableElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.TreeTable") +public class TreeTableElement + extends com.vaadin.testbench.elements.TreeTableElement { + +} diff --git a/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TwinColSelectElement.java b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TwinColSelectElement.java new file mode 100644 index 0000000000..663ebc0456 --- /dev/null +++ b/uitest-common/src/main/java/com/vaadin/v7/testbench/customelements/TwinColSelectElement.java @@ -0,0 +1,9 @@ +package com.vaadin.v7.testbench.customelements; + +import com.vaadin.testbench.elementsbase.ServerClass; + +@ServerClass("com.vaadin.v7.ui.TwinColSelect") +public class TwinColSelectElement + extends com.vaadin.testbench.elements.TwinColSelectElement { + +} |