Change-Id: Idf9b509c63290fca75cb67aeaa8ec981c8fa5b71tags/7.2.7
@@ -1,37 +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>TreeTableOutOfSync</title> | |||
</head> | |||
<body> | |||
<table cellpadding="1" cellspacing="1" border="1"> | |||
<thead> | |||
<tr><td rowspan="1" colspan="3">TreeTableOutOfSync</td></tr> | |||
</thead><tbody> | |||
<tr> | |||
<td>open</td> | |||
<td>/run/com.vaadin.tests.components.treetable.TreeTableOutOfSync?restartApplication</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>mouseClick</td> | |||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableOutOfSync::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> | |||
<td>10,7</td> | |||
</tr> | |||
<tr> | |||
<td>click</td> | |||
<td>vaadin=runcomvaadintestscomponentstreetableTreeTableOutOfSync::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[2]/VButton[0]/domChild[0]/domChild[0]</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>verifyTextNotPresent</td> | |||
<td>Something has caused us to be out of sync with the server.<br />Take note of any unsaved data, and click here to re-sync.</td> | |||
<td></td> | |||
</tr> | |||
</tbody></table> | |||
</body> | |||
</html> |
@@ -15,16 +15,18 @@ | |||
*/ | |||
package com.vaadin.tests.components.treetable; | |||
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.Button.ClickEvent; | |||
import com.vaadin.ui.Notification; | |||
import com.vaadin.ui.Table; | |||
import com.vaadin.ui.TreeTable; | |||
public class TreeTableOutOfSync extends TestBase { | |||
public class TreeTableOutOfSync extends AbstractTestUI { | |||
@Override | |||
protected void setup() { | |||
protected void setup(VaadinRequest request) { | |||
TreeTable tt = new TreeTable(); | |||
tt.addContainerProperty("i", Integer.class, null); | |||
tt.addGeneratedColumn("text", new Table.ColumnGenerator() { | |||
@@ -35,10 +37,10 @@ public class TreeTableOutOfSync extends TestBase { | |||
Button button = new Button("text " | |||
+ source.getContainerDataSource().getItem(itemId) | |||
.getItemProperty("i").getValue()); | |||
button.addListener(new Button.ClickListener() { | |||
button.addClickListener(new Button.ClickListener() { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
getMainWindow().showNotification("click"); | |||
Notification.show("click"); | |||
} | |||
}); | |||
return button; | |||
@@ -56,7 +58,7 @@ public class TreeTableOutOfSync extends TestBase { | |||
} | |||
@Override | |||
protected String getDescription() { | |||
protected String getTestDescription() { | |||
return "When a root node is expanded, components created by a column generator go out of sync"; | |||
} | |||
@@ -0,0 +1,61 @@ | |||
/* | |||
* 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.assertTrue; | |||
import java.util.List; | |||
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 opening the root node and clicking a generated component doesn't | |||
* cause out of sync (or any other system notifications). | |||
* | |||
* @author Vaadin Ltd | |||
*/ | |||
public class TreeTableOutOfSyncTest extends MultiBrowserTest { | |||
@Test | |||
public void testNotification() throws InterruptedException { | |||
openTestURL(); | |||
TreeTableElement treeTable = $(TreeTableElement.class).first(); | |||
List<WebElement> rows = treeTable.findElement( | |||
By.className("v-table-body")).findElements(By.tagName("tr")); | |||
WebElement treeSpacer = rows.get(0).findElement( | |||
By.className("v-treetable-treespacer")); | |||
treeSpacer.click(); | |||
sleep(100); | |||
rows = treeTable.findElement(By.className("v-table-body")) | |||
.findElements(By.tagName("tr")); | |||
WebElement button = rows.get(2).findElement(By.className("v-button")); | |||
button.click(); | |||
List<WebElement> notifications = findElements(By | |||
.className("v-Notification-system")); | |||
assertTrue(notifications.isEmpty()); | |||
} | |||
} |