From f19976f1f14c83bce148618acfa29c7d5fa96c68 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Fri, 1 Aug 2014 17:05:33 +0300 Subject: TableRowHeight2 test upgrade (#14292) Change-Id: Ied17689fb63c7b010764d45902eb404087d1fd8f --- .../tests/components/table/TableRowHeight2.html | 57 ---------------------- .../tests/components/table/TableRowHeight2.java | 13 +++-- .../components/table/TableRowHeight2Test.java | 52 ++++++++++++++++++++ 3 files changed, 60 insertions(+), 62 deletions(-) delete mode 100644 uitest/src/com/vaadin/tests/components/table/TableRowHeight2.html create mode 100644 uitest/src/com/vaadin/tests/components/table/TableRowHeight2Test.java diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.html b/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.html deleted file mode 100644 index a440ff84fb..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - -TableRowHeight2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TableRowHeight2
open/run/com.vaadin.tests.components.table.TableRowHeight2
waitForVaadin
screenCapture1
clickvaadin=runcomvaadintestscomponentstableTableRowHeight2::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VButton[1]/domChild[0]/domChild[0]
waitForVaadin
clickvaadin=runcomvaadintestscomponentstableTableRowHeight2::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[1]/VButton[1]/domChild[0]/domChild[0]
waitForVaadin
screenCapture1
- - diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.java b/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.java index 0011fdca18..5c733b9e24 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.java +++ b/uitest/src/com/vaadin/tests/components/table/TableRowHeight2.java @@ -1,16 +1,19 @@ package com.vaadin.tests.components.table; +import com.vaadin.annotations.Theme; import com.vaadin.data.Item; -import com.vaadin.tests.components.TestBase; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Table; import com.vaadin.ui.themes.BaseTheme; -public class TableRowHeight2 extends TestBase { +@Theme("tests-tickets") +public class TableRowHeight2 extends AbstractTestUI { @Override - protected String getDescription() { + protected String getTestDescription() { return "The table contains 2 rows, which both should be shown completely as the table height is undefined."; } @@ -19,9 +22,9 @@ public class TableRowHeight2 extends TestBase { return 2747; } + @SuppressWarnings("unchecked") @Override - protected void setup() { - setTheme("tests-tickets"); + protected void setup(VaadinRequest request) { HorizontalLayout vl = new HorizontalLayout(); vl.setSizeFull(); diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowHeight2Test.java b/uitest/src/com/vaadin/tests/components/table/TableRowHeight2Test.java new file mode 100644 index 0000000000..7074225311 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableRowHeight2Test.java @@ -0,0 +1,52 @@ +/* + * 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.table; + +import java.io.IOException; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests that rows are completely visible and clicking buttons doesn't change + * anything. + * + * @author Vaadin Ltd + */ +public class TableRowHeight2Test extends MultiBrowserTest { + + @Test + public void testRowHeights() throws IOException { + openTestURL(); + + compareScreen("initial"); + + TableElement table = $(TableElement.class).first(); + List rows = table.findElement(By.className("v-table-body")) + .findElements(By.tagName("tr")); + + rows.get(0).findElements(By.className("v-button")).get(1).click(); + rows.get(1).findElements(By.className("v-button")).get(1).click(); + + compareScreen("after"); + } + +} -- cgit v1.2.3