diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-03 14:24:33 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-03 14:24:33 +0300 |
commit | 94f81dc79526a257451c6638a0696e7505227cb7 (patch) | |
tree | 13f094b896c74032ab86d079362a511f8ce478a1 /tests | |
parent | 406c50ad6cbe537ce709b8958272f93c919e9653 (diff) | |
parent | bc5831f069f648fbf0d89a863b28d80dc4c2bf35 (diff) | |
download | vaadin-framework-94f81dc79526a257451c6638a0696e7505227cb7.tar.gz vaadin-framework-94f81dc79526a257451c6638a0696e7505227cb7.zip |
Merge remote-tracking branch 'origin/6.8'
+ add @Override
Conflicts:
src/com/vaadin/terminal/gwt/client/Util.java
src/com/vaadin/terminal/gwt/client/ui/VOverlay.java
src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java
src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java
src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
src/com/vaadin/ui/LoginForm.java
src/com/vaadin/ui/Table.java
tests/test.xml
Diffstat (limited to 'tests')
6 files changed, 428 insertions, 1 deletions
diff --git a/tests/test.xml b/tests/test.xml index 222fe0a452..9b879ec789 100644 --- a/tests/test.xml +++ b/tests/test.xml @@ -11,7 +11,7 @@ <!-- Configuration --> <!-- ================================================================== --> <!-- Browsers to use for testing --> - <property name="browsers-windows" value="winxp-ie8,win7-ie9,winxp-firefox12,winxp-safari5,winxp-googlechrome19,winxp-opera11" /> + <property name="browsers-windows" value="winxp-ie8,win7-ie9,winxp-firefox12,winxp-safari5,winxp-googlechrome21,winxp-opera11" /> <property name="browsers-linux" value="linux-firefox3,linux-opera10,linux-googlechrome8" /> <property name="browsers-mac" value="osx-firefox3,osx-opera10,osx-googlechrome8,osx-safari4,osx-safari5" /> diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java index 1bc76fff1e..efba67199d 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java @@ -78,6 +78,7 @@ public abstract class AbstractFieldTest<T extends AbstractField<?>> extends MenuItem sortValueChangesItem = abstractField.addItem( "Show sorted value changes", new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { sortValueChanges = selectedItem.isChecked(); log("Show sorted value changes: " diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled new file mode 100644 index 0000000000..075bb3c57f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormInIframe.html_disabled @@ -0,0 +1,61 @@ +<?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>LoginFormTest</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">LoginFormTest</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/statictestfiles/LoginFormIframe.html</td> + <td></td> +</tr> +<tr> + <td>selectFrame</td> + <td>LoginForm</td> + <td></td> +</tr> +<tr> + <td>selectFrame</td> + <td>PID6</td> + <td></td> +</tr> +<tr> + <td>enterCharacter</td> + <td>username</td> + <td>username</td> +</tr> +<tr> + <td>enterCharacter</td> + <td>password</td> + <td>password</td> +</tr> +<tr> + <td>click</td> + <td>//form[@id='loginf']/div[5]/div/span/span</td> + <td></td> +</tr> +<tr> + <td>selectFrame</td> + <td>relative=top</td> + <td></td> +</tr> +<tr> + <td>selectFrame</td> + <td>LoginForm</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentsloginformLoginFormTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> + <td>User 'username', password='password' logged in</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.html b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.html new file mode 100644 index 0000000000..c41f3fbfdd --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.html @@ -0,0 +1,150 @@ +<?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.MultiSelectWithRemovedRow?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>34,9</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::PID_SLog_row_0</td> + <td>1. Selection: [Joe]</td> +</tr> +<!--Remove selection + shift select--> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>19,4:shift</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::PID_SLog_row_0</td> + <td>2. Selection: [William, Jack, Averell]</td> +</tr> +<!--Remove first + shift select--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> + <td>23,13</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td> + <td>26,10:shift</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::PID_SLog_row_0</td> + <td>3. Selection: [Jack, Averell, Bob]</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td> + <td>34,14:shift</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::PID_SLog_row_0</td> + <td>4. Selection: [William, Averell, Bob, Grat]</td> +</tr> +<!--Sort + shift select down--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[0]/domChild[0]</td> + <td>31,15</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td> + <td>36,11</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>30,6:shift</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::PID_SLog_row_0</td> + <td>5. Selection: [Bob, Emmett, Grat]</td> +</tr> +<!--Sort + shift select up--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td> + <td>24,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]</td> + <td>11,2</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td> + <td>30,11:shift</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>vaadin=runcomvaadintestscomponentstableMultiSelectWithRemovedRow::PID_SLog_row_0</td> + <td>6. Selection: [Grat, Emmett, Bob]</td> +</tr> +</tbody></table> +</body> +</html> diff --git a/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java new file mode 100644 index 0000000000..12ae4a3c4d --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java @@ -0,0 +1,93 @@ +package com.vaadin.tests.components.table; + +import java.util.Arrays; +import java.util.Collection; + +import com.vaadin.data.util.BeanItemContainer; +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Table; + +@SuppressWarnings("serial") +public class MultiSelectWithRemovedRow extends TestBase { + public static class Person { + private final String name; + + public Person(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + @Override + public String toString() { + return name; + } + } + + @Override + protected void setup() { + final Log log = new Log(5); + addComponent(log); + + final BeanItemContainer<Person> container = new BeanItemContainer<Person>( + Person.class, Arrays.asList(new Person("Joe"), new Person( + "William"), new Person("Jack"), new Person("Averell"), + new Person("Bob"), new Person("Grat"), new Person( + "Bill"), new Person("Emmett"))); + final Table table = new Table("Table", container); + table.setSelectable(true); + table.setMultiSelect(true); + table.setImmediate(true); + addComponent(table); + + Button showButton = new Button("Show selection"); + showButton.addListener(new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent clickEvent) { + Collection<?> selection = (Collection<?>) table.getValue(); + log.log("Selection: " + selection); + } + }); + addComponent(showButton); + + Button removeButton = new Button("Remove selection"); + removeButton.addListener(new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent clickEvent) { + Collection<?> selection = (Collection<?>) table.getValue(); + for (Object selected : selection) { + container.removeItem(selected); + } + } + }); + addComponent(removeButton); + + addComponent(new Button("Remove first selected row", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + Collection<?> selection = (Collection<?>) table + .getValue(); + if (!selection.isEmpty()) { + Object firstSelected = selection.iterator().next(); + container.removeItem(firstSelected); + } + } + })); + } + + @Override + protected String getDescription() { + return "Multi select using shift should work after removing the currently selected row"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(8584); + } +}
\ No newline at end of file diff --git a/tests/testbench/com/vaadin/tests/components/table/TableRowNoHeightNoRows.html b/tests/testbench/com/vaadin/tests/components/table/TableRowNoHeightNoRows.html new file mode 100644 index 0000000000..35d64c3a0c --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableRowNoHeightNoRows.html @@ -0,0 +1,122 @@ +<?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.Tables?restartApplication</td> + <td></td> +</tr> +<!--Remove all rows--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>29,11</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>40,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>53,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item0</td> + <td>4,6</td> +</tr> +<!--Add generated column--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>34,8</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item8</td> + <td>40,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item4</td> + <td>97,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item0</td> + <td>55,6</td> +</tr> +<!--Screenshot of initial state--> +<tr> + <td>screenCapture</td> + <td></td> + <td>1-no-rows-small</td> +</tr> +<!--Add a row to make the row height increase--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>23,5</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>26,1</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>68,10</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item1</td> + <td>18,13</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>2-one-row-big</td> +</tr> +<!--Remove the row - height should be retained--> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::PID_Smenu#item0</td> + <td>28,10</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>34,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>62,4</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstableTables::Root/VOverlay[2]/VMenuBar[0]#item0</td> + <td>25,4</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>3-no-rows-big</td> +</tr> + +</tbody></table> +</body> +</html> |