1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.maintenance;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverUtils;
20
21
22
23
24 public class LabsMaintenancePromptBeforeRoutingAft extends LabsMaintenanceBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/account?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&viewId=LabsMaintenance-PromptBeforeRoutingView";
30
31 @Override
32 protected String getBookmarkUrl() {
33 return BOOKMARK_URL;
34 }
35
36 @Override
37 protected void navigate() throws Exception {
38 navigateToMaintenance("Maintenance Sample - Prompt Before Routing");
39 waitAndClickByLinkText("Travel Account Maintenance prompting before routing on submit");
40 }
41
42 protected void testMaintenancePromptBeforeRouting() throws InterruptedException {
43
44 waitAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
45 waitAndTypeByName("document.newMaintainableObject.dataObject.number", uniqueString);
46 waitAndTypeByName("document.newMaintainableObject.dataObject.name", "Travel Account 14" + uniqueString);
47 waitAndClickByXpath("//input[@name='document.newMaintainableObject.dataObject.accountTypeCode' and @value='CAT']");
48 waitAndTypeByName("document.newMaintainableObject.dataObject.fiscalOfficer.principalName", "fred");
49 waitAndTypeByName("document.newMaintainableObject.dataObject.createDate", "04/09/2014");
50
51
52 waitAndClickSubmitByText();
53 waitAndClickConfirmSubmitOk();
54
55
56 waitAndClickByXpath("//div[@data-parent='TravelAccount-RouteConfirmationDialog']/button[contains(text(),'Yes')]");
57
58
59 waitForProgressLoading(WebDriverUtils.configuredImplicityWait());
60 Thread.sleep(500);
61 checkForDocError();
62 checkForDocErrorKrad();
63 waitForTextPresent("Document was successfully submitted.");
64 }
65
66 @Test
67 public void testMaintenancePromptBeforeRoutingBookmark() throws Exception {
68 testMaintenancePromptBeforeRouting();
69 passed();
70 }
71
72 @Test
73 public void testMaintenancePromptBeforeRoutingNav() throws Exception {
74 testMaintenancePromptBeforeRouting();
75 passed();
76 }
77 }