From 7b2c4418a606918e5af15185c87e1fe14bacd61e Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Mon, 28 Jan 2013 18:07:50 +0200 Subject: [PATCH] Merge of (#10609) to Vaadin 7. Automated test for #9986. Change-Id: I3ce8b61ac7efd8eaa7a1b16e786ce7c2edbad0a9 --- .../table/ValueAfterClearingContainer.html | 179 ++++++++++++++++++ .../table/ValueAfterClearingContainer.java | 84 +++++--- 2 files changed, 233 insertions(+), 30 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.html diff --git a/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.html b/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.html new file mode 100644 index 0000000000..3aecf8bf97 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.html @@ -0,0 +1,179 @@ + + + + + + +ValueAfterClearingContainer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ValueAfterClearingContainer
open/run/com.vaadin.tests.components.table.ValueAfterClearingContainer?restartApplication
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SaddItemsButton/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]40,13
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_01. Value changed to 2
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SremoveItemsFromTableButton/domChild[0]
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_02. Value changed to null
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SaddItemsButton/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]40,13
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_03. Value changed to 2
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SremoveItemsFromContainerButton/domChild[0]
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SshowValueButton/domChild[0]
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_04. Table selection: 2
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SaddItemsButton/domChild[0]
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SshowValueButton/domChild[0]
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_05. Table selection: 2
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SremoveItemsFromContainerAndSanitizeButton/domChild[0]
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_06. Value changed to null
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SaddItemsButton/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]40,13
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_07. Value changed to 2
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SremoveSelectedFromTableButton/domChild[0]
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_08. Value changed to null
mouseClickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]40,13
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_09. Value changed to 3
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SremoveSelectedFromContainer/domChild[0]
clickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SshowValueButton/domChild[0]
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_010. Table selection: 3
mouseClickvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_Stable/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]40,13
assertTextvaadin=runcomvaadintestscomponentstableValueAfterClearingContainer::PID_SLog_row_011. Value changed to 4
+ + diff --git a/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.java b/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.java index 93e7cafa99..f378c146ea 100644 --- a/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/ValueAfterClearingContainer.java @@ -19,6 +19,8 @@ public class ValueAfterClearingContainer extends TestBase { @Override protected void setup() { + log.setId("log"); + table.setId("table"); table.setSelectable(true); table.addContainerProperty(PROPERTY_ID, Integer.class, null); table.setImmediate(true); @@ -33,6 +35,7 @@ public class ValueAfterClearingContainer extends TestBase { addComponent(table); final CheckBox multiselect = new CheckBox("Multiselect"); multiselect.setImmediate(true); + multiselect.setId("multiselect"); multiselect.addValueChangeListener(new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { @@ -41,48 +44,64 @@ public class ValueAfterClearingContainer extends TestBase { } }); addComponent(multiselect); - addComponent(new Button("Add table items", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (!table.getItemIds().isEmpty()) { - Notification.show("Only possible when the table is empty"); - return; - } else { - for (int i = 0; i < 5; i++) { - table.addItem(new Object[] { Integer.valueOf(i) }, - Integer.valueOf(i)); + Button addItemsButton = new Button("Add table items", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + if (!table.getItemIds().isEmpty()) { + Notification + .show("Only possible when the table is empty"); + return; + } else { + for (int i = 0; i < 5; i++) { + table.addItem( + new Object[] { Integer.valueOf(i) }, + Integer.valueOf(i)); + } + } } - } - } - })); + }); + addItemsButton.setId("addItemsButton"); + addComponent(addItemsButton); - addComponent(new Button("Show value", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - log.log("Table selection: " + table.getValue()); - } - })); - - addComponent(new Button("Remove items from table", + Button showValueButton = new Button("Show value", new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + log.log("Table selection: " + table.getValue()); + } + }); + showValueButton.setId("showValueButton"); + addComponent(showValueButton); + + Button removeItemsFromTableButton = new Button( + "Remove items from table", new Button.ClickListener() { public void buttonClick(ClickEvent event) { table.removeAllItems(); } - })); + }); + removeItemsFromTableButton.setId("removeItemsFromTableButton"); + addComponent(removeItemsFromTableButton); - addComponent(new Button("Remove items from container", - new Button.ClickListener() { + Button removeItemsFromContainerButton = new Button( + "Remove items from container", new Button.ClickListener() { public void buttonClick(ClickEvent event) { table.getContainerDataSource().removeAllItems(); } - })); - addComponent(new Button("Remove items from container and sanitize", + }); + removeItemsFromContainerButton.setId("removeItemsFromContainerButton"); + addComponent(removeItemsFromContainerButton); + Button removeItemsFromContainerAndSanitizeButton = new Button( + "Remove items from container and sanitize", new Button.ClickListener() { public void buttonClick(ClickEvent event) { table.getContainerDataSource().removeAllItems(); table.sanitizeSelection(); } - })); - addComponent(new Button("Remove selected item from table", - new Button.ClickListener() { + }); + removeItemsFromContainerAndSanitizeButton + .setId("removeItemsFromContainerAndSanitizeButton"); + addComponent(removeItemsFromContainerAndSanitizeButton); + Button removeSelectedFromTableButton = new Button( + "Remove selected item from table", new Button.ClickListener() { public void buttonClick(ClickEvent event) { Object selection = table.getValue(); if (selection == null) { @@ -92,8 +111,11 @@ public class ValueAfterClearingContainer extends TestBase { table.removeItem(selection); } } - })); - addComponent(new Button("Remove selected item from container", + }); + removeSelectedFromTableButton.setId("removeSelectedFromTableButton"); + addComponent(removeSelectedFromTableButton); + Button removeSelectedFromContainer = new Button( + "Remove selected item from container", new Button.ClickListener() { public void buttonClick(ClickEvent event) { Object selection = table.getValue(); @@ -105,7 +127,9 @@ public class ValueAfterClearingContainer extends TestBase { .removeItem(selection); } } - })); + }); + removeSelectedFromContainer.setId("removeSelectedFromContainer"); + addComponent(removeSelectedFromContainer); } @Override -- 2.39.5