diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-09-03 22:21:40 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2015-11-02 11:43:16 +0000 |
commit | 3688133b20f55174774191ee434c30465eb1a1b0 (patch) | |
tree | c1f63a2e905a190fdac9b8c511db48d444a4d5dd /uitest | |
parent | 1798cc8fcc4a17916ca72788c205f27d374ca63d (diff) | |
download | vaadin-framework-3688133b20f55174774191ee434c30465eb1a1b0.tar.gz vaadin-framework-3688133b20f55174774191ee434c30465eb1a1b0.zip |
Reset sort indicator when saving editor. (#17428)
Change-Id: Idaaf707bdb4178ff4ff5dfc7af853f08d5690b5e
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java index 3d0b3bb071..708c3a827d 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorUITest.java @@ -15,6 +15,9 @@ */ package com.vaadin.tests.components.grid; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -22,6 +25,7 @@ import org.junit.Test; import org.openqa.selenium.Keys; import org.openqa.selenium.interactions.Actions; +import com.vaadin.testbench.By; import com.vaadin.testbench.elements.GridElement; import com.vaadin.testbench.elements.GridElement.GridCellElement; import com.vaadin.testbench.elements.NotificationElement; @@ -32,11 +36,36 @@ import com.vaadin.tests.tb3.MultiBrowserTest; @TestCategory("grid") public class GridEditorUITest extends MultiBrowserTest { - @Test - public void testEditor() { + @Override + public void setup() throws Exception { + super.setup(); + setDebug(true); openTestURL(); + } + + private void openEditor(int rowIndex) { + GridElement grid = $(GridElement.class).first(); + + GridCellElement cell = grid.getCell(rowIndex, 1); + + new Actions(driver).moveToElement(cell).doubleClick().build().perform(); + } + + private void saveEditor() { + findElement(By.cssSelector(".v-grid-editor-save")).click(); + } + private GridCellElement getHeaderCell(int rowIndex, int colIndex) { + GridElement grid = $(GridElement.class).first(); + + GridCellElement headerCell = grid.getHeaderCell(rowIndex, colIndex); + + return headerCell; + } + + @Test + public void testEditor() { assertFalse("Sanity check", isElementPresent(PasswordFieldElement.class)); @@ -52,12 +81,15 @@ public class GridEditorUITest extends MultiBrowserTest { isElementPresent(NotificationElement.class)); } - private void openEditor(int rowIndex) { - GridElement grid = $(GridElement.class).first(); + @Test + public void savingResetsSortingIndicator() { + GridCellElement headerCell = getHeaderCell(0, 0); + headerCell.click(); - GridCellElement cell = grid.getCell(rowIndex, 1); + openEditor(1); - new Actions(driver).moveToElement(cell).doubleClick().build().perform(); - } + saveEditor(); + assertThat(headerCell.getAttribute("class"), not(containsString("sort"))); + } } |