1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.widgets;
17
18 import org.junit.Test;
19 import org.kuali.rice.krad.demo.uif.library.DemoLibraryBase;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class DemoWidgetsDatePickerAft extends DemoLibraryBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-DatePickerView&methodToCall=start";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 navigateToLibraryDemo("Widgets", "DatePicker");
40 }
41
42 protected void testWidgetsDatePickerDefault() throws Exception {
43 selectByName("exampleShown","Default");
44
45
46 waitAndClick(By.cssSelector("img.ui-datepicker-trigger"));
47
48
49 waitAndClick(By.cssSelector(".ui-datepicker-current"));
50 }
51
52 protected void testWidgetsDatePickerWidget() throws Exception {
53 selectByName("exampleShown","Widget Input Only");
54 assertElementPresentByXpath("//input[@name='inputField1' and @readonly]");
55 waitAndClickByXpath("//div[@data-parent='Demo-DatePicker-Example2']/img");
56 waitAndClickByXpath("//button[@class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all']");
57 }
58
59 @Test
60 public void testWidgetsDatePickerBookmark() throws Exception {
61 testWidgetsDatePickerDefault();
62 testWidgetsDatePickerWidget();
63 driver.close();
64 passed();
65 }
66
67 @Test
68 public void testWidgetsDatePickerNav() throws Exception {
69 testWidgetsDatePickerDefault();
70 testWidgetsDatePickerWidget();
71 driver.close();
72 passed();
73 }
74 }