|
|
@@ -17,6 +17,7 @@ package com.vaadin.tests.components.grid; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertFalse; |
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Test; |
|
|
@@ -56,14 +57,35 @@ public class GridColspansTest extends MultiBrowserTest { |
|
|
|
|
|
|
|
GridElement grid = $(GridElement.class).first(); |
|
|
|
assertEquals("Failed initial condition.", "all the stuff", |
|
|
|
grid.getHeaderCell(0, 1).getText().toLowerCase()); |
|
|
|
grid.getHeaderCell(0, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
assertEquals("Failed initial condition.", "first name", |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase()); |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
$(ButtonElement.class).caption("Show/Hide firstName").first().click(); |
|
|
|
assertEquals("Header text changed on column hide.", "all the stuff", |
|
|
|
grid.getHeaderCell(0, 1).getText().toLowerCase()); |
|
|
|
grid.getHeaderCell(0, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
assertEquals("Failed initial condition.", "last name", |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase()); |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testHideAndReAddFirstCOlumn() { |
|
|
|
openTestURL(); |
|
|
|
|
|
|
|
GridElement grid = $(GridElement.class).first(); |
|
|
|
|
|
|
|
assertEquals("Failed initial condition.", "first name", |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
|
|
|
|
$(ButtonElement.class).caption("Show/Hide firstName").first().click(); |
|
|
|
|
|
|
|
assertEquals("Failed initial condition.", "last name", |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
|
|
|
|
$(ButtonElement.class).caption("Show/Hide firstName").first().click(); |
|
|
|
|
|
|
|
assertEquals("Failed to find first name in last column", "first name", |
|
|
|
grid.getHeaderCell(2, 5).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
@@ -73,18 +95,18 @@ public class GridColspansTest extends MultiBrowserTest { |
|
|
|
GridElement grid = $(GridElement.class).first(); |
|
|
|
GridCellElement headerCell = grid.getHeaderCell(1, 1); |
|
|
|
assertEquals("Failed initial condition.", "full name", |
|
|
|
headerCell.getText().toLowerCase()); |
|
|
|
headerCell.getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
assertEquals("Failed initial condition.", "first name", |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase()); |
|
|
|
grid.getHeaderCell(2, 1).getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
$(ButtonElement.class).get(1).click(); |
|
|
|
headerCell = grid.getHeaderCell(1, 1); |
|
|
|
assertEquals("Joined Header text not changed on column reorder.", |
|
|
|
"misc", headerCell.getText().toLowerCase()); |
|
|
|
"misc", headerCell.getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
assertEquals("Unexpected colspan", "1", |
|
|
|
headerCell.getAttribute("colspan")); |
|
|
|
headerCell = grid.getHeaderCell(1, 2); |
|
|
|
assertEquals("Header text not changed on column reorder", "full name", |
|
|
|
headerCell.getText().toLowerCase()); |
|
|
|
headerCell.getText().toLowerCase(Locale.ENGLISH)); |
|
|
|
assertEquals("Unexpected colspan", "2", |
|
|
|
headerCell.getAttribute("colspan")); |
|
|
|
|