summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2017-04-26 09:47:13 +0300
committerIlia Motornyi <elmot@vaadin.com>2017-04-26 08:47:13 +0200
commit2e5b49113439310d2dae9ec86fca3ccdf74833f5 (patch)
tree6f634ff2f15c5487da2602f67696866b49f2c0bf /uitest
parent38108cb43194117c0f1c8d950917002575946ae4 (diff)
downloadvaadin-framework-2e5b49113439310d2dae9ec86fca3ccdf74833f5.tar.gz
vaadin-framework-2e5b49113439310d2dae9ec86fca3ccdf74833f5.zip
Make TreeGrid follow framework style conventions
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java46
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java12
-rw-r--r--uitest/src/test/java/com/vaadin/tests/performance/MemoryIT.java1
3 files changed, 35 insertions, 24 deletions
diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java
index dd4546c6c0..a8328bd007 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridBasicFeaturesTest.java
@@ -123,13 +123,13 @@ public class TreeGridBasicFeaturesTest extends MultiBrowserTest {
// Should expand "0 | 0"
grid.getRow(0).getCell(0)
- .findElement(By.className("v-tree-grid-expander")).click();
+ .findElement(By.className("v-treegrid-expander")).click();
assertEquals(6, grid.getRowCount());
assertCellTexts(1, 0, new String[] { "1 | 0", "1 | 1", "1 | 2" });
// Should collapse "0 | 0"
grid.getRow(0).getCell(0)
- .findElement(By.className("v-tree-grid-expander")).click();
+ .findElement(By.className("v-treegrid-expander")).click();
assertEquals(3, grid.getRowCount());
assertCellTexts(0, 0, new String[] { "0 | 0", "0 | 1", "0 | 2" });
}
@@ -142,48 +142,58 @@ public class TreeGridBasicFeaturesTest extends MultiBrowserTest {
new Actions(getDriver()).sendKeys(Keys.RIGHT).perform();
assertEquals(6, grid.getRowCount());
assertCellTexts(1, 0, new String[] { "1 | 0", "1 | 1", "1 | 2" });
- assertTrue(grid.getRow(0).hasClassName("v-grid-rowmode-row-focused"));
- assertFalse(grid.getRow(1).hasClassName("v-grid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(0).hasClassName("v-treegrid-rowmode-row-focused"));
+ assertFalse(
+ grid.getRow(1).hasClassName("v-treegrid-rowmode-row-focused"));
// Should navigate 2 times down to "1 | 1"
new Actions(getDriver()).sendKeys(Keys.DOWN, Keys.DOWN).perform();
assertEquals(6, grid.getRowCount());
assertCellTexts(1, 0, new String[] { "1 | 0", "1 | 1", "1 | 2" });
- assertFalse(grid.getRow(0).hasClassName("v-grid-rowmode-row-focused"));
- assertFalse(grid.getRow(1).hasClassName("v-grid-rowmode-row-focused"));
- assertTrue(grid.getRow(2).hasClassName("v-grid-rowmode-row-focused"));
+ assertFalse(
+ grid.getRow(0).hasClassName("v-treegrid-rowmode-row-focused"));
+ assertFalse(
+ grid.getRow(1).hasClassName("v-treegrid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(2).hasClassName("v-treegrid-rowmode-row-focused"));
// Should expand "1 | 1" without moving focus
new Actions(getDriver()).sendKeys(Keys.RIGHT).perform();
assertEquals(9, grid.getRowCount());
assertCellTexts(2, 0,
new String[] { "1 | 1", "2 | 0", "2 | 1", "2 | 2", "1 | 2" });
- assertTrue(grid.getRow(2).hasClassName("v-grid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(2).hasClassName("v-treegrid-rowmode-row-focused"));
// Should collapse "1 | 1"
new Actions(getDriver()).sendKeys(Keys.LEFT).perform();
assertEquals(6, grid.getRowCount());
assertCellTexts(2, 0, new String[] { "1 | 1", "1 | 2", "0 | 1" });
- assertTrue(grid.getRow(2).hasClassName("v-grid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(2).hasClassName("v-treegrid-rowmode-row-focused"));
// Should navigate to "0 | 0"
new Actions(getDriver()).sendKeys(Keys.LEFT).perform();
assertEquals(6, grid.getRowCount());
assertCellTexts(0, 0,
new String[] { "0 | 0", "1 | 0", "1 | 1", "1 | 2", "0 | 1" });
- assertTrue(grid.getRow(0).hasClassName("v-grid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(0).hasClassName("v-treegrid-rowmode-row-focused"));
// Should collapse "0 | 0"
new Actions(getDriver()).sendKeys(Keys.LEFT).perform();
assertEquals(3, grid.getRowCount());
assertCellTexts(0, 0, new String[] { "0 | 0", "0 | 1", "0 | 2" });
- assertTrue(grid.getRow(0).hasClassName("v-grid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(0).hasClassName("v-treegrid-rowmode-row-focused"));
// Nothing should happen
new Actions(getDriver()).sendKeys(Keys.LEFT).perform();
assertEquals(3, grid.getRowCount());
assertCellTexts(0, 0, new String[] { "0 | 0", "0 | 1", "0 | 2" });
- assertTrue(grid.getRow(0).hasClassName("v-grid-rowmode-row-focused"));
+ assertTrue(
+ grid.getRow(0).hasClassName("v-treegrid-rowmode-row-focused"));
assertNoErrorNotifications();
}
@@ -191,25 +201,25 @@ public class TreeGridBasicFeaturesTest extends MultiBrowserTest {
@Test
public void changing_hierarchy_column() {
assertTrue(grid.getRow(0).getCell(0)
- .isElementPresent(By.className("v-tree-grid-expander")));
+ .isElementPresent(By.className("v-treegrid-expander")));
assertFalse(grid.getRow(0).getCell(1)
- .isElementPresent(By.className("v-tree-grid-expander")));
+ .isElementPresent(By.className("v-treegrid-expander")));
selectMenuPath("Component", "Features", "Set hierarchy column",
"depth");
assertFalse(grid.getRow(0).getCell(0)
- .isElementPresent(By.className("v-tree-grid-expander")));
+ .isElementPresent(By.className("v-treegrid-expander")));
assertTrue(grid.getRow(0).getCell(1)
- .isElementPresent(By.className("v-tree-grid-expander")));
+ .isElementPresent(By.className("v-treegrid-expander")));
selectMenuPath("Component", "Features", "Set hierarchy column",
"string");
assertTrue(grid.getRow(0).getCell(0)
- .isElementPresent(By.className("v-tree-grid-expander")));
+ .isElementPresent(By.className("v-treegrid-expander")));
assertFalse(grid.getRow(0).getCell(1)
- .isElementPresent(By.className("v-tree-grid-expander")));
+ .isElementPresent(By.className("v-treegrid-expander")));
}
@Override
diff --git a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java
index f37118a24b..f64591df53 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/treegrid/TreeGridHugeTreeNavigationTest.java
@@ -143,18 +143,18 @@ public class TreeGridHugeTreeNavigationTest extends MultiBrowserTest {
}
private WebElement findFocusedRow() {
- return grid.findElement(By.className("v-grid-rowmode-row-focused"));
+ return grid.findElement(By.className("v-treegrid-rowmode-row-focused"));
}
private void checkRowFocused(int index) {
if (index > 0) {
assertFalse(grid.getRow(index - 1)
- .hasClassName("v-grid-rowmode-row-focused"));
- }
- assertTrue(
- grid.getRow(index).hasClassName("v-grid-rowmode-row-focused"));
+ .hasClassName("v-treegrid-rowmode-row-focused"));
+ }
+ assertTrue(grid.getRow(index)
+ .hasClassName("v-treegrid-rowmode-row-focused"));
assertFalse(grid.getRow(index + 1)
- .hasClassName("v-grid-rowmode-row-focused"));
+ .hasClassName("v-treegrid-rowmode-row-focused"));
}
private void assertCellTexts(int startRowIndex, int cellIndex,
diff --git a/uitest/src/test/java/com/vaadin/tests/performance/MemoryIT.java b/uitest/src/test/java/com/vaadin/tests/performance/MemoryIT.java
index 0f4249b6ea..b30dcdae4f 100644
--- a/uitest/src/test/java/com/vaadin/tests/performance/MemoryIT.java
+++ b/uitest/src/test/java/com/vaadin/tests/performance/MemoryIT.java
@@ -108,6 +108,7 @@ public class MemoryIT extends SingleBrowserTest {
getDriver().get(StringUtils.strip(getBaseURL(), "/") + path + "?items="
+ itemsNumber);
Assert.assertTrue(isElementPresent(By.className("v-grid"))
+ || isElementPresent(By.className("v-treegrid"))
|| isElementPresent(By.className("v-table")));
}