blob: 0eedf14b383a020b00b9c9bdef6946afb6846f6e (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
package com.vaadin.tests.elements.checkboxgroup;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import com.vaadin.testbench.elements.CheckBoxGroupElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class CheckBoxGroupSetSelectionTest extends MultiBrowserTest {
private static final String NEW_VALUE = "item2";
private CheckBoxGroupElement group;
@Before
public void init() {
openTestURL();
group = $(CheckBoxGroupElement.class).first();
}
@Test
public void testSetSelection() {
group.setValue(NEW_VALUE);
assertEquals(Collections.singletonList(NEW_VALUE), group.getValue());
}
@Test
public void testSelectByText() {
group.selectByText(NEW_VALUE);
assertEquals(Collections.singletonList(NEW_VALUE), group.getValue());
}
@Test
public void testSelectAll() {
List<String> value = Arrays.asList("item1", "item2", "item3");
group.setValue(value);
assertEquals(value, group.getValue());
}
@Test
public void testSelectNone() {
testSelectByText();
group.setValue();
assertEquals(Collections.emptyList(), group.getValue());
}
@Test
public void testDeselect() {
testSelectAll();
testSetSelection();
}
}
|