diff options
author | Anna Koskinen <anna@vaadin.com> | 2014-08-04 15:07:33 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-08-05 08:37:06 +0000 |
commit | 5f0649db3706375131ecb7b5aaef6b3c2c1501af (patch) | |
tree | 9535098a816c6faca319ea3b1e7c7ea51cea2395 /uitest | |
parent | ae37910f4cb307c929df32e6499b9e1872192377 (diff) | |
download | vaadin-framework-5f0649db3706375131ecb7b5aaef6b3c2c1501af.tar.gz vaadin-framework-5f0649db3706375131ecb7b5aaef6b3c2c1501af.zip |
DisappearingComponents test upgrade (#14292)
Change-Id: I9831ca315b0a9f87d3f6baef3966a4efa43684c1
Diffstat (limited to 'uitest')
3 files changed, 54 insertions, 41 deletions
diff --git a/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.html b/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.html deleted file mode 100644 index 1a20b798ec..0000000000 --- a/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.html +++ /dev/null @@ -1,32 +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>DisappearingComponents</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">DisappearingComponents</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.treetable.DisappearingComponents?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableDisappearingComponents::/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> - <td>12,7</td> -</tr> -<tr> - <td>verifyElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstreetableDisappearingComponents::/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[2]/VLink[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.java b/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.java index aaa7496616..ee64007234 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.java +++ b/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponents.java @@ -1,16 +1,15 @@ package com.vaadin.tests.components.treetable; import com.vaadin.server.ExternalResource; -import com.vaadin.tests.components.AbstractTestCase; -import com.vaadin.ui.LegacyWindow; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Link; import com.vaadin.ui.TreeTable; -public class DisappearingComponents extends AbstractTestCase { +public class DisappearingComponents extends AbstractTestUI { @Override - public void init() { - LegacyWindow mainWindow = new LegacyWindow("Application"); + public void setup(VaadinRequest request) { final TreeTable tt = new TreeTable(); tt.setSizeUndefined(); tt.setWidth("100%"); @@ -33,13 +32,11 @@ public class DisappearingComponents extends AbstractTestCase { tt.setChildrenAllowed(items[2], false); tt.setParent(items[2], items[1]); - mainWindow.addComponent(tt); - - setMainWindow(mainWindow); + addComponent(tt); } @Override - protected String getDescription() { + protected String getTestDescription() { return "TreeTable column component empty after expand+collapse when pageLength is set to zero"; } diff --git a/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponentsTest.java b/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponentsTest.java new file mode 100644 index 0000000000..e4d97b9de1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/DisappearingComponentsTest.java @@ -0,0 +1,48 @@ +/* + * 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.treetable; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.TreeTableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests that expanded cells with component contents aren't empty. + * + * @author Vaadin Ltd + */ +public class DisappearingComponentsTest extends MultiBrowserTest { + + @Test + public void testNotification() throws InterruptedException { + openTestURL(); + + TreeTableElement treeTable = $(TreeTableElement.class).first(); + treeTable.getCell(1, 0) + .findElement(By.className("v-treetable-treespacer")).click(); + sleep(100); + + WebElement link = treeTable.getCell(2, 1).findElement( + By.className("v-link")); + assertEquals("3", link.getText()); + } + +} |