blob: d640959e124851237f2f080af8db7c4d18908f3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package com.vaadin.tests.components.grid;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import com.vaadin.testbench.By;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.LabelElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class GridSelectAllStatusTest extends MultiBrowserTest {
@Test
public void checkSelectAllStatus() {
openTestURL();
GridElement grid = $(GridElement.class).first();
LabelElement selectAllStatusLabel = $(LabelElement.class).id("status");
WebElement selectAllCheckbox = grid
.findElement(By.className("v-grid-select-all-checkbox"));
// select all
selectAllCheckbox.click();
assertTrue(
"The status of the select-all checkbox is expected to be True.",
Boolean.parseBoolean(selectAllStatusLabel.getText()));
// De-select all selections
selectAllCheckbox.click();
assertFalse(
"The status of the select-all checkbox is expected to be False.",
Boolean.parseBoolean(selectAllStatusLabel.getText()));
}
}
|