]> source.dussan.org Git - vaadin-framework.git/blob
58a926546cb6f0271a8533e6ecf9c62bb6eaecc3
[vaadin-framework.git] /
1 package com.vaadin.tests.components.datefield;
2
3 import static org.junit.Assert.assertEquals;
4
5 import org.junit.Test;
6
7 import com.vaadin.testbench.elements.ButtonElement;
8 import com.vaadin.testbench.elements.DateFieldElement;
9 import com.vaadin.tests.tb3.MultiBrowserTest;
10
11 public class DateFieldMonthResolutionStatusChangeTest
12         extends MultiBrowserTest {
13
14     @Test
15     public void testChangeReadOnly() {
16         openTestURL();
17         DateFieldElement df = $(DateFieldElement.class).first();
18         assertEquals("Unexpected initial date.", "1/19", df.getValue());
19
20         // switch read-only state
21         $(ButtonElement.class).id("readOnly").click();
22
23         assertEquals("Unexpected date change.", "1/19", df.getValue());
24     }
25
26     @Test
27     public void testAddRange() {
28         openTestURL();
29         DateFieldElement df = $(DateFieldElement.class).first();
30         assertEquals("Unexpected initial date.", "1/19", df.getValue());
31
32         // add range
33         $(ButtonElement.class).id("addRange").click();
34
35         assertEquals("Unexpected date change.", "1/19", df.getValue());
36     }
37
38 }