diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-06-03 15:19:48 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-06-03 12:48:14 +0000 |
commit | a4b2dc6caf82487903e583edfa30eec837bbb5b1 (patch) | |
tree | 46394475df55964ba695aabf20dfcd4881a3051d | |
parent | eed4059ca05483f7874f45bfbd876b6c2dfe4bb0 (diff) | |
download | vaadin-framework-a4b2dc6caf82487903e583edfa30eec837bbb5b1.tar.gz vaadin-framework-a4b2dc6caf82487903e583edfa30eec837bbb5b1.zip |
Fix broken Grid editor tests
Change-Id: Iaef796694f09983d208b63af5e211e74512ff7be
3 files changed, 10 insertions, 19 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java index 9f55d2adcb..606fe783d4 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorBufferedTest.java @@ -102,7 +102,7 @@ public class GridEditorBufferedTest extends GridEditorTest { assertFalse("Exception should not exist", isElementPresent(NotificationElement.class)); assertEquals("There should be no editor error message", null, - editor.getErrorMessage()); + getGridElement().getEditor().getErrorMessage()); } @Test diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java index ba6c29522b..dbb903ff98 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java @@ -38,6 +38,10 @@ import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest; public abstract class GridEditorTest extends GridBasicFeaturesTest { + protected static final By BY_EDITOR_CANCEL = By + .className("v-grid-editor-cancel"); + protected static final By BY_EDITOR_SAVE = By + .className("v-grid-editor-save"); protected static final String[] EDIT_ITEM_5 = new String[] { "Component", "Editor", "Edit item 5" }; protected static final String[] EDIT_ITEM_100 = new String[] { "Component", @@ -266,10 +270,10 @@ public abstract class GridEditorTest extends GridBasicFeaturesTest { } protected WebElement getSaveButton() { - return getDriver().findElement(By.className("v-grid-editor-save")); + return getDriver().findElement(BY_EDITOR_SAVE); } protected WebElement getCancelButton() { - return getDriver().findElement(By.className("v-grid-editor-cancel")); + return getDriver().findElement(BY_EDITOR_CANCEL); } } diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java index 80e273ff1d..90a4c8b0b1 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java @@ -22,7 +22,6 @@ import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; @@ -48,23 +47,11 @@ public class GridEditorUnbufferedTest extends GridEditorTest { assertEditorOpen(); - boolean saveButtonFound = true; - try { - getSaveButton(); - } catch (NoSuchElementException e) { - saveButtonFound = false; - } assertFalse("Save button should not be visible in unbuffered mode.", - saveButtonFound); - - boolean cancelButtonFound = true; - try { - getCancelButton(); - } catch (NoSuchElementException e) { - cancelButtonFound = false; - } + isElementPresent(BY_EDITOR_SAVE)); + assertFalse("Cancel button should not be visible in unbuffered mode.", - cancelButtonFound); + isElementPresent(BY_EDITOR_CANCEL)); } @Test |