1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.testtools.selenium;
17
18 import org.apache.commons.lang.RandomStringUtils;
19 import org.junit.Before;
20 import org.kuali.rice.testtools.common.JiraAwareFailable;
21 import org.kuali.rice.testtools.common.JiraAwareFailureUtils;
22 import org.kuali.rice.testtools.common.PropertiesUtils;
23 import org.openqa.selenium.By;
24 import org.openqa.selenium.WebElement;
25
26 import java.io.IOException;
27 import java.text.SimpleDateFormat;
28 import java.util.ArrayList;
29 import java.util.Calendar;
30 import java.util.HashMap;
31 import java.util.List;
32 import java.util.Map;
33 import java.util.concurrent.TimeUnit;
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 public abstract class WebDriverLegacyITBase extends WebDriverAftBase {
58
59
60
61
62 public static final String ADMINISTRATION_LINK_TEXT = "Administration";
63
64
65
66
67 public static final String AGENDA_LOOKUP_LINK_TEXT = "Agenda Lookup";
68
69
70
71
72 public static final String BACKDOOR_ID_TEXT = "backdoorId";
73
74
75
76
77 public static final String BACKDOOR_LOGIN_BUTTON_XPATH = "//input[@title='Click to login.']";
78
79
80
81
82 public static final String BLANKET_APPROVE_NAME = "methodToCall.blanketApprove";
83
84
85
86
87
88 public static final String CANCEL_NAME = "methodToCall.cancel";
89
90
91
92
93
94 public static final String CANCEL2_XPATH = "//a[contains(text(), 'ancel')]";
95
96
97
98
99 public static final String CANCEL3_XPATH = "//a[@title='cancel']";
100
101
102
103
104 public static final String CLOSE_WINDOW_XPATH_TITLE = "//*[@title='close this window']";
105
106
107
108
109 public static final String COLLECTIONS_LINK_TEXT = "Collections";
110
111
112
113
114 public static final String CONFIGURATION_VIEW_WINDOW_TITLE = "Kuali :: Configuration Test View";
115
116
117
118
119 public static final String CONFIGURATION_VIEW_XPATH = "(//a[contains(text(),'Configuration Test View')])";
120
121
122
123
124 public static final String COPY_LINK_TEXT = "copy";
125
126
127
128
129 public static final String CREATE_NEW_DOCUMENT_NOT_SUBMITTED_SUCCESSFULLY_MESSAGE_TEXT = "New Document not submitted successfully";
130
131
132
133
134 public static final String CREATE_NEW_XPATH = "//img[@alt='create new']";
135
136
137
138
139 public static final String CREATE_NEW_XPATH2 = "//a[@title='Create a new record']";
140
141
142
143
144 public static final String DATA_TABLE_TR_CSS = "div.dataTables_wrapper tbody tr";
145
146
147
148
149 public static final String DIV_LEFT_ERRMSG = "//div[@class='left-errmsg-tab']/div/div";
150
151
152
153
154 public static final String DOC_CODE_XPATH = "//input[@id='document.newMaintainableObject.code']";
155
156
157
158
159 public static final String DOC_ID_XPATH = "//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]";
160
161
162
163
164 public static final String DOC_ID_XPATH_2 = "//table[@id='row']/tbody/tr[1]/td[1]";
165
166
167
168
169 public static final String DOC_ID_XPATH_3 ="//table[@id='row']/tbody/tr[1]/td[1]/a";
170
171
172
173
174 public static final String DOC_DESCRIPTION_XPATH ="//input[@id='document.documentHeader.documentDescription']";
175
176
177
178
179 public static final String DOC_INITIATOR_XPATH = "//div[@id='headerarea']/div/table/tbody/tr[2]/td[1]";
180
181
182
183
184 public static final String DOC_SEARCH_XPATH = "//img[@alt='doc search']";
185
186
187
188
189 public static final String DOC_SEARCH_XPATH_TITLE = "//a[@title='Document Search']";
190
191
192
193
194 public static final String DOC_STATUS_ENROUTE = "ENROUTE";
195
196
197
198
199 public static final String DOC_STATUS_FINAL = "FINAL";
200
201
202
203
204 public static final String DOC_STATUS_SAVED = "SAVED";
205
206
207
208
209 public static final String DOC_STATUS_XPATH = "//table[@class='headerinfo']//tr[1]/td[2]";
210
211
212
213
214 public static final String DOC_STATUS_XPATH_2 = "//table[@id='row']/tbody/tr[1]/td[4]";
215
216
217
218
219 public static final String DOC_SUBMIT_SUCCESS_MSG_XPATH ="//div[contains(div,'Document was successfully submitted.')]";
220
221
222
223
224 public static final String EDIT_LINK_TEXT = "edit";
225
226
227
228
229 public static final String IFRAMEPORTLET_NAME = "iframeportlet";
230
231
232
233
234 public static final String KITCHEN_SINK_XPATH = "(//a[contains(text(),'Uif Components (Kitchen Sink)')])";
235
236
237
238
239 public static final String KRAD_XPATH = "KRAD";
240
241
242
243
244 public static final String KUALI_COLLECTION_TOTALLING_WINDOW_XPATH = "Kuali :: Collection Totaling";
245
246
247
248
249 public static final String KUALI_COLLECTION_TOTALLING_XPATH = "//a[text()='Collection Totaling']";
250
251
252
253
254 public static final String KUALI_UIF_COMPONENTS_WINDOW_XPATH = "Kuali :: Uif Components";
255
256
257
258
259 public static final String KUALI_VIEW_WINDOW_TITLE = "Kuali :: View Title";
260
261
262
263
264 public static final String LABEL_KUALI_KUALI_SYSTEMS = "KUALI - Kuali Systems";
265
266
267
268
269 public static final String LABEL_KUALI_DEFAULT = "KUALI : Default";
270
271
272
273
274 public static final String LOGOUT_XPATH = "//input[@name='imageField' and @value='Logout']";
275
276
277
278
279 public static final String MAIN_MENU_LINK_TEXT = "Main Menu";
280
281
282
283
284 public static final String RICH_MESSAGES_WINDOW_TITLE = "Kuali :: Rich Messages";
285
286
287
288
289 public static final String SAVE_SUCCESSFUL_XPATH = "//div[contains(div,'Document was successfully saved.')]";
290
291
292
293
294 public static final String SAVE_XPATH="//input[@name='methodToCall.save' and @alt='save']";
295
296
297
298
299
300 public static final String SAVE_XPATH_2 = "//*[@name='methodToCall.save' and @alt='save']";
301
302
303
304
305 public static final String SAVE_XPATH_3 = "//input[@title='search' and @name='methodToCall.search']";
306
307
308
309
310 public static final String SEARCH = "Search";
311
312
313
314
315 public static final String SEARCH_XPATH="//input[@name='methodToCall.search' and @value='search']";
316
317
318
319
320 public static final String SEARCH_XPATH_2 = "//input[@value='search']";
321
322
323
324
325 public static final String SEARCH_SECOND = "(//input[@name='methodToCall.search'])[2]";
326
327
328
329
330 public static final String SUBMIT_XPATH="//input[@name='methodToCall.route' and @alt='submit']";
331
332
333
334
335 public static final String TRAVEL_ACCOUNT_LOOKUP_LINK_TEXT = "Travel Account Lookup";
336
337
338
339
340 public static final String UIF_COMPONENTS_KITCHEN_SINK_LINK_TEXT = "Uif Components (Kitchen Sink)";
341
342
343
344
345 public static final String VALIDATION_FRAMEWORK_DEMO_XPATH = "(//a[contains(text(),'Validation Framework Demo')])";
346
347
348
349
350 public static final String XML_INGESTER_LINK_TEXT = "XML Ingester";
351
352
353
354
355 public static final String FISCAL_OFFICER_INFO_MAINTENANCE_NEW_XPATH = "//a[@title='FiscalOfficerInfo Maintenance (New)']";
356
357 static {
358 if (System.getProperty(WebDriverUtils.REMOTE_PROPERTIES_PROPERTY) != null) {
359 PropertiesUtils propUtils = new PropertiesUtils();
360 try {
361 propUtils.loadPropertiesWithSystemAndOverridesIntoSystem(System.getProperty(WebDriverUtils.REMOTE_PROPERTIES_PROPERTY));
362 } catch (IOException ioe) {
363 System.out.println("Exception opening " + System.getProperty(WebDriverUtils.REMOTE_PROPERTIES_PROPERTY) + " " + ioe.getMessage());
364 }
365 }
366 }
367
368 protected String namespaceCode = "KR-WKFLW";
369
370 protected String uiFramework = AutomatedFunctionalTestUtils.REMOTE_UIF_KNS;
371
372 protected String uniqueString;
373
374 private static final Map<String, String> actionRequestLabelMap;
375 private static Map<String, String> actionRequestButtonMap;
376 static{
377 actionRequestLabelMap = new HashMap();
378 actionRequestLabelMap.put("A","APPROVE");
379 actionRequestLabelMap.put("F","FYI");
380 actionRequestLabelMap.put("C","COMPLETE");
381 actionRequestLabelMap.put("CR","COMPLETE");
382 actionRequestLabelMap.put("K","ACKNOWLEDGE");
383 actionRequestLabelMap.put("D","APPROVE");
384 actionRequestButtonMap = new HashMap();
385 actionRequestButtonMap.put("A","methodToCall.approve");
386 actionRequestButtonMap.put("F","methodToCall.fyi");
387 actionRequestButtonMap.put("C","methodToCall.complete");
388 actionRequestButtonMap.put("CR","methodToCall.route");
389 actionRequestButtonMap.put("K","methodToCall.acknowledge");
390 actionRequestButtonMap.put("D","methodToCall.disapprove");
391 }
392
393
394
395
396
397
398
399 @Before
400 public void testSetUp() {
401 super.testSetUp();
402 }
403
404
405
406
407
408 @Override
409 protected String getTestUrl() {
410 String testUrl = super.getTestUrl();
411 if (testUrl.contains(AutomatedFunctionalTestUtils.HIDE_RETURN_LINK) &&
412 !testUrl.contains("&showMaintenanceLinks=true")) {
413 testUrl += "&showMaintenanceLinks=true";
414 }
415 return testUrl;
416 }
417
418
419 protected void impersonateUser(String user) throws InterruptedException {
420 waitAndTypeByName(BACKDOOR_ID_TEXT,user);
421 jGrowl("Click Backdoor Login");
422 waitAndClickByXpath(BACKDOOR_LOGIN_BUTTON_XPATH);
423 }
424
425 protected void addAdHocRecipientsGroup(String[] adHocRecipients) throws InterruptedException {
426 addAdHocRecipientsGroup(new String[][]{adHocRecipients});
427 }
428
429 protected void addAdHocRecipientsGroup(String[][] adHocRecipients) throws InterruptedException {
430 String today = getDateToday();
431 Calendar nextYearCal = Calendar.getInstance();
432 nextYearCal.add(Calendar.YEAR, 1);
433 SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
434 String nextYear = sdf.format(nextYearCal.getTime());
435
436 waitAndClickByName("methodToCall.toggleTab.tabAdHocRecipients");
437 for (int i = 0, s = adHocRecipients.length; i < s; i++) {
438 selectOptionByName("newAdHocRouteWorkgroup.actionRequested", adHocRecipients[i][1]);
439 waitAndTypeByName("newAdHocRouteWorkgroup.recipientName", adHocRecipients[i][0]);
440 waitAndTypeByName("newAdHocRouteWorkgroup.recipientNamespaceCode", adHocRecipients[i][2]);
441 WebDriverUtils.jGrowl(getDriver(), "Click Add Group", false, "Click Add Group");
442 waitAndClickByName("methodToCall.insertAdHocRouteWorkgroup");
443 }
444 }
445
446
447
448
449
450 protected void addAdHocRecipientsPerson(String[] adHocRecipients) throws InterruptedException {
451 addAdHocRecipientsPerson(new String[][]{adHocRecipients});
452 }
453
454
455
456
457
458 protected void addAdHocRecipientsPerson(String[][] adHocRecipients) throws InterruptedException {
459 String today = getDateToday();
460 Calendar nextYearCal = Calendar.getInstance();
461 nextYearCal.add(Calendar.YEAR, 1);
462 SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
463 String nextYear = sdf.format(nextYearCal.getTime());
464
465 waitAndClickByName("methodToCall.toggleTab.tabAdHocRecipients");
466 for (int i = 0, s = adHocRecipients.length; i < s; i++) {
467 selectOptionByName("newAdHocRoutePerson.actionRequested", adHocRecipients[i][1]);
468 waitAndTypeByName("newAdHocRoutePerson.id", adHocRecipients[i][0]);
469
470
471
472
473
474
475 WebDriverUtils.jGrowl(getDriver(), "Click Add Person", false, "Click Add Person");
476 waitAndClickByName("methodToCall.insertAdHocRoutePerson");
477 }
478 }
479
480 protected void agendaLookupAssertions() throws Exception {
481 testLookUp();
482 assertTextPresent("Rules");
483 waitAndClick(By.xpath(CANCEL2_XPATH));
484 }
485
486 protected void assertActionList(String docId, String actionListOptionValue, String state) throws InterruptedException {
487 selectTopFrame();
488 waitAndClickActionList();
489 selectFrameIframePortlet();
490 while (!waitForIsTextPresent(docId)) {
491 waitAndClickByLinkText("Next");
492 }
493 WebElement docIdTr = findElement(By.xpath("//table/tbody/tr/td/a[contains(text(), '" + docId + "')]/../.."));
494 assertTrue(docIdTr.getText() + " does not contain " + docId, docIdTr.getText().contains(docId));
495 assertTrue(docIdTr.getText() + " does not contain " + state, docIdTr.getText().contains(state));
496 assertTrue(docIdTr.getText() + " does not contain " + actionRequestLabelMap.get(actionListOptionValue), docIdTr.getText().contains(actionRequestLabelMap.get(actionListOptionValue)));
497
498 waitAndClickLinkContainingText(docId);
499 selectChildWindow();
500 waitAndClickByName(actionRequestButtonMap.get(actionListOptionValue));
501
502
503 if ("D".equals(actionListOptionValue)) {
504 waitAndTypeByName("reason","disapproved for AFT");
505 jGrowl("Click yes button");
506 waitAndClickByName("methodToCall.processAnswer.button0");
507 } else if ("C".equals(actionListOptionValue) || "CR".equals(actionListOptionValue)) {
508 waitAndClickByName("methodToCall.close");
509 }
510 waitForTextNotPresent(docId);
511 }
512
513 protected void assertNotInActionList(String docId) throws InterruptedException {
514 selectTopFrame();
515 waitAndClickActionList();
516 selectFrameIframePortlet();
517 waitForTextNotPresent(docId);
518 while (isElementPresentByLinkText("Next")) {
519 waitAndClickByLinkText("Next");
520 waitForTextNotPresent(docId);
521 }
522 }
523
524 protected void assertOutbox(String docId, String state) throws InterruptedException {
525
526 waitAndClickLinkContainingText("Outbox");
527 while (!waitForIsTextPresent(docId)) {
528 waitAndClickByLinkText("Next");
529 }
530 WebElement docIdTr = findElement(By.xpath("//table/tbody/tr/td/a[contains(text(), '" + docId + "')]/../.."));
531 assertTrue("Outbox items " + docIdTr.getText() + " does not contain " + docId, docIdTr.getText().contains(docId));
532 assertTrue("Outbox items " + docIdTr.getText() + " state is incorrect " + state, docIdTr.getText().contains(state));
533 waitForTextPresent(docId);
534
535
536
537
538 }
539
540 protected void assertBlanketApproveButtonsPresent() {
541 assertElementPresentByName("methodToCall.route");
542 assertElementPresentByName("methodToCall.save");
543 assertElementPresentByName(BLANKET_APPROVE_NAME, "Blanket Approve button not present does " + user + " have permssion?");
544 assertElementPresentByName("methodToCall.close");
545 assertElementPresentByName(CANCEL_NAME);
546 }
547
548 protected void assertDocFinal(String docId) throws InterruptedException {
549 assertDocSearch(docId, DOC_STATUS_FINAL);
550 }
551
552 protected void assertDocSearch(String docId, String docStatus) throws InterruptedException {
553 docSearch(docId);
554 waitForElementPresentByXpath(DOC_ID_XPATH_3);
555 jGrowl("Is doc status for docId: " + docId + " " + docStatus + "?");
556 assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
557 assertEquals(docStatus, getTextByXpath(DOC_STATUS_XPATH_2));
558 }
559
560 private void docSearch(String docId) throws InterruptedException {
561 selectParentWindow();
562 selectTopFrame();
563 waitAndClickDocSearchTitle();
564 waitForPageToLoad();
565 selectFrameIframePortlet();
566 waitAndTypeByName("documentId", docId);
567 waitAndClickSearch();
568 }
569
570 protected void assertDocSearchNoResults(String docId) throws InterruptedException {
571 docSearch(docId);
572 waitForTextPresent("No values match this search.");
573 }
574
575 protected void assertTableLayout() throws Exception {
576 waitForTextPresent("Actions");
577 String pageSource = driver.getPageSource();
578 assertTrue(pageSource.contains("Table Layout"));
579 assertTrue(pageSource.contains("Field 1"));
580 assertTrue(pageSource.contains("Field 2"));
581 assertTrue(pageSource.contains("Field 3"));
582 assertTrue(pageSource.contains("Field 4"));
583 assertTrue(pageSource.contains("Actions"));
584 }
585
586 private void blanketApproveAssert(String docId) throws InterruptedException {
587 checkForDocError();
588 assertDocSearch(docId, DOC_STATUS_FINAL);
589 }
590
591 protected void blanketApproveCheck() throws InterruptedException {
592 waitAndClickByName(BLANKET_APPROVE_NAME,
593 "No blanket approve button does the user " + getUserName() + " have permission?");
594 checkForIncidentReport();
595 }
596
597
598
599
600
601
602
603
604 protected void blanketApproveTest(String docId) throws InterruptedException {
605 jGrowl("Click Blanket Approve");
606 waitAndClickByName(BLANKET_APPROVE_NAME,
607 "No blanket approve button does the user " + getUserName() + " have permission?");
608 Thread.sleep(2000);
609 checkForIncidentReport();
610 blanketApproveAssert(docId);
611 }
612
613 protected void checkErrorMessageItem(String message) {
614 final String error_locator = "//li[@class='uif-errorMessageItem']";
615 assertElementPresentByXpath(error_locator);
616 String errorText = null;
617
618 try {
619 errorText = getTextByXpath(error_locator);
620 } catch (InterruptedException e) {
621 e.printStackTrace();
622 }
623
624 if (errorText != null && errorText.contains("errors")) {
625 jiraAwareFail(errorText + message);
626 }
627 }
628
629
630
631
632 public void checkForDocError() {
633 if (hasDocError()) {
634 String errorText = extractErrorText();
635 jiraAwareFail(errorText);
636 }
637 }
638
639 protected String extractErrorText() {
640 String errorText = driver.findElement(By.xpath(AutomatedFunctionalTestUtils.DIV_ERROR_LOCATOR)).getText();
641 errorText = AutomatedFunctionalTestUtils.blanketApprovalCleanUpErrorText(errorText);
642 if (driver.findElements(By.xpath(AutomatedFunctionalTestUtils.DIV_EXCOL_LOCATOR)).size() > 0) {
643 errorText = AutomatedFunctionalTestUtils.blanketApprovalCleanUpErrorText(driver.findElement(
644
645 By.xpath(AutomatedFunctionalTestUtils.DIV_EXCOL_LOCATOR)).getText());
646 }
647 if (driver.findElements(By.xpath(DIV_LEFT_ERRMSG)).size() > 0) {
648 errorText = errorText + AutomatedFunctionalTestUtils.blanketApprovalCleanUpErrorText(driver.findElement(
649 By.xpath(DIV_LEFT_ERRMSG)).getText());
650 }
651 return errorText;
652 }
653
654
655
656
657
658 public boolean hasDocError() {
659 if (driver.findElements(By.xpath(AutomatedFunctionalTestUtils.DIV_ERROR_LOCATOR)).size() > 0) {
660 String errorText = driver.findElement(By.xpath(AutomatedFunctionalTestUtils.DIV_ERROR_LOCATOR)).getText();
661 if (errorText != null && errorText.contains("error(s) found on page.")) {
662 return true;
663 }
664 }
665 return false;
666 }
667
668
669
670
671
672
673 public boolean hasDocError(String errorTextToMatch) {
674 if (driver.findElements(By.xpath(AutomatedFunctionalTestUtils.DIV_ERROR_LOCATOR)).size() > 0) {
675 String errorText = driver.findElement(By.xpath(AutomatedFunctionalTestUtils.DIV_ERROR_LOCATOR)).getText();
676 if (errorText != null && errorText.contains("error(s) found on page.")) {
677 WebElement errorDiv = driver.findElement(By.xpath("//div[@class='left-errmsg']/div[2]/div")); // don't highlight
678 if (errorDiv != null) {
679 errorText = errorDiv.getText();
680 return errorText != null && errorText.contains(errorTextToMatch);
681 }
682 }
683 }
684 return false;
685 }
686
687 protected String configNameSpaceBlanketApprove() throws Exception {
688 String docId = waitForDocId();
689 String dtsPlusTwoChars = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
690 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Namespace " + AutomatedFunctionalTestUtils
691 .createUniqueDtsPlusTwoRandomCharsNot9Digits());
692 assertBlanketApproveButtonsPresent();
693 waitAndTypeByXpath(DOC_CODE_XPATH, "VTN" + dtsPlusTwoChars);
694 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']",
695 "Validation Test NameSpace " + dtsPlusTwoChars);
696 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.applicationId']", "RICE");
697
698 return docId;
699 }
700
701 protected void contextLookupAssertions() throws Exception {
702 testLookUp();
703 assertTextPresent("Notes and Attachments");
704 waitAndClick(By.xpath(CANCEL2_XPATH));
705 }
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737 protected void expandColapseByXpath(String clickLocator, String visibleLocator) throws InterruptedException {
738 waitAndClickByXpath(clickLocator);
739 waitIsVisibleByXpath(visibleLocator);
740 waitAndClickByXpath(clickLocator);
741 waitNotVisibleByXpath(visibleLocator);
742 }
743
744 protected String getDescriptionBase() {
745 return this.getClass().toString().substring(this.getClass().toString().lastIndexOf(".") + 1,
746 this.getClass().toString().length()) +
747 "." + testMethodName + " description";
748 }
749
750 protected String getDescriptionUnique() {
751 if (uniqueString == null) {
752 uniqueString = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
753 }
754 return getDescriptionBase() + " " + uniqueString;
755 }
756
757 protected String getDocStatus() {
758 return findElement(By.xpath(DOC_STATUS_XPATH_2)).getText();
759 }
760
761
762
763
764
765
766
767
768
769 protected void gotoNestedFrame() {
770 driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
771 driver.switchTo().defaultContent();
772 final String iframeXpath = "//iframe";
773
774 gotoIframeByXpath(iframeXpath);
775
776 gotoIframeByXpath(iframeXpath);
777
778 driver.manage().timeouts().implicitlyWait(waitSeconds, TimeUnit.SECONDS);
779 }
780
781 @Override
782 protected void logout() throws InterruptedException {
783 selectTopFrame();
784 if (isElementPresentByXpath(LOGOUT_XPATH)) {
785 waitAndClickLogout(this);
786 }
787 }
788
789 protected boolean noAffilication() {
790 return !isElementPresentByName("document.affiliations[0].dflt");
791 }
792
793 protected void selectFrameIframePortlet() {
794 selectFrame(IFRAMEPORTLET_NAME);
795 }
796
797 protected void selectFrame(String locator) {
798
799 if (IFRAMEPORTLET_NAME.equals(locator)) {
800 gotoNestedFrame();
801 } else {
802 WebDriverUtils.selectFrameSafe(driver, locator);
803 }
804 }
805
806
807 protected void testAddingNamespace() throws Exception {
808 testAddingNamespace(this);
809 }
810
811
812 protected void testAddingNamespace(JiraAwareFailable failable) throws Exception {
813 selectFrameIframePortlet();
814 waitAndCreateNew();
815 waitForElementPresentByXpath(SAVE_XPATH_2, "save button does not exist on the page");
816
817
818 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding PEANUTS");
819 waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM");
820 waitAndTypeByXpath(DOC_CODE_XPATH, "PEANUTS");
821 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", "The Peanuts Gang");
822 checkByXpath("//input[@id='document.newMaintainableObject.active']");
823 waitAndClickByXpath(SAVE_XPATH_2);
824 waitForElementPresentByXpath(SAVE_SUCCESSFUL_XPATH, "Document is not saved successfully");
825
826
827 assertEquals(DOC_STATUS_SAVED, findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
828 assertEquals("admin", findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
829 }
830
831 protected void testAddingBrownGroup() throws Exception {
832 selectFrameIframePortlet();
833 waitAndCreateNew();
834 String docId = waitForDocId();
835 String random = RandomStringUtils.randomNumeric(4);
836 String organizationDocumentNumber = "ORD" + random;
837 String groupDescription = "GD" + random;
838 String groupName = "BrownGroup " + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
839 String nameSpace = "KR-IDM";
840 String today = getDateToday();
841 Calendar nextYearCal = Calendar.getInstance();
842 nextYearCal.add(Calendar.YEAR, 1);
843 SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
844 String nextYear = sdf.format(nextYearCal.getTime());
845
846
847 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Brown Group");
848 waitAndTypeByName("document.documentHeader.explanation", "I want to add Brown Group to test KIM");
849 waitAndTypeByName("document.documentHeader.organizationDocumentNumber", organizationDocumentNumber);
850 selectOptionByName("document.groupNamespace", nameSpace);
851 waitAndTypeByName("document.groupName", groupName);
852 waitAndTypeByName("document.groupDescription", groupDescription);
853
854
855 addAdHocRecipientsPerson(new String[]{"dev1", "F"});
856
857
858 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.group.GroupBo!!).(((namespaceCode:newAdHocRouteWorkgroup.recipientNamespaceCode,name:newAdHocRouteWorkgroup.recipientName))).((`newAdHocRouteWorkgroup.recipientNamespaceCode:namespaceCode,newAdHocRouteWorkgroup.recipientName:name`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
859 waitForElementPresentByXpath(SEARCH_XPATH);
860 selectOptionByName("namespaceCode", nameSpace);
861 waitAndClickSearch();
862 Thread.sleep(2000);
863 String adHocWrkGrp = null;
864 if (isTextPresent("No values match this search.")) {
865 waitAndClickByXpath(CANCEL3_XPATH);
866 } else {
867 waitAndClickReturnValue();
868 waitAndClickByName("methodToCall.insertAdHocRouteWorkgroup");
869 adHocWrkGrp = findElement(By.name("adHocRouteWorkgroup[0].recipientName")).getAttribute("value");
870 }
871
872 checkByName("document.active");
873 waitAndClickByXpath(SAVE_XPATH_2);
874 waitForTextPresent("Document was successfully saved.");
875
876
877 assertEquals(DOC_STATUS_SAVED, findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
878 assertEquals("admin", findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
879 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
880 waitAndClickSearch();
881 String adHocPerson = waitForElementPresentByXpath("//table[@id='row']/tbody/tr/td[2]/a").getText();
882 waitAndClickReturnValue();
883 waitAndClickByName("methodToCall.addMember.anchorAssignees");
884 waitAndClickSave();
885 waitAndClickSubmit();
886 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
887 selectTopFrame();
888
889
890 docSearch(docId);
891 waitAndClickByLinkText(docId);
892 switchToWindow("Kuali :: Group");
893 assertTextPresent(new String[]{"Adding Brown Group", "I want to add Brown Group to test KIM", organizationDocumentNumber});
894 waitAndClickByName("methodToCall.close");
895
896 waitAndClickByLinkText("Administration");
897 waitAndClickByLinkText("Group");
898 selectFrameIframePortlet();
899 waitAndTypeByName("name", groupName);
900 waitAndClickSearch();
901 waitForElementPresent(By.linkText(groupName), docId + " with groupName "+ groupName + " not present!");
902 waitAndClickByLinkText("edit");
903 waitAndClickByName("methodToCall.showAllTabs");
904 assertTextPresent(new String[]{adHocPerson, groupDescription, nameSpace, groupName});
905 }
906
907 protected void testAttributeDefinitionLookUp() throws Exception {
908 waitForPageToLoad();
909 selectFrameIframePortlet();
910 waitAndClickByXpath("//button[contains(.,'earch')]");
911 Thread.sleep(3000);
912 waitForPageToLoad();
913 findElement(By.tagName("body")).getText().contains("Actions");
914 waitAndClickByLinkText("1000");
915 waitForPageToLoad();
916 findElement(By.tagName("body")).getText().contains("Attribute Inquiry");
917 findElement(By.tagName("body")).getText().contains("KRMS Attributes");
918 findElement(By.tagName("body")).getText().contains("Attribute Label");
919 findElement(By.tagName("body")).getText().contains("1000");
920 findElement(By.tagName("body")).getText().contains("peopleFlowId");
921 findElement(By.tagName("body")).getText().contains("KR-RULE");
922 findElement(By.tagName("body")).getText().contains("PeopleFlow");
923
924
925
926
927
928
929
930
931
932
933
934
935
936 passed();
937 }
938
939 protected void testCancelConfirmation() throws InterruptedException {
940 waitAndCancelConfirmation();
941 passed();
942 }
943
944 protected void testConfigParamaterBlanketApprove() throws Exception {
945 selectFrameIframePortlet();
946 waitAndCreateNew();
947 String docId = waitForDocId();
948 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Parameter ");
949 assertBlanketApproveButtonsPresent();
950 assertEquals("", getTextByName(CANCEL_NAME));
951 selectByXpath("//select[@id='document.newMaintainableObject.namespaceCode']", "KR-NS - Kuali Nervous System");
952 String componentLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.coreservice.impl.component.ComponentBo!!).(((code:document.newMaintainableObject.componentCode,namespaceCode:document.newMaintainableObject.namespaceCode,))).((`document.newMaintainableObject.componentCode:code,document.newMaintainableObject.namespaceCode:namespaceCode,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
953 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
954 waitAndClickByXpath(componentLookUp);
955 waitAndClickSearch();
956 waitAndClickReturnValue();
957 String dtsTwo = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
958 String parameterName = "ValidationTestParameter" + dtsTwo;
959 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", parameterName);
960 waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.description']",
961 "Validation Test Parameter Description" + dtsTwo);
962 selectByXpath("//select[@id='document.newMaintainableObject.parameterTypeCode']", "Document Validation");
963 waitAndClickByXpath("//input[@id='document.newMaintainableObject.evaluationOperatorCodeAllowed']");
964 waitForPageToLoad();
965 blanketApproveTest(docId);
966 }
967
968 protected void testCreateNewAgenda() throws Exception {
969 selectFrameIframePortlet();
970 selectByName("document.newMaintainableObject.dataObject.namespace", "Kuali Rules Test");
971 String agendaName = "Agenda Date :" + Calendar.getInstance().getTime().toString();
972 waitAndTypeByName("document.newMaintainableObject.dataObject.agenda.name", "Agenda " + agendaName);
973 fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
974 waitAndTypeByName("document.newMaintainableObject.dataObject.contextName", "Context1");
975 fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
976 Thread.sleep(1000);
977
978 fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
979 fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
980 waitForElementPresentByName("document.newMaintainableObject.dataObject.agenda.typeId");
981 selectByName("document.newMaintainableObject.dataObject.agenda.typeId", "Campus Agenda");
982 waitForElementPresentByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
983 waitAndTypeByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]", "BL");
984 waitAndClickButtonByText("submit");
985 assertTextPresent(new String[]{"Document was successfully submitted.", "ENROUTE"});
986 passed();
987 }
988
989 protected void testCreateDocType() throws Exception {
990 selectFrameIframePortlet();
991 waitAndCreateNew();
992 assertElementPresentByXpath("//*[@name='methodToCall.route' and @alt='submit']","submit button does not exist on the page");
993
994
995
996 String docId = waitForDocId();
997 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Creating new Document Type");
998 String parentDocType = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:document.newMaintainableObject.parentDocType.name,documentTypeId:document.newMaintainableObject.docTypeParentId,))).((`document.newMaintainableObject.parentDocType.name:name,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
999 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1000 waitAndClickByXpath(parentDocType);
1001 waitForPageToLoad();
1002 Thread.sleep(2000);
1003 waitAndClickSearch();
1004 waitAndClickReturnValue();
1005 String docTypeName = "TestDocType" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1006 waitForElementPresentByXpath("//input[@id='document.newMaintainableObject.name']");
1007 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", docTypeName);
1008 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedDocHandlerUrl']","${kr.url}/maintenance.do?methodToCall=docHandler");
1009
1010
1011 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.label']", "Label for " + docTypeName);
1012 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedHelpDefinitionUrl']","default.htm?turl=WordDocuments%2Fdocumenttype.htm");
1013 jGrowl("Click Submit button");
1014 waitAndClickByXpath("//*[@name='methodToCall.route' and @alt='submit']");
1015 checkForIncidentReport();
1016 waitForPageToLoad();
1017 driver.switchTo().defaultContent();
1018 waitAndClickDocSearchTitle();
1019 waitForPageToLoad();
1020 selectFrameIframePortlet();
1021 waitAndTypeByName("documentId", docId);
1022 waitAndClickSearch();
1023 assertEquals(docId, waitForElementPresent(By.xpath(DOC_ID_XPATH_2)).getText());
1024 }
1025
1026 protected String testCreateNew() throws InterruptedException {
1027 selectFrameIframePortlet();
1028 waitAndCreateNew();
1029 String docId = verifyDocInitiated();
1030 createNewEnterDetails();
1031 return docId;
1032 }
1033
1034 protected void testCreateNewCancel() throws Exception {
1035 selectFrameIframePortlet();
1036 waitAndCreateNew();
1037 String docId = verifyDocInitiated();
1038 createNewEnterDetails();
1039 testCancelConfirmation();
1040 assertDocSearchNoResults(docId);
1041 }
1042
1043 private String verifyDocInitiated() throws InterruptedException {
1044 String docId = waitForDocId();
1045 assertEquals("INITIATED", waitForDocStatus());
1046 assertEquals(getUserName(), waitForDocInitiator());
1047 return docId;
1048 }
1049
1050 protected List<String> testCreateNewParameter(String docId, String parameterName) throws Exception {
1051 waitForPageToLoad();
1052 docId = waitForDocId();
1053
1054 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Test Parameter");
1055 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-WKFLW");
1056 waitAndTypeByName("document.newMaintainableObject.componentCode", "ActionList");
1057 waitAndTypeByName("document.newMaintainableObject.applicationId", "KUALI");
1058 parameterName = "TestIndicator" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1059 waitAndTypeByName("document.newMaintainableObject.name", parameterName);
1060 waitAndTypeByName("document.newMaintainableObject.value", "Y");
1061 waitAndTypeByName("document.newMaintainableObject.description", "for testing");
1062 selectOptionByName("document.newMaintainableObject.parameterTypeCode", "HELP");
1063 waitAndClickByXpath("//input[@name='document.newMaintainableObject.evaluationOperatorCode' and @value='A']");
1064 waitAndClickSave();
1065 waitAndClickSubmit();
1066 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1067
1068
1069 assertDocSearch(docId, DOC_STATUS_FINAL);
1070 selectTopFrame();
1071 List<String> params = new ArrayList<String>();
1072 params.add(docId);
1073 params.add(parameterName);
1074
1075 return params;
1076 }
1077
1078 protected List<String> testCreateNewParameterType(String docId, String parameterType, String parameterCode)throws Exception {
1079 waitForPageToLoad();
1080 docId = waitForDocId();
1081
1082
1083 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Test Parameter Type");
1084 parameterCode = RandomStringUtils.randomAlphabetic(4).toLowerCase();
1085 waitAndTypeByName("document.newMaintainableObject.code", parameterCode);
1086 parameterType = "testing " + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1087 waitAndTypeByName("document.newMaintainableObject.name", parameterType);
1088 waitAndClickSave();
1089 waitAndClickSubmit();
1090 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1091 assertDocSearch(docId, DOC_STATUS_FINAL);
1092 selectTopFrame();
1093 List<String> params = new ArrayList<String>();
1094 params.add(docId);
1095 params.add(parameterType);
1096 params.add(parameterCode);
1097
1098 return params;
1099 }
1100
1101 protected void testCreateNewSearchReturnValueCancelConfirmation() throws InterruptedException, Exception {
1102 selectFrameIframePortlet();
1103 waitAndCreateNew();
1104 waitAndClickSearch2();
1105 waitAndClickReturnValue();
1106 waitAndCancelConfirmation();
1107 passed();
1108 }
1109
1110 protected List<String> testCopyParameter(String docId, String parameterName) throws Exception {
1111 selectFrameIframePortlet();
1112 waitAndClickCopy();
1113 waitForPageToLoad();
1114 docId = waitForDocId();
1115 waitAndTypeByName("document.documentHeader.documentDescription", "Copying Test Parameter");
1116 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-WKFLW");
1117 waitAndTypeByName("document.newMaintainableObject.componentCode", "ActionList");
1118 waitAndTypeByName("document.newMaintainableObject.applicationId", "KUALI");
1119 parameterName = "TestIndicator" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1120 waitAndTypeByName("document.newMaintainableObject.name", parameterName);
1121 waitAndClickSave();
1122 waitAndClickSubmit();
1123 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1124 assertDocSearch(docId, DOC_STATUS_FINAL);
1125 selectTopFrame();
1126 List<String> params = new ArrayList<String>();
1127 params.add(docId);
1128 params.add(parameterName);
1129
1130 return params;
1131 }
1132
1133 protected List<String> testCopyParameterType(String docId, String parameterType, String parameterCode) throws Exception {
1134 selectFrameIframePortlet();
1135 waitAndClickCopy();
1136 waitForPageToLoad();
1137 docId = waitForDocId();
1138 waitAndTypeByName("document.documentHeader.documentDescription", "Copying Test Parameter");
1139 parameterCode = RandomStringUtils.randomAlphabetic(4).toLowerCase();
1140 waitAndTypeByName("document.newMaintainableObject.code", parameterCode);
1141 clearTextByName("document.newMaintainableObject.name");
1142 parameterType = "testing " + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1143 waitAndTypeByName("document.newMaintainableObject.name", parameterType);
1144 waitAndClickSave();
1145 waitAndClickSubmit();
1146 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1147 assertDocSearch(docId, DOC_STATUS_FINAL);
1148 selectTopFrame();
1149 List<String> params = new ArrayList<String>();
1150 params.add(docId);
1151 params.add(parameterType);
1152 params.add(parameterCode);
1153
1154 return params;
1155 }
1156
1157
1158 protected void testDocTypeLookup() throws Exception {
1159 selectFrameIframePortlet();
1160 waitAndClickByXpath("//input[@title='Search Parent Name']");
1161 waitAndClickByXpath(SAVE_XPATH_3);
1162 waitAndClickByXpath("//table[@id='row']/tbody/tr[contains(td[3],'RiceDocument')]/td[1]/a");
1163 waitAndClickByXpath(SAVE_XPATH_3);
1164 assertEquals("RiceDocument", getTextByXpath("//table[@id='row']/tbody/tr/td[4]/a"));
1165 waitAndClickByName("methodToCall.clearValues");
1166 waitAndTypeByName("name", "Kuali*D");
1167 waitAndClickByXpath(SAVE_XPATH_3);
1168 assertElementPresentByXpath("//table[@id='row']/tbody/tr[contains(td[3], 'KualiDocument')]");
1169 String docIdOld = getTextByXpath("//table[@id='row']/tbody/tr[contains(td[3], 'KualiDocument')]/td[2]/a");
1170 waitAndClickByName("methodToCall.clearValues");
1171 waitAndTypeByName("label", "KualiDocument");
1172 waitAndClickByXpath(SAVE_XPATH_3);
1173 assertElementPresentByXpath("//table[@id='row']/tbody/tr[contains(td[5], 'KualiDocument')]");
1174 waitAndClickByName("methodToCall.clearValues");
1175 waitAndTypeByName("documentTypeId", docIdOld);
1176 waitAndClickByXpath(SAVE_XPATH_3);
1177 assertElementPresentByXpath("//table[@id='row']/tbody/tr[contains(td[2], '" + docIdOld + "')]");
1178 }
1179
1180
1181 protected List<String> testEditParameterType(String docId, String parameterType, String parameterCode) throws Exception {
1182 selectFrameIframePortlet();
1183 waitAndClickEdit();
1184 waitForPageToLoad();
1185 docId = waitForDocId();
1186 waitAndTypeByName("document.documentHeader.documentDescription", "Editing Test Parameter");
1187 clearTextByName("document.newMaintainableObject.name");
1188 parameterType = "testing " + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1189 waitAndTypeByName("document.newMaintainableObject.name", parameterType);
1190 waitAndClickSave();
1191 waitAndClickSubmit();
1192 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1193 assertDocSearch(docId, DOC_STATUS_FINAL);
1194 selectTopFrame();
1195 List<String> params = new ArrayList<String>();
1196 params.add(docId);
1197 params.add(parameterType);
1198 params.add(parameterCode);
1199
1200 return params;
1201 }
1202
1203 protected List<String> testEditParameter(String docId, String parameterName) throws Exception {
1204 selectFrameIframePortlet();
1205 waitAndClickEdit();
1206 waitForPageToLoad();
1207 docId = waitForDocId();
1208 waitAndTypeByName("document.documentHeader.documentDescription", "Editing Test Parameter");
1209 clearTextByName("document.newMaintainableObject.value");
1210 waitAndTypeByName("document.newMaintainableObject.value", "N");
1211 waitAndClickSave();
1212 waitAndClickSubmit();
1213 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1214 assertDocSearch(docId, DOC_STATUS_FINAL);
1215 selectTopFrame();
1216 List<String> params = new ArrayList<String>();
1217 params.add(docId);
1218 params.add(parameterName);
1219 return params;
1220 }
1221
1222 protected void testEditRouteRulesDelegation() throws Exception {
1223 waitForPageToLoad();
1224 Thread.sleep(3000);
1225 assertEquals("Kuali Portal Index", getTitle());
1226 selectFrameIframePortlet();
1227 waitAndClickSearch();
1228 waitAndClickEdit();
1229 waitForPageToLoad();
1230 Thread.sleep(3000);
1231 assertTrue(isElementPresentByName(CANCEL_NAME));
1232 waitAndClickCancel();
1233 waitAndClickByName("methodToCall.processAnswer.button0");
1234 waitForPageToLoad();
1235 passed();
1236 }
1237
1238 protected void testFiscalOfficerInfoMaintenanceNew() throws Exception {
1239 selectFrameIframePortlet();
1240 checkForIncidentReport();
1241 String docId = getTextByXpath("//*[@id='u13_control']");
1242 waitAndTypeByXpath("//input[@name='document.documentHeader.documentDescription']", "New FO Doc");
1243 waitAndTypeByXpath("//input[@name='document.newMaintainableObject.dataObject.id']", "5");
1244 waitAndTypeByXpath("//input[@name='document.newMaintainableObject.dataObject.userName']", "Jigar");
1245 waitAndClickByXpath("//button[@id='usave']");
1246 Integer docIdInt = Integer.valueOf(docId).intValue();
1247 waitAndClickActionList();
1248 selectFrameIframePortlet();
1249
1250 if(isElementPresentByLinkText("Last")){
1251 waitAndClickByLinkText("Last");
1252 waitAndClickByLinkText(docIdInt.toString());
1253 } else {
1254 waitAndClickByLinkText(docIdInt.toString());
1255 }
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290 }
1291
1292 protected void testIdentityGroupBlanketApprove() throws Exception {
1293 selectFrameIframePortlet();
1294 waitAndCreateNew();
1295 String docId = waitForDocId();
1296 String dtsTwo = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
1297 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Group " + dtsTwo);
1298 assertBlanketApproveButtonsPresent();
1299 selectByXpath("//select[@id='document.groupNamespace']", LABEL_KUALI_KUALI_SYSTEMS);
1300 waitAndTypeByXpath("//input[@id='document.groupName']", "Validation Test Group1 " + dtsTwo);
1301 waitAndClickByName(
1302 "methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
1303 waitAndClickSearch();
1304 waitAndClickReturnValue();
1305 waitAndClickByName("methodToCall.addMember.anchorAssignees");
1306 waitForPageToLoad();
1307 blanketApproveTest(docId);
1308 }
1309
1310 protected void testIdentityPermissionBlanketApprove() throws Exception {
1311 selectFrameIframePortlet();
1312 waitAndCreateNew();
1313 String docId = waitForDocId();
1314 String dtsTwo = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
1315 waitAndTypeByXpath("//input[@name='document.documentHeader.documentDescription']",
1316 "Validation Test Permission " + dtsTwo);
1317 assertBlanketApproveButtonsPresent();
1318 waitAndTypeByXpath("//input[@name='document.documentHeader.organizationDocumentNumber']", "10012");
1319 selectByXpath("//select[@name='document.newMaintainableObject.namespaceCode']", LABEL_KUALI_KUALI_SYSTEMS);
1320 selectByXpath("//select[@name='document.newMaintainableObject.templateId']", LABEL_KUALI_DEFAULT);
1321 waitAndTypeByXpath("//input[@name='document.newMaintainableObject.name']",
1322 "ValidationTestPermission" + dtsTwo);
1323 blanketApproveTest(docId);
1324 }
1325
1326 protected void testIdentityPersonBlanketApprove() throws Exception {
1327 selectFrameIframePortlet();
1328 waitAndCreateNew();
1329 String docId = waitForDocId();
1330 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Person");
1331 assertBlanketApproveButtonsPresent();
1332 waitAndTypeByXpath("//input[@id='document.principalName']", "principal" + RandomStringUtils.randomAlphabetic(3).toLowerCase());
1333 selectByName("newAffln.affiliationTypeCode", "Affiliate");
1334 selectByName("newAffln.campusCode", "BX - BLGTN OFF CAMPUS");
1335 selectByName("newAffln.campusCode", "BL - BLOOMINGTON");
1336 assertElementPresentByName("newAffln.dflt");
1337 waitAndClickByName("newAffln.dflt");
1338 waitAndClickByName("methodToCall.addAffln.anchor");
1339 waitAndClickByName("methodToCall.toggleTab.tabContact");
1340 selectByName("newName.namePrefix", "Mr");
1341 waitAndTypeByName("newName.firstName", "First");
1342 waitAndTypeByName("newName.lastName", "Last");
1343 selectByName("newName.nameSuffix", "Mr");
1344 waitAndClickByName("newName.dflt");
1345 waitAndClickByName("methodToCall.addName.anchor");
1346 waitForPageToLoad();
1347 blanketApproveTest(docId);
1348 }
1349
1350 protected void testIdentityResponsibilityBlanketApprove() throws Exception {
1351 selectFrameIframePortlet();
1352 waitAndCreateNew();
1353 String docId = waitForDocId();
1354 String dtsTwo = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
1355 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Responsibility " + dtsTwo);
1356 assertBlanketApproveButtonsPresent();
1357 selectByXpath("//select[@id='document.newMaintainableObject.namespaceCode']", LABEL_KUALI_KUALI_SYSTEMS);
1358 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']",
1359 "Validation Test Responsibility " + dtsTwo);
1360 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.documentTypeName']", "Test " + dtsTwo);
1361 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.routeNodeName']", "Test " + dtsTwo);
1362 waitAndClickByXpath("//input[@id='document.newMaintainableObject.actionDetailsAtRoleMemberLevel']");
1363 waitAndClickByXpath("//input[@id='document.newMaintainableObject.required']");
1364 blanketApproveTest(docId);
1365 }
1366
1367 protected void testIdentityRoleBlanketApprove() throws Exception {
1368 selectFrameIframePortlet();
1369 waitAndCreateNew();
1370 waitAndClickByXpath(SEARCH_XPATH, "No search button to click.");
1371 waitAndClickReturnValue();
1372 String docId = waitForDocId();
1373 String dtsTwo = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
1374 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Role " + dtsTwo);
1375 assertBlanketApproveButtonsPresent();
1376 selectByXpath("//select[@id='document.roleNamespace']", LABEL_KUALI_KUALI_SYSTEMS);
1377 waitAndTypeByXpath("//input[@id='document.roleName']", "Validation Test Role " + dtsTwo,
1378 "No Role Name input to type in.");
1379 waitAndClickByName(
1380 "methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
1381 waitAndClickByXpath(SEARCH_XPATH, "No search button to click.");
1382 waitAndClickReturnValue();
1383 waitAndClickByName("methodToCall.addMember.anchorAssignees");
1384 waitForPageToLoad();
1385 blanketApproveTest(docId);
1386 }
1387
1388 protected void testLocationCountryBlanketApprove() throws InterruptedException {
1389 selectFrameIframePortlet();
1390 String randomCode = searchForAvailableCode(2);
1391
1392 waitAndCreateNew();
1393 String docId = waitForDocId();
1394 String countryName = "Validation Test Country " + randomCode + " " + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
1395 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, countryName);
1396 waitAndTypeByXpath(DOC_CODE_XPATH, randomCode);
1397 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", countryName);
1398 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.alternateCode']", "V" + randomCode);
1399
1400 finishBlanketApprovalTest(docId);
1401 }
1402
1403 protected void finishBlanketApprovalTest(String docId) throws InterruptedException {
1404 assertBlanketApproveButtonsPresent();
1405 blanketApproveCheck();
1406 if (!hasDocError("same primary key already exists")) {
1407 blanketApproveAssert(docId);
1408 }
1409 }
1410
1411 protected void testLocationCountyBlanketApprove() throws Exception {
1412 selectFrameIframePortlet();
1413 waitAndCreateNew();
1414 String docId = waitForDocId();
1415 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test County");
1416 assertBlanketApproveButtonsPresent();
1417 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1418 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1419 waitAndClickByXpath(countryLookUp);
1420 waitAndTypeByName("code", "US");
1421 waitAndClickSearch();
1422 waitAndClickReturnValue();
1423 waitAndTypeByXpath(DOC_CODE_XPATH, RandomStringUtils.randomAlphabetic(2).toUpperCase());
1424 String stateLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.state.StateBo!!).(((countryCode:document.newMaintainableObject.countryCode,code:document.newMaintainableObject.stateCode,))).((`document.newMaintainableObject.countryCode:countryCode,document.newMaintainableObject.stateCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1425 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1426 waitAndClickByXpath(stateLookUp);
1427 waitAndTypeByName("code", "IN");
1428 waitAndClickSearch();
1429 waitAndClickReturnValue();
1430 String countyName = "Validation Test County" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1431 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", countyName);
1432 waitAndClickByXpath("//input[@id='document.newMaintainableObject.active']");
1433 blanketApproveTest(docId);
1434 }
1435
1436 protected void testLocationPostBlanketApprove() throws Exception {
1437 selectFrameIframePortlet();
1438 waitAndCreateNew();
1439 String docId = waitForDocId();
1440 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Postal Code");
1441 assertBlanketApproveButtonsPresent();
1442 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1443 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1444 waitAndClickByXpath(countryLookUp);
1445 waitAndTypeByName("code", "US");
1446 waitAndClickSearch();
1447 waitAndClickReturnValue();
1448 String code = RandomStringUtils.randomNumeric(5);
1449 waitAndTypeByXpath(DOC_CODE_XPATH, code);
1450 String stateLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.state.StateBo!!).(((countryCode:document.newMaintainableObject.countryCode,code:document.newMaintainableObject.stateCode,))).((`document.newMaintainableObject.countryCode:countryCode,document.newMaintainableObject.stateCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1451 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1452 waitAndClickByXpath(stateLookUp);
1453 waitAndClickSearch();
1454 waitAndClickByXpath("//table[@id='row']/tbody/tr[4]/td[1]/a");
1455 String cityName = "Validation Test Postal Code " + code;
1456 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.cityName']", cityName);
1457 blanketApproveTest(docId);
1458 }
1459
1460 protected void testLocationStateBlanketApprove() throws Exception {
1461 selectFrameIframePortlet();
1462 waitAndCreateNew();
1463 String docId = waitForDocId();
1464 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test State");
1465 assertBlanketApproveButtonsPresent();
1466
1467
1468 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1469 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1470 waitAndClickByXpath(countryLookUp);
1471 waitAndClickSearch();
1472 waitAndClickReturnValue();
1473 String code = RandomStringUtils.randomAlphabetic(2).toUpperCase();
1474 waitAndTypeByXpath(DOC_CODE_XPATH, code);
1475 String state = "Validation Test State " + code;
1476 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", state);
1477 waitAndClickByXpath("//input[@id='document.newMaintainableObject.active']");
1478 blanketApproveTest(docId);
1479 }
1480
1481 protected void testLookUp() throws Exception {
1482 waitForPageToLoad();
1483 selectFrameIframePortlet();
1484
1485
1486 waitAndClick(By.xpath(SEARCH_XPATH_3));
1487 waitAndClickByLinkText(EDIT_LINK_TEXT, "edit button not present does user " + user + " have permission?");
1488 waitForTextPresent("ubmit");
1489 assertTextPresent("ave");
1490 assertTextPresent("pprove");
1491 assertTextPresent("lose");
1492 assertTextPresent("ancel");
1493 }
1494
1495 protected void testReferenceCampusTypeBlanketApprove() throws Exception {
1496 selectFrameIframePortlet();
1497 String randomCode = searchForAvailableCode(1);
1498
1499 waitAndCreateNew();
1500 String docId = waitForDocId();
1501 String dtsTwo = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
1502 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Campus Type " + randomCode + " " + dtsTwo);
1503 waitAndTypeByXpath(DOC_CODE_XPATH, randomCode);
1504 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", "Indianapolis" + randomCode + dtsTwo);
1505
1506 finishBlanketApprovalTest(docId);
1507 }
1508
1509 protected void performParameterInquiry(String parameterField) throws Exception {
1510 waitAndTypeByName("name", parameterField);
1511 waitAndClickSearch();
1512 isElementPresentByLinkText(parameterField);
1513 waitAndClickByLinkText(parameterField);
1514 waitForPageToLoad();
1515 Thread.sleep(2000);
1516 switchToWindow("Kuali :: Inquiry");
1517 Thread.sleep(2000);
1518 }
1519
1520 protected List<String> testLookUpParameterType(String docId, String parameterType, String parameterCode) throws Exception {
1521 performParameterInquiry(parameterType);
1522 assertEquals(parameterCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim().toLowerCase());
1523 assertEquals(parameterType, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim().toLowerCase());
1524 waitAndClickCloseWindow();
1525 switchToWindow("null");
1526 List<String> params = new ArrayList<String>();
1527 params.add(docId);
1528 params.add(parameterType);
1529 params.add(parameterCode);
1530
1531 return params;
1532 }
1533
1534 protected List<String> testLookUpParameter(String docId, String parameterName) throws Exception {
1535 performParameterInquiry(parameterName);
1536 assertEquals(parameterName, getTextByXpath(
1537 "//div[@class='tab-container']/table//span[@id='name.div']").trim());
1538 assertEquals("Y", getTextByXpath("//div[@class='tab-container']/table//span[@id='value.div']")
1539 .trim());
1540 waitAndClickCloseWindow();
1541 switchToWindow("null");
1542 List<String> params = new ArrayList<String>();
1543 params.add(docId);
1544 params.add(parameterName);
1545
1546 return params;
1547 }
1548
1549 protected void testTermLookupAssertions() throws Exception {
1550 testLookUp();
1551 assertTextPresent("Term Parameters");
1552 waitAndClick(By.xpath(CANCEL2_XPATH));
1553 passed();
1554 }
1555
1556 protected void testTermSpecificationLookupAssertions() throws Exception {
1557 testLookUp();
1558 assertTextPresent("Context");
1559 waitAndClick(By.xpath(CANCEL2_XPATH));
1560 passed();
1561 }
1562
1563 protected List<String> testVerifyModifiedParameter(String docId, String parameterName) throws Exception {
1564 performParameterInquiry(parameterName);
1565 assertEquals(parameterName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
1566 assertEquals("N", getTextByXpath("//div[@class='tab-container']/table//span[@id='value.div']").trim());
1567 waitAndClickCloseWindow();
1568 switchToWindow("null");
1569 List<String> params = new ArrayList<String>();
1570 params.add(docId);
1571 params.add(parameterName);
1572
1573 return params;
1574 }
1575
1576 protected List<String> testVerifyCopyParameterType(String docId, String parameterType, String parameterCode) throws Exception
1577 {
1578 performParameterInquiry(parameterType);
1579 assertEquals(parameterType, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim().toLowerCase());
1580 waitAndClickCloseWindow();
1581 switchToWindow("null");
1582 List<String> params = new ArrayList<String>();
1583 params.add(docId);
1584 params.add(parameterType);
1585 params.add(parameterCode);
1586
1587 return params;
1588 }
1589
1590 protected List<String> testCreateNewPermission(String docId, String permissionName) throws Exception {
1591 waitForPageToLoad();
1592 Thread.sleep(2000);
1593 docId = waitForDocId();
1594 waitAndClickSave();
1595 waitForElementPresentByXpath("//div[contains(.,'Document Description (Description) is a required field.')]/img[@alt='error']");
1596 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding Permission removeme");
1597 waitAndClickSubmit();
1598 waitForElementPresentByXpath("//div[@class='error']");
1599 assertElementPresentByXpath("//div[contains(.,'Template (Template) is a required field.')]/img[@alt='error']");
1600 assertElementPresentByXpath("//div[contains(.,'Permission Namespace (Permission Namespace) is a required field.')]/img[@alt='error']");
1601 assertElementPresentByXpath("//div[contains(.,'Permission Name (Permission Name) is a required field.')]/img[@alt='error']");
1602 selectOptionByName("document.newMaintainableObject.templateId", "36");
1603 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-SYS");
1604 permissionName = "removeme" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1605 waitAndTypeByName("document.newMaintainableObject.name", permissionName);
1606 waitAndTypeByName("document.newMaintainableObject.description", "namespaceCode=KR*");
1607 checkByName("document.newMaintainableObject.active");
1608 waitAndClickSave();
1609 waitForElementPresentByXpath(SAVE_SUCCESSFUL_XPATH);
1610 assertEquals(DOC_STATUS_SAVED, getTextByXpath(DOC_STATUS_XPATH));
1611 waitAndClickSubmit();
1612 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1613 assertEquals(DOC_STATUS_ENROUTE, getTextByXpath(DOC_STATUS_XPATH));
1614 List<String> params = new ArrayList<String>();
1615 params.add(docId);
1616 params.add(permissionName);
1617
1618 return params;
1619 }
1620
1621 protected List<String> testLookUpPermission(String docId, String permissionName) throws Exception {
1622 waitAndTypeByName("name", permissionName);
1623 waitAndClickSearch();
1624 isElementPresentByLinkText(permissionName);
1625 List<String> params = new ArrayList<String>();
1626 params.add(docId);
1627 params.add(permissionName);
1628
1629 return params;
1630 }
1631
1632 protected List<String> testEditPermission(String docId, String permissionName) throws Exception {
1633 waitAndClickEdit();
1634 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Editing Permission removeme");
1635 uncheckByName("document.newMaintainableObject.active");
1636 waitAndClickSubmit();
1637 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1638 List<String> params = new ArrayList<String>();
1639 params.add(docId);
1640 params.add(permissionName);
1641
1642 return params;
1643 }
1644
1645 protected List<String> testVerifyPermission(String docId, String permissionName) throws Exception {
1646 waitAndTypeByName("name", permissionName);
1647 waitAndClickByXpath("//input[@title='Active Indicator - No']");
1648 waitAndClickSearch();
1649 isElementPresentByLinkText(permissionName);
1650 List<String> params = new ArrayList<String>();
1651 params.add(docId);
1652 params.add(permissionName);
1653
1654 return params;
1655 }
1656
1657 protected List<String> testCreateNewPerson(String docId, String personName) throws Exception {
1658 waitForPageToLoad();
1659 docId = waitForDocId();
1660 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding Charlie Brown");
1661 waitAndTypeByName("document.documentHeader.explanation", "I want to add Charlie Brown to test KIM");
1662
1663
1664 personName = "cbrown" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomChars();
1665 waitAndTypeByName("document.principalName", personName);
1666 waitAndClickSave();
1667 waitForElementPresentByXpath(SAVE_SUCCESSFUL_XPATH);
1668 assertEquals(DOC_STATUS_SAVED, getTextByXpath(DOC_STATUS_XPATH));
1669 waitAndClickSubmit();
1670 waitForElementPresentByXpath("//div[contains(.,'At least one affiliation must be entered.')]/img[@alt='error']");
1671 assertElementPresentByXpath("//div[contains(.,'At least one name must be entered.')]/img[@alt='error']");
1672 selectOptionByName("newAffln.affiliationTypeCode", "STDNT");
1673 selectOptionByName("newAffln.campusCode", "BL");
1674 checkByName("newAffln.dflt");
1675 waitAndClickByName("methodToCall.addAffln.anchor");
1676 waitAndSelectByName("newName.nameCode", "PRM");
1677 selectOptionByName("newName.namePrefix", "Mr");
1678 waitAndTypeByName("newName.firstName", "Charlie");
1679 waitAndTypeByName("newName.lastName", "Brown");
1680 checkByName("newName.dflt");
1681 waitAndClickByName("methodToCall.addName.anchor");
1682 waitAndClickSubmit();
1683 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1684 assertEquals(DOC_STATUS_ENROUTE, getTextByXpath(DOC_STATUS_XPATH));
1685 List<String> params = new ArrayList<String>();
1686 params.add(docId);
1687 params.add(personName);
1688
1689 return params;
1690 }
1691
1692 protected List<String> testLookUpPerson(String docId, String personName) throws Exception {
1693 waitAndTypeByName("principalName", personName);
1694 waitAndClickSearch();
1695 isElementPresentByLinkText(personName);
1696 waitAndClickByName("methodToCall.clearValues");
1697 waitAndTypeByName("firstName", "Charlie");
1698 waitAndClickSearch();
1699 isElementPresentByLinkText(personName);
1700 waitAndClickByName("methodToCall.clearValues");
1701 waitAndTypeByName("lastName", "Brown");
1702 waitAndClickSearch();
1703 isElementPresentByLinkText(personName);
1704 waitAndClickByName("methodToCall.clearValues");
1705 waitAndTypeByName("campusCode", "BL");
1706 waitAndClickSearch();
1707 isElementPresentByLinkText(personName);
1708 List<String> params = new ArrayList<String>();
1709 params.add(docId);
1710 params.add(personName);
1711
1712 return params;
1713 }
1714
1715 protected List<String> testVerifyPerson(String docId, String personName) throws Exception {
1716 waitAndClickByLinkText(personName);
1717 waitForPageToLoad();
1718 Thread.sleep(5000);
1719 switchToWindow("Kuali :: Person");
1720 Thread.sleep(2000);
1721 assertEquals(personName, getTextByXpath("//div[@class='tab-container']/table//tr[2]/td[1]/div").trim());
1722 assertEquals("BL - BLOOMINGTON", getTextByXpath("//div[@class='tab-container']/table[3]//tr[2]/td[2]/div").trim());
1723 assertEquals("Student", getTextByXpath("//select/option[@selected]").trim());
1724 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Overview']");
1725 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Contact']");
1726 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Privacy Preferences']");
1727 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Membership']");
1728 waitAndClickByName("methodToCall.showAllTabs");
1729 waitForElementPresentByXpath("//table[@class='tab']//input[@title='close Overview']");
1730 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Contact']");
1731 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Privacy Preferences']");
1732 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Membership']");
1733 waitAndClickByName("methodToCall.hideAllTabs");
1734 waitForElementPresentByXpath("//table[@class='tab']//input[@title='open Overview']");
1735 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Contact']");
1736 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Privacy Preferences']");
1737 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Membership']");
1738 waitAndClickCloseWindow();
1739 switchToWindow("null");
1740 List<String> params = new ArrayList<String>();
1741 params.add(docId);
1742 params.add(personName);
1743
1744 return params;
1745 }
1746
1747 protected void testConfigurationTestView(String idPrefix) throws Exception {
1748 waitForElementPresentByXpath("//label[@id='" + idPrefix + "TextInputField_label']");
1749
1750
1751 String styleValue = waitAndGetAttributeByXpath("//label[@id='" + idPrefix + "TextInputField_label']",
1752 "style");
1753
1754
1755 assertTrue(idPrefix + "textInputField label does not contain expected style", styleValue.replace(" ", "").contains("color:red"));
1756
1757
1758 String refreshTextSelectLocator = "//select[@id='" + idPrefix + "RefreshTextField_control']";
1759 String[] options1 = getSelectOptionsByXpath(refreshTextSelectLocator);
1760 String dropDownSelectLocator = "//select[@id='" + idPrefix + "DropDown_control']";
1761 selectByXpath(dropDownSelectLocator, "Vegetables");
1762 Thread.sleep(3000);
1763
1764
1765 String[] options2 = getSelectOptionsByXpath(refreshTextSelectLocator);
1766
1767
1768 assertFalse("Field 1 selection did not change Field 2 options https://jira.kuali.org/browse/KULRICE-8163 Configuration Test View Conditional Options doesn't change Field 2 options based on Field 1 selection",
1769 options1[options1.length - 1].equalsIgnoreCase(options2[options2.length - 1]));
1770
1771
1772 selectByXpath(dropDownSelectLocator, "None");
1773 Thread.sleep(3000);
1774 assertEquals("true", waitAndGetAttributeByXpath(refreshTextSelectLocator, "disabled"));
1775 }
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802 protected void testCategoryLookUp() throws Exception {
1803 waitForPageToLoad();
1804 selectFrameIframePortlet();
1805 waitAndClickByXpath("//button[contains(.,'earch')]");
1806 Thread.sleep(3000);
1807 waitForPageToLoad();
1808 findElement(By.tagName("body")).getText().contains("Actions");
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819 }
1820
1821 protected void testCreateSampleEDocLite() throws Exception {
1822 waitForPageToLoad();
1823 Thread.sleep(3000);
1824 assertEquals("Kuali Portal Index", getTitle());
1825 selectFrameIframePortlet();
1826 waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
1827 waitForPageToLoad();
1828
1829
1830 waitAndClickByLinkText("Create Document");
1831 waitForPageToLoad();
1832 Thread.sleep(3000);
1833 String docId = getTextByXpath("//table/tbody/tr[4]/td[@class='datacell1']");
1834 waitAndTypeByName("userName", "Viral Chauhan");
1835 waitAndTypeByName("rqstDate", "12/03/2020");
1836 checkByName("fundedBy");
1837 waitAndTypeByName("addText", "Note Added.");
1838 waitAndClickByXpath("//td[@class='datacell']/div/img");
1839 waitAndClickByXpath("//input[@value='submit']");
1840 assertEquals(Boolean.FALSE,(Boolean) isElementPresentByXpath("//input[@value='submit']"));
1841 assertEquals(Boolean.FALSE, (Boolean) isElementPresentByXpath("//input[@value='save']"));
1842 assertEquals(Boolean.FALSE, (Boolean) isElementPresentByXpath("//input[@value='cancel']"));
1843 waitForPageToLoad();
1844 selectTopFrame();
1845 waitAndClickDocSearch();
1846 waitForPageToLoad();
1847 selectFrameIframePortlet();
1848 waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
1849 waitForElementPresent(By.linkText(docId));
1850 }
1851
1852 protected void testTermLookUp() throws Exception {
1853 testLookUp();
1854 assertTextPresent("Term Parameters");
1855 waitAndClick(By.xpath(CANCEL2_XPATH));
1856 passed();
1857 }
1858
1859 protected void testCreateNewRRDTravelRequestDestRouting() throws Exception {
1860 selectFrameIframePortlet();
1861
1862
1863 waitAndClick("img[alt=\"create new\"]");
1864
1865
1866 waitAndClickByName(
1867 "methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
1868
1869
1870 waitAndClickByXpath("//td[@class='infoline']/input[@name='methodToCall.search']");
1871
1872
1873 waitAndClick("a[title=\"return valueRule Id=1046 \"]");
1874
1875
1876 waitAndClickByName("parentResponsibilityId");
1877
1878
1879 waitAndClickByName("methodToCall.createDelegateRule");
1880
1881 waitAndClickCancel();
1882 waitAndClickByName("methodToCall.processAnswer.button0");
1883 waitForPageToLoad();
1884 driver.switchTo().defaultContent();
1885 waitAndClickByXpath("(//input[@name='imageField'])[2]");
1886 passed();
1887 }
1888
1889 protected void testWorkFlowRouteRulesCreateNew() throws Exception {
1890 waitForPageToLoad();
1891 Thread.sleep(5000);
1892 assertEquals("Kuali Portal Index", getTitle());
1893 selectFrameIframePortlet();
1894 waitAndClickCreateNew();
1895 waitAndClickByName(CANCEL_NAME, "https://jira.kuali.org/browse/KULRICE-8161 Work Flow Route Rules cancel new yields 404 not found");
1896
1897
1898 waitAndClickByName("methodToCall.processAnswer.button0");
1899 passed();
1900 }
1901
1902
1903
1904
1905
1906 protected void testWorkFlowRouteRulesEditRouteRules() throws Exception {
1907 waitForPageToLoad();
1908 assertEquals("Kuali Portal Index", getTitle());
1909 selectFrameIframePortlet();
1910 waitAndClickSearch();
1911 waitAndClickEdit();
1912 waitForPageToLoad();
1913 selectFrameIframePortlet();
1914 waitAndClickCancel();
1915 waitAndClickByName("methodToCall.processAnswer.button0");
1916 passed();
1917 }
1918
1919 protected void createNewEnterDetails() throws InterruptedException {
1920
1921 fail("createNewEnterDetails must be implemented by test class");
1922 }
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960 protected void waitAndClickActionList() throws InterruptedException {
1961 WebDriverUtils.jGrowl(driver, "Click Action List", false, "Click Action List");
1962 selectTopFrame();
1963 waitAndClickByXpath("//img[@alt='action list']");
1964 }
1965
1966 protected void testLookUpComponent(String docId, String componentName, String componentCode) throws Exception {
1967 selectFrameIframePortlet();
1968
1969 waitAndTypeByName("name", componentName);
1970 waitAndClickSearch();
1971 isElementPresentByLinkText(componentName);
1972 waitAndClickByLinkText(componentName);
1973 waitForPageToLoad();
1974 Thread.sleep(2000);
1975 switchToWindow("Kuali :: Inquiry");
1976 Thread.sleep(2000);
1977 assertEquals(componentName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
1978 assertEquals(componentCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim());
1979 waitAndClickCloseWindow();
1980 switchToWindow("null");
1981 }
1982
1983 protected void testEditComponent(String docId, String componentName, String componentCode) throws Exception {
1984 selectFrameIframePortlet();
1985 waitAndClickEdit();
1986 waitForPageToLoad();
1987 docId = waitForDocId();
1988 waitAndTypeByName("document.documentHeader.documentDescription", "Editing Test Component");
1989 clearTextByName("document.newMaintainableObject.name");
1990 waitAndTypeByName("document.newMaintainableObject.name", componentName);
1991 waitAndClickSave();
1992 waitAndClickSubmit();
1993 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1994 assertDocSearch(docId, DOC_STATUS_FINAL);
1995 selectTopFrame();
1996 }
1997
1998 protected void testCopyComponent(String docId, String componentName, String componentCode) throws Exception {
1999 selectFrameIframePortlet();
2000 waitAndClickCopy();
2001 waitForPageToLoad();
2002 docId = waitForDocId();
2003 waitAndTypeByName("document.documentHeader.documentDescription", "Copying Test Component");
2004 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-IDM");
2005 waitAndTypeByName("document.newMaintainableObject.code", componentCode);
2006 clearTextByName("document.newMaintainableObject.name");
2007 waitAndTypeByName("document.newMaintainableObject.name", componentName);
2008 waitAndClickSave();
2009 waitAndClickSubmit();
2010 waitForPageToLoad();
2011 checkForDocError();
2012 waitForElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
2013 assertDocSearch(docId, DOC_STATUS_FINAL);
2014 selectTopFrame();
2015 }
2016
2017 protected void testVerifyCopyComponent(String docId, String componentName, String componentCode) throws Exception {
2018 selectFrameIframePortlet();
2019 waitAndTypeByName("name", componentName);
2020 waitAndClickSearch();
2021 isElementPresentByLinkText(componentName);
2022 waitAndClickByLinkText(componentName);
2023 waitForPageToLoad();
2024 Thread.sleep(2000);
2025 switchToWindow("Kuali :: Inquiry");
2026 Thread.sleep(2000);
2027 assertEquals(componentName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
2028 assertEquals(componentCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim());
2029 waitAndClickCloseWindow();
2030 switchToWindow("null");
2031 }
2032
2033 protected void testMultiValueSelectAllPages() throws InterruptedException {
2034 waitAndClickButtonByText(SEARCH);
2035 acceptAlertIfPresent();
2036 assertButtonDisabledByText(RETURN_SELECTED_BUTTON_TEXT);
2037
2038
2039 waitAndClickDropDown("select all items");
2040 acceptAlertIfPresent();
2041 if (!areAllMultiValueSelectsChecked()) {
2042 JiraAwareFailureUtils.fail("select all items failure", this);
2043 }
2044 assertButtonEnabledByText(RETURN_SELECTED_BUTTON_TEXT);
2045
2046 boolean anotherPageOfResults = false;
2047 if (Integer.parseInt(multiValueResultCount()) > 10) {
2048 anotherPageOfResults = true;
2049 }
2050
2051
2052 if (!anotherPageOfResults) {
2053 JiraAwareFailureUtils.fail("select all items server side paging failure not enough results for next page",
2054 this);
2055 }
2056 waitAndClickByLinkText("Next");
2057
2058 if (!areAllMultiValueSelectsChecked()) {
2059 JiraAwareFailureUtils.fail("select all items server side paging failure", this);
2060 }
2061 assertButtonEnabledByText(RETURN_SELECTED_BUTTON_TEXT);
2062
2063
2064 waitAndClickDropDown("deselect all items");
2065 if (!areNoMultiValueSelectsChecked()) {
2066 JiraAwareFailureUtils.fail("deselect all items failure", this);
2067 }
2068 assertButtonDisabledByText(RETURN_SELECTED_BUTTON_TEXT);
2069
2070 waitAndClickByLinkText("Previous");
2071 if (!areNoMultiValueSelectsChecked()) {
2072 JiraAwareFailureUtils.fail("deselect all items failure", this);
2073 }
2074 assertButtonDisabledByText(RETURN_SELECTED_BUTTON_TEXT);
2075 }
2076
2077 protected void testMultiValueSelectAllThisPage() throws InterruptedException {
2078 waitAndClickButtonByText(SEARCH);
2079 acceptAlertIfPresent();
2080 assertButtonDisabledByText(RETURN_SELECTED_BUTTON_TEXT);
2081
2082
2083 assertMultiValueSelectAllThisPage();
2084
2085 boolean anotherPageOfResults = false;
2086 if (Integer.parseInt(multiValueResultCount()) > 5) {
2087 anotherPageOfResults = true;
2088 }
2089
2090
2091 waitAndClickByLinkText("Next");
2092 if (!areNoMultiValueSelectsChecked()) {
2093 if (anotherPageOfResults) {
2094 JiraAwareFailureUtils.fail("select all items on this page failure", this);
2095 } else {
2096 JiraAwareFailureUtils.fail("select all items on this page failure not enough results for next page",
2097 this);
2098 }
2099 }
2100 assertButtonEnabledByText(RETURN_SELECTED_BUTTON_TEXT);
2101
2102
2103 waitAndClickByLinkText("Previous");
2104 if (!areAllMultiValueSelectsChecked()) {
2105 JiraAwareFailureUtils.fail("select all items on previous page failure", this);
2106 }
2107
2108
2109 assertMultiValueDeselectAllThisPage();
2110 }
2111
2112
2113
2114
2115 protected void testExternalHelp2() throws Exception {
2116
2117 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for External Help\"]"), "HelpWindow", "http://www.kuali.org/?section");
2118
2119
2120 assertPopUpWindowUrl(By.xpath("//div[@id='field-label-left-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
2121 "http://www.kuali.org/?label_left");
2122
2123
2124 assertPopUpWindowUrl(By.xpath("//div[@id='field-label-right-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
2125 "http://www.kuali.org/?label_right");
2126
2127
2128 assertPopUpWindowUrl(By.xpath("//div[@id='field-label-top-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
2129 "http://www.kuali.org/?system_parm");
2130
2131
2132 assertPopUpWindowUrl(By.id("standalone-external-help"), "HelpWindow", "http://www.kuali.org/?widget_only");
2133 }
2134
2135
2136
2137
2138
2139 protected void testDisplayOnlyExternalHelp2() throws Exception {
2140
2141 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Display only fields\"]"), "HelpWindow", "http://www.kuali.org/?sub_section");
2142
2143
2144 assertPopUpWindowUrl(By.xpath(
2145 "//div[@id='display-field-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
2146 "http://www.kuali.org/?display_field");
2147 }
2148
2149
2150
2151
2152
2153 protected void testMissingExternalHelp2() throws Exception {
2154
2155 assertFalse(isElementPresent(By.cssSelector("input[title=\"Help for Missing External Help\"]")));
2156
2157
2158 assertFalse(isElementPresentByXpath("//div[@id='external-help-externalHelpUrl-empty']/*[@class='uif-helpImage']"));
2159
2160
2161 assertFalse(isElementPresentByXpath("//div[@id='external-help-helpdefinition-empty']/*[@class='uif-helpImage']"));
2162
2163
2164 assertFalse(isElementPresentByXpath("//div[@id='external-help-system-parm-missing']/*[@class='uif-helpImage']"));
2165
2166
2167 assertFalse(isElementPresentByXpath("//div[@id='standalone-external-help-missing']"));
2168 }
2169
2170 private String searchForAvailableCode(int codeLength) throws InterruptedException {
2171 String randomCode = RandomStringUtils.randomAlphabetic(codeLength).toUpperCase();
2172 waitAndTypeByName("code", randomCode);
2173 waitAndClickSearch();
2174 int attemptCount = 1;
2175 waitForTextPresent("You have entered the primary key for this table");
2176 while (!isTextPresent("No values match this search.") && attemptCount < 25) {
2177 randomCode = Character.toString((char) (randomCode.toCharArray()[0] + attemptCount++));
2178 clearTextByName("code");
2179 waitAndTypeByName("code", randomCode);
2180 waitAndClickSearch();
2181 waitForTextPresent("You have entered the primary key for this table");
2182 }
2183 return randomCode;
2184 }
2185
2186 protected void testSearchEditCancel() throws InterruptedException {
2187 selectFrameIframePortlet();
2188 waitAndClickSearch2();
2189 waitAndClickEdit();
2190 testCancelConfirmation();
2191 }
2192
2193 protected void testServerErrorsIT() throws Exception {
2194 waitAndClickByXpath("//button[contains(.,'Get Error Messages')]");
2195 waitForElementPresent("div[data-messages_for=\"Demo-ValidationLayout-SectionsPage\"] .uif-errorMessageItem-field");
2196 waitIsVisibleByXpath("//div[@data-header_for='Demo-ValidationLayout-Section1']");
2197 assertElementPresentByXpath("//*[@data-messageitemfor='Demo-ValidationLayout-Section1' and @class='uif-errorMessageItem']");
2198 assertElementPresent("div[data-role=\"InputField\"] img[alt=\"Error\"]");
2199 assertElementPresentByXpath("//a[contains(.,'Section 1 Title')]");
2200 fireMouseOverEventByXpath("//a[contains(.,'Field 1')]");
2201 assertElementPresent(".uif-errorMessageItem-field");
2202 waitAndClickByXpath("//a[contains(.,'Field 1')]");
2203 waitIsVisible(".jquerybubblepopup-innerHtml");
2204 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems");
2205 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
2206 waitAndTypeByName("field1", "");
2207 fireEvent("field1", "blur");
2208 fireEvent("field1", "focus");
2209 waitIsVisible(".jquerybubblepopup-innerHtml");
2210 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
2211 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems");
2212 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field");
2213 waitAndTypeByName("field1", "t");
2214
2215 for (int second = 0;; second++) {
2216 if (second >= waitSeconds) {
2217 jiraAwareFail(TIMEOUT_MESSAGE);
2218 }
2219 try {
2220 if (!isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems")) {
2221 break;
2222 }
2223 } catch (Exception e) {}
2224 Thread.sleep(1000);
2225 }
2226
2227 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
2228 assertFalse(isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
2229 }
2230
2231 protected void testServerInfoIT() throws Exception {
2232 waitAndClickByXpath("//button[contains(.,'Get Info Messages')]");
2233 waitIsVisibleByXpath("//div[@data-messages_for='Demo-ValidationLayout-SectionsPage']");
2234 assertTrue(isVisibleByXpath("//div[@data-messages_for='Demo-ValidationLayout-SectionsPage']"));
2235 assertTrue(isElementPresent("div[data-messages_for=\"Demo-ValidationLayout-SectionsPage\"] .uif-infoMessageItem"));
2236 assertTrue(isVisible("div[data-messages_for=\"Demo-ValidationLayout-Section1\"]"));
2237 assertTrue(isElementPresent("div[data-messages_for=\"Demo-ValidationLayout-Section1\"] .uif-infoMessageItem"));
2238 assertTrue(isElementPresentByXpath("//div[@data-role='InputField']//img[@alt='Information']"));
2239 fireMouseOverEventByXpath("//a[contains(.,'Field 1')]");
2240 assertTrue(isElementPresent(".uif-infoHighlight"));
2241 waitAndClickByXpath("//a[contains(.,'Field 1')]");
2242
2243 for (int second = 0;; second++) {
2244 if (second >= waitSeconds)
2245 jiraAwareFail(TIMEOUT_MESSAGE);
2246 try {
2247 if (isVisible(".jquerybubblepopup-innerHtml"))
2248 break;
2249 } catch (Exception e) {}
2250 Thread.sleep(1000);
2251 }
2252
2253 assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems"));
2254 assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-infoMessageItem-field"));
2255 waitAndTypeByName("field1", "");
2256 fireEvent("field1", "blur");
2257 fireEvent("field1", "focus");
2258
2259 for (int second = 0;; second++) {
2260 if (second >= waitSeconds)
2261 jiraAwareFail(TIMEOUT_MESSAGE);
2262 try {
2263 if (isVisible(".jquerybubblepopup-innerHtml"))
2264 break;
2265 } catch (Exception e) {}
2266 Thread.sleep(1000);
2267 }
2268
2269 assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-infoMessageItem-field"));
2270 for (int second = 0;; second++) {
2271 if (second >= waitSeconds)
2272 jiraAwareFail(TIMEOUT_MESSAGE);
2273 try {
2274 if (isVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"))
2275 break;
2276 } catch (Exception e) {}
2277 Thread.sleep(1000);
2278 }
2279
2280 assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field"));
2281 waitAndTypeByName("field1", "b");
2282 fireEvent("field1", "blur");
2283 fireEvent("field1", "focus");
2284
2285 for (int second = 0;; second++) {
2286 if (second >= waitSeconds)
2287 jiraAwareFail(TIMEOUT_MESSAGE);
2288 try {
2289 if (!isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"))
2290 break;
2291 } catch (Exception e) {}
2292 Thread.sleep(1000);
2293 }
2294
2295 fireEvent("field1", "blur");
2296 Thread.sleep(3000);
2297 assertTrue(!isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-infoMessageItem-field"));
2298 assertFalse(isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
2299 fireEvent("field1", "focus");
2300 clearTextByName("field1");
2301 fireEvent("field1", "blur");
2302 assertTrue(isElementPresent("div.uif-hasError"));
2303 assertTrue(isElementPresent("img[src*=\"error.png\"]"));
2304 }
2305
2306 protected void testServerWarningsIT() throws Exception {
2307 waitAndClickByXpath("//button[contains(.,'Get Warning Messages')]");
2308 waitForPageToLoad();
2309 Thread.sleep(3000);
2310 waitForElementPresentByXpath("//div[@id='Demo-ValidationLayout-SectionsPage_messages']");
2311 waitForElementPresentByXpath("//div[@id='Demo-ValidationLayout-Section1_messages']");
2312 fireMouseOverEventByXpath("//a[contains(.,'Field 1')]");
2313 waitForElementPresentByXpath("//div[@class='uif-inputField uif-boxLayoutHorizontalItem uif-hasWarning uif-warningHighlight']");
2314 waitAndClickByXpath("//a[contains(.,'Field 1')]");
2315 waitForElementVisible(".jquerybubblepopup-innerHtml", " after click on //a[contains(.,'Field 1')]");
2316 assertTrue(".jquerybubblepopup-innerHtml > .uif-serverMessageItems not visible", isVisible(
2317 ".jquerybubblepopup-innerHtml > .uif-serverMessageItems"));
2318 assertTrue(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field not visible",
2319 isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field"));
2320 waitAndTypeByName("field1", "");
2321 fireEvent("field1", "blur");
2322 fireMouseOverEventByName("field1");
2323 waitForElementVisible(".jquerybubblepopup-innerHtml",
2324 " not visible after typing nothing in name=field1 then firing blur and focus events");
2325 assertTrue(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field not visible after typing nothing in name=field1 then firing blur and focus events",
2326 isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field"));
2327 assertTrue(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field not visible after typing nothing in name=field1 then firing blur and focus events",
2328 isVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field"));
2329 waitAndTypeByName("field1", "b");
2330 fireEvent("field1", "blur");
2331 fireMouseOverEventByName("field1");
2332 waitForElementVisible(".jquerybubblepopup-innerHtml> .uif-serverMessageItems", "");
2333 assertTrue(".jquerybubblepopup-innerHtml > .uif-clientMessageItems",
2334 !isElementPresent(
2335 ".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
2336 clearTextByName("field1");
2337 fireEvent("field1", "blur");
2338 fireMouseOverEventByName("field1");
2339 assertTrue(".uif-hasError is not present after typing nothing in name=field1 and then firing focus and blur events",
2340 isElementPresent(".uif-hasError"));
2341 assertTrue("img[src*=\"error.png\"] is not present after typing nothing in name=field1 and then firing focus and blur events",
2342 isElementPresent("img[src*=\"error.png\"]"));
2343 passed();
2344 }
2345
2346
2347
2348
2349 protected void testViewHelp2() throws Exception {
2350
2351 if (isElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']")) {
2352 assertFalse(findElement(By.cssSelector("td.jquerybubblepopup-innerHtml")).isDisplayed());
2353 }
2354
2355
2356 fireMouseOverEventByXpath("//h1/span[@class='uif-headerText-span']");
2357 Thread.sleep(2000);
2358 assertTrue(isVisibleByXpath("//td[contains(text(),'View help')]"));
2359 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Configuration Test View\"]"), "HelpWindow", "http://www.kuali.org/");
2360 }
2361
2362 protected void testVerifyAddDeleteFiscalOfficerLegacy() throws Exception {
2363 selectFrameIframePortlet();
2364 waitAndTypeByName("document.documentHeader.documentDescription", AutomatedFunctionalTestUtils
2365 .createUniqueDtsPlusTwoRandomChars());
2366 waitAndTypeByName("newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].number","1234567890");
2367 waitAndTypeByName("newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].foId", "2");
2368 waitAndClickByXpath("//button[@data-loadingmessage='Adding Line...']");
2369 waitForElementPresentByName("document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number");
2370 assertEquals("1234567890", waitAndGetAttributeByName(
2371 "document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number", "value"));
2372 assertEquals("2", waitAndGetAttributeByName(
2373 "document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].foId", "value"));
2374 waitAndClickByXpath("//button[@data-loadingmessage='Deleting Line...']");
2375 Thread.sleep(3000);
2376 assertEquals(Boolean.FALSE, (Boolean) isElementPresentByName(
2377 "document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number"));
2378 passed();
2379 }
2380
2381 protected void testVerifyAddDeleteNoteLegacy() throws Exception {
2382 selectFrameIframePortlet();
2383 waitAndClick("div.tableborders.wrap.uif-boxLayoutVerticalItem.clearfix span.uif-headerText-span > img.uif-disclosure-image");
2384 waitForElementPresent("button[title='Add a Note'].uif-action.uif-primaryActionButton.uif-smallActionButton");
2385 waitAndClickByName("newCollectionLines['document.notes'].noteText");
2386 waitAndTypeByName("newCollectionLines['document.notes'].noteText", "Test note");
2387 waitAndClick("button[title='Add a Note'].uif-action.uif-primaryActionButton.uif-smallActionButton");
2388
2389 assertEquals("Test note", getTextByXpath("//pre"));
2390 waitAndClick("button[title='Delete a Note'].uif-action.uif-primaryActionButton.uif-smallActionButton");
2391 assertEquals(Boolean.FALSE, (Boolean) isElementPresentByName("document.notes[0].noteText"));
2392 passed();
2393 }
2394
2395 protected void testVerifyAdHocRecipientsLegacy() throws Exception {
2396 selectFrameIframePortlet();
2397 waitAndClickByLinkText("Fiscal Officer Accounts");
2398 assertElementPresentByXpath(
2399 "//select[@name=\"newCollectionLines['document.adHocRoutePersons'].actionRequested\"]");
2400 assertElementPresentByXpath(
2401 "//input[@name=\"newCollectionLines['document.adHocRoutePersons'].name\" and @type=\"text\"]");
2402 assertElementPresentByXpath(
2403 "//select[@name=\"newCollectionLines['document.adHocRouteWorkgroups'].actionRequested\"]");
2404 assertElementPresentByXpath(
2405 "//input[@name=\"newCollectionLines['document.adHocRouteWorkgroups'].recipientNamespaceCode\" and @type='text']");
2406 assertElementPresentByXpath(
2407 "//input[@name=\"newCollectionLines['document.adHocRouteWorkgroups'].recipientName\" and @type='text']");
2408 passed();
2409 }
2410
2411 protected void testVerifyButtonsLegacy() throws Exception {
2412 selectFrameIframePortlet();
2413 assertElementPresentByXpath("//button[contains(.,'ubmit')]");
2414 assertElementPresentByXpath("//button[contains(.,'ave')]");
2415 assertElementPresentByXpath("//button[contains(.,'lanket approve')]");
2416 assertElementPresentByXpath("//button[contains(.,'lose')]");
2417 assertElementPresentByXpath("//a[contains(.,'ancel')]");
2418 passed();
2419 }
2420
2421 protected void testVerifyConstraintText() throws Exception {
2422 selectFrameIframePortlet();
2423 assertEquals("* indicates required field", getText(
2424 "div.uif-boxLayout.uif-horizontalBoxLayout.clearfix > span.uif-message.uif-requiredInstructionsMessage.uif-boxLayoutHorizontalItem"));
2425 assertEquals("Must not be more than 10 characters", getText(
2426 "div.uif-group.uif-gridGroup.uif-gridSection.uif-disclosure.uif-boxLayoutVerticalItem.clearfix div[data-label='Travel Account Number'].uif-field.uif-inputField span.uif-message.uif-constraintMessage"));
2427 assertEquals("Must not be more than 10 characters", getText(
2428 "div.uif-group.uif-gridGroup.uif-gridSection.uif-disclosure.uif-boxLayoutVerticalItem.clearfix div[data-label='Travel Sub Account Number'].uif-field.uif-inputField span.uif-message.uif-constraintMessage"));
2429 assertEquals("Must not be more than 10 characters", getText(
2430 "div.uif-group.uif-gridGroup.uif-collectionItem.uif-gridCollectionItem.uif-collectionAddItem div[data-label='Travel Account Number'].uif-field.uif-inputField span.uif-message.uif-constraintMessage"));
2431 passed();
2432 }
2433
2434 protected void testVerifyEditedComponent(String docId, String componentName, String componentCode) throws Exception {
2435 selectFrameIframePortlet();
2436 waitAndTypeByName("name", componentName);
2437 waitAndClickSearch();
2438 isElementPresentByLinkText(componentName);
2439 waitAndClickByLinkText(componentName);
2440 waitForPageToLoad();
2441 Thread.sleep(2000);
2442 switchToWindow("Kuali :: Inquiry");
2443 Thread.sleep(2000);
2444 assertEquals(componentName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
2445 assertEquals(componentCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim());
2446 waitAndClickCloseWindow();
2447 switchToWindow("null");
2448 List<String> parameterList=new ArrayList<String>();
2449 }
2450
2451 protected void testVerifyDisclosures() throws Exception {
2452 selectFrameIframePortlet();
2453 assertElementPresentByXpath("//span[contains(text(),'Document Overview')]");
2454 assertElementPresentByXpath("//span[contains(text(),'Document Overview')]");
2455 assertElementPresentByXpath("//span[contains(text(),'Account Information')]");
2456 assertElementPresentByXpath("//span[contains(text(),'Fiscal Officer Accounts')]");
2457 assertElementPresentByXpath("//span[contains(text(),'Notes and Attachments')]");
2458 assertElementPresentByXpath("//span[contains(text(),'Ad Hoc Recipients')]");
2459 assertElementPresentByXpath("//span[contains(text(),'Route Log')]");
2460 colapseExpandByXpath("//span[contains(text(),'Document Overview')]//img", "//label[contains(text(),'Organization Document Number')]");
2461 colapseExpandByXpath("//span[contains(text(),'Account Information')]//img","//label[contains(text(),'Travel Account Type Code')]");
2462 colapseExpandByXpath("//span[contains(text(),'Fiscal Officer Accounts')]//img","//a[contains(text(),'Lookup/Add Multiple Lines')]");
2463 expandColapseByXpath("//span[contains(text(),'Notes and Attachments')]//img","//label[contains(text(),'Note Text')]");
2464 expandColapseByXpath("//span[contains(text(),'Ad Hoc Recipients')]","//span[contains(text(),'Ad Hoc Group Requests')]");
2465
2466
2467 waitAndClickByXpath("//span[contains(text(),'Route Log')]//img");
2468 selectFrame("routeLogIFrame");
2469 waitIsVisibleByXpath("//img[@alt='refresh']");
2470
2471
2472 selectTopFrame();
2473 selectFrameIframePortlet();
2474 waitAndClickByXpath("//span[contains(text(),'Route Log')]//img");
2475 selectFrame("routeLogIFrame");
2476 waitNotVisibleByXpath("//img[@alt='refresh']");
2477 passed();
2478 }
2479
2480 protected void testVerifyDocumentOverviewLegacy() throws Exception {
2481 selectFrameIframePortlet();
2482 assertTextPresent("Document Overview");
2483 assertElementPresentByXpath("//input[@name='document.documentHeader.documentDescription']");
2484 assertElementPresentByXpath("//input[@name='document.documentHeader.organizationDocumentNumber']");
2485 assertElementPresentByXpath("//textarea[@name='document.documentHeader.explanation']");
2486 passed();
2487 }
2488
2489 protected void testVerifyExpandCollapse() throws Exception {
2490 selectFrameIframePortlet();
2491 assertElementPresentByXpath("//button[contains(@class, 'uif-expandDisclosuresButton')]");
2492 assertElementPresentByXpath("//button[contains(@class, 'uif-collapseDisclosuresButton')]");
2493 passed();
2494 }
2495
2496 protected void testVerifyFieldsLegacy() throws Exception {
2497 selectFrameIframePortlet();
2498 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.number' and @type='text' and @size=10 and @maxlength=10]");
2499 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.extension.accountTypeCode' and @type='text' and @size=2 and @maxlength=3]");
2500 assertElementPresentByXpath(
2501 "//input[@name='document.newMaintainableObject.dataObject.subAccount' and @type='text' and @size=10 and @maxlength=10]");
2502 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.subsidizedPercent' and @type='text' and @size=6 and @maxlength=20]");
2503 assertElementPresentByXpath(
2504 "//input[@name='document.newMaintainableObject.dataObject.foId' and @type='text' and @size=5 and @maxlength=10]");
2505 assertElementPresentByXpath(
2506 "//input[@name=\"newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].number\" and @type='text' and @size=10 and @maxlength=10]");
2507 assertElementPresentByXpath(
2508 "//input[@name=\"newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].foId\" and @type='text' and @size=5 and @maxlength=10]");
2509 passed();
2510 }
2511
2512 protected void testVerifyHeaderFieldsLegacy() throws Exception {
2513 selectFrameIframePortlet();
2514 assertElementPresentByXpath("//div[contains(@class, 'uif-documentNumber')]");
2515 assertElementPresentByXpath("//div[contains(@class, 'uif-documentInitiatorNetworkId')]");
2516 assertElementPresentByXpath("//div[contains(@class, 'uif-documentStatus')]");
2517 assertElementPresentByXpath("//div[contains(@class, 'uif-documentCreateDate')]");
2518 passed();
2519 }
2520
2521 protected void testVerifyLookupAddMultipleLinesLegacy() throws Exception {
2522 selectFrameIframePortlet();
2523 assertElementPresentByXpath("//a[contains(text(),'Lookup/Add Multiple Lines')]");
2524 passed();
2525 }
2526
2527 protected void testVerifyNotesAndAttachments() throws Exception {
2528 selectFrameIframePortlet();
2529 waitAndClickByXpath("//span[contains(text(),'Notes and Attachments')]");
2530 waitForElementPresentByXpath("//button[@title='Add a Note']");
2531 assertElementPresentByXpath("//span[contains(text(),'Notes and Attachments')]");
2532 assertElementPresentByXpath("//textarea[@name=\"newCollectionLines['document.notes'].noteText\"]");
2533 assertElementPresentByXpath("//input[@name='attachmentFile']");
2534
2535
2536 passed();
2537 }
2538
2539 protected void testVerifyQuickfinderIconsLegacy() throws Exception {
2540 selectFrameIframePortlet();
2541 assertTextPresent("Document Overview");
2542 assertElementPresentByXpath("//*[@id='quickfinder1']");
2543 assertElementPresentByXpath("//*[@id='quickfinder2']");
2544 assertElementPresentByXpath("//*[@id='quickfinder3']");
2545 assertElementPresentByXpath("//*[@id='quickfinder4_add']");
2546
2547
2548 passed();
2549 }
2550
2551 protected void testVerifyRouteLog() throws Exception {
2552 selectFrameIframePortlet();
2553 waitAndClickByLinkText("Route Log");
2554 waitForElementPresent("//iframe[contains(@src,'RouteLog.do')]");
2555 passed();
2556 }
2557
2558 protected void testVerifySave() throws Exception {
2559 selectFrameIframePortlet();
2560 waitAndTypeByName("document.documentHeader.documentDescription", "Test Document " + AutomatedFunctionalTestUtils.DTS);
2561 waitAndClickByName("document.newMaintainableObject.dataObject.number");
2562 waitAndTypeByName("document.newMaintainableObject.dataObject.number", "1234567890");
2563 waitAndTypeByName("document.newMaintainableObject.dataObject.extension.accountTypeCode", "EAT");
2564 waitAndTypeByName("document.newMaintainableObject.dataObject.subAccount", "a1");
2565 waitAndClick(
2566 "button[data-loadingmessage='Saving...'].uif-action.uif-primaryActionButton.uif-boxLayoutHorizontalItem");
2567 Thread.sleep(2000);
2568
2569
2570 passed();
2571 }
2572
2573 protected void testVerifySubsidizedPercentWatermarkLegacy() throws Exception {
2574 selectFrameIframePortlet();
2575
2576
2577
2578 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.subsidizedPercent']");
2579 passed();
2580 }
2581
2582 protected void testWorkFlowDocTypeBlanketApprove() throws Exception {
2583 selectFrameIframePortlet();
2584 waitAndCreateNew();
2585 String docId = waitForDocId();
2586 assertBlanketApproveButtonsPresent();
2587 String dts = AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
2588 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Document Type " + dts);
2589 String parentDocType = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:document.newMaintainableObject.parentDocType.name,documentTypeId:document.newMaintainableObject.docTypeParentId,))).((`document.newMaintainableObject.parentDocType.name:name,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
2590 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
2591 waitAndClickByXpath(parentDocType);
2592 waitAndClickSearch();
2593 waitAndClickReturnValue();
2594 String docTypeName = "DocType" + dts;
2595 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", docTypeName);
2596 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedDocHandlerUrl']",
2597 "${kr.url}/maintenance.do?methodToCall=docHandler");
2598 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.label']",
2599 "Workflow Maintenance Document Type Document " + dts);
2600 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedHelpDefinitionUrl']",
2601 "default.htm?turl=WordDocuments%2Fdocumenttype.htm");
2602 blanketApproveTest(docId);
2603 }
2604
2605 protected void verifyRichMessagesValidationBasicFunctionality() throws Exception {
2606 assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field1']"));
2607 assertTrue(isElementPresentByXpath("//a[contains(text(), 'Kuali')]"));
2608 assertTrue(isElementPresentByXpath("//input[@type='checkbox' and @name='field2']"));
2609 Thread.sleep(3000);
2610 }
2611
2612 protected void verifyRichMessagesValidationAdvancedFunctionality() throws Exception {
2613
2614 assertTrue(isElementPresentByXpath("//span[@style='color: green;']"));
2615 assertTrue(isElementPresentByXpath("//span[@style='color: blue;']"));
2616
2617
2618 assertTrue(isElementPresentByXpath("//span[@class='uif-text-underline uif-text-larger']"));
2619
2620
2621 assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field3']"));
2622 assertTrue(isElementPresentByXpath("//select[@name='field4']"));
2623 assertTrue(isElementPresentByXpath("//button[contains(text(), 'Action Button')]"));
2624
2625
2626 assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/span[contains(., 'Color')]"));
2627 assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/i/b[contains(., 'Html')]"));
2628 assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/img[@class='uif-image inlineBlock']"));
2629 Thread.sleep(3000);
2630 }
2631
2632 protected void verifyRichMessagesValidationLettersNumbersValidation() throws Exception {
2633
2634 assertTrue(isElementPresentByXpath("//div[@data-parent='Demo-AdvancedMessagesSection']/div/input[@type='text' and @name='field5']"));
2635 waitAndTypeByXpath(
2636 "//div[@data-parent='Demo-AdvancedMessagesSection']/div/input[@type='text' and @name='field5']","abc");
2637 assertFalse(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
2638 clearTextByXpath(
2639 "//div[@data-parent='Demo-AdvancedMessagesSection']/div/input[@type='text' and @name='field5']");
2640 waitAndTypeByXpath("//div[@data-parent='Demo-AdvancedMessagesSection']/div/input[@type='text' and @name='field5']","abc12");
2641 waitAndTypeByXpath("//input[@name= 'field6']", "");
2642 waitForElementPresentByXpath("//div[@class='uif-inputField inlineBlock uif-hasError']");
2643 Thread.sleep(3000);
2644 clearTextByXpath("//div[@data-parent='Demo-AdvancedMessagesSection']/div/input[@type='text' and @name='field5']");
2645 waitAndTypeByXpath("//div[@data-parent='Demo-AdvancedMessagesSection']/div/input[@type='text' and @name='field5']","abc");
2646 waitAndTypeByXpath("//input[@name= 'field6']", "");
2647
2648
2649 waitAndTypeByXpath("//input[@name= 'field6']", "123");
2650 assertFalse(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
2651 clearTextByXpath("//input[@name='field6']");
2652 waitAndTypeByXpath("//input[@name='field6']", "123ab");
2653 fireEvent("field6", "blur");
2654 waitForElementPresentByXpath("//div[@class='uif-inputField inlineBlock uif-hasError']");
2655 }
2656
2657 protected void verifyRichMessagesValidationRadioAndCheckBoxGroupFunctionality() throws Exception {
2658
2659 assertTrue(isElementPresentByXpath("//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='1']"));
2660 assertTrue(isElementPresentByXpath(
2661 "//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='2']"));
2662 assertTrue(isElementPresentByXpath(
2663 "//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='3']"));
2664 assertTrue(isElementPresentByXpath(
2665 "//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='4']"));
2666
2667
2668 assertTrue(isElementPresentByXpath(
2669 "//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='1']"));
2670 assertTrue(isElementPresentByXpath("//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='2']"));
2671 assertTrue(isElementPresentByXpath(
2672 "//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='3']"));
2673 assertTrue(isElementPresentByXpath(
2674 "//fieldset[@class='uif-verticalCheckboxesFieldset']/span/label/div/select[@name='field4']"));
2675
2676
2677 assertTrue(isElementPresentByXpath("//input[@type='checkbox' and @name='bField1']"));
2678 assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field103']"));
2679 }
2680
2681 protected void verifyRichMessagesValidationLinkDeclarationsFunctionality() throws Exception {
2682
2683 waitAndClickByLinkText("Kuali Site");
2684 Thread.sleep(9000);
2685 switchToWindow("Open Source Software | www.kuali.org");
2686 switchToWindow(RICH_MESSAGES_WINDOW_TITLE);
2687
2688
2689 waitAndClickByXpath("//p[contains(., 'Testing methodToCall action')]/a");
2690 Thread.sleep(3000);
2691 assertTrue(isElementPresentByXpath(
2692 "//div[@class='alert-danger']"));
2693
2694
2695 waitAndClickByXpath("//p[contains(., 'Testing methodToCall action (no client validation check)')]/a");
2696 assertTrue(isElementPresentByXpath("//div[@id='Demo-BasicMessagesSection_messages' and @class='alert alert-danger']"));
2697 assertTrue(isElementPresentByXpath("//div[@id='Demo-AdvancedMessagesSection_messages' and @class='alert alert-danger']"));
2698 Thread.sleep(3000);
2699 }
2700
2701 protected void waitAndClickAdministration() throws InterruptedException {
2702 waitAndClickByLinkText(ADMINISTRATION_LINK_TEXT, this);
2703 }
2704
2705
2706
2707
2708
2709
2710 private void waitAndClickAdministration(JiraAwareFailable failable) throws InterruptedException {
2711 waitAndClickByLinkText(ADMINISTRATION_LINK_TEXT, failable);
2712 }
2713
2714 protected void waitAndCancelConfirmation() throws InterruptedException {
2715 waitAndClickCancel();
2716 waitAndClickByName("methodToCall.processAnswer.button0");
2717 }
2718
2719
2720
2721
2722
2723 protected void waitAndClickCancel() throws InterruptedException {
2724 waitAndClickByName(CANCEL_NAME);
2725 }
2726
2727
2728
2729
2730
2731 protected void waitAndClickCloseWindow() throws InterruptedException {
2732 waitAndClickByXpath(CLOSE_WINDOW_XPATH_TITLE);
2733 }
2734
2735
2736
2737
2738
2739 protected void waitAndClickCopy() throws InterruptedException {
2740 waitAndClickByLinkText(COPY_LINK_TEXT);
2741 }
2742
2743
2744
2745
2746
2747 protected void waitAndClickDocSearch() throws InterruptedException {
2748 waitAndClickByXpath(DOC_SEARCH_XPATH);
2749 }
2750
2751
2752
2753
2754
2755 protected void waitAndClickDocSearchTitle() throws InterruptedException {
2756 waitAndClickByXpath(DOC_SEARCH_XPATH_TITLE);
2757 }
2758
2759
2760
2761
2762
2763 protected void waitAndClickLogout() throws InterruptedException {
2764 waitAndClickLogout(this);
2765 }
2766
2767
2768
2769
2770
2771
2772 protected void waitAndClickLogout(JiraAwareFailable failable) throws InterruptedException {
2773 jGrowl("Logging out");
2774 selectTopFrame();
2775 waitAndClickByXpath(LOGOUT_XPATH, failable);
2776 }
2777
2778 protected void waitAndClickMainMenu() throws InterruptedException {
2779 waitAndClickByLinkText(MAIN_MENU_LINK_TEXT, this);
2780 }
2781
2782
2783
2784
2785
2786
2787 private void waitAndClickMainMenu(JiraAwareFailable failable) throws InterruptedException {
2788 waitAndClickByLinkText(MAIN_MENU_LINK_TEXT, failable);
2789 }
2790
2791
2792
2793
2794
2795 protected void waitAndClickSave() throws InterruptedException {
2796 waitAndClickByXpath(SAVE_XPATH);
2797 }
2798
2799
2800
2801
2802
2803 protected void waitAndClickSubmit() throws InterruptedException {
2804 waitAndClickByXpath(SUBMIT_XPATH);
2805 }
2806
2807
2808
2809
2810
2811
2812 protected void waitAndClickXMLIngester(JiraAwareFailable failable) throws InterruptedException {
2813 waitAndClickByLinkText(XML_INGESTER_LINK_TEXT, failable);
2814 }
2815
2816 protected void waitAndCreateNew() throws InterruptedException {
2817 waitAndCreateNew(this.getClass().toString());
2818 }
2819
2820 protected void waitAndCreateNew(String message) throws InterruptedException {
2821 selectFrameIframePortlet();
2822 jGrowl("Create New");
2823 waitAndClickCreateNew(message);
2824 }
2825
2826
2827
2828
2829
2830 protected void waitAndClickCreateNew() throws InterruptedException {
2831 waitAndClickCreateNew(this.getClass().toString());
2832 }
2833
2834 protected void waitAndClickCreateNew(String message) throws InterruptedException {
2835 jGrowl("Click Create New");
2836 if (WebDriverUtils.waitFors(driver, By.xpath(CREATE_NEW_XPATH)).size() > 0) {
2837 waitAndClickByXpath(CREATE_NEW_XPATH, message);
2838 } else {
2839 System.out.println("waitAndClickByXpath(" + CREATE_NEW_XPATH + ") wasn't found trying " + CREATE_NEW_XPATH2);
2840 waitAndClickByXpath(CREATE_NEW_XPATH2, message);
2841 }
2842 }
2843
2844 protected void waitAndClickEdit() throws InterruptedException {
2845 waitAndClickByLinkText(EDIT_LINK_TEXT);
2846 }
2847
2848
2849
2850
2851
2852 protected void waitAndClickSearch() throws InterruptedException {
2853 jGrowl("Click Search");
2854 waitAndClickByXpath(SEARCH_XPATH);
2855 }
2856
2857 protected void waitAndClickSearch2() throws InterruptedException {
2858 jGrowl("Click Search");
2859 waitAndClickByXpath(SEARCH_XPATH_2);
2860 }
2861
2862 protected void waitAndClickSearchSecond() throws InterruptedException {
2863 jGrowl("Click Search");
2864 waitAndClickByXpath(SEARCH_SECOND);
2865 }
2866
2867 protected String waitForDocId() throws InterruptedException {
2868 checkForDocError();
2869 waitForElementPresentByXpath(DOC_ID_XPATH);
2870
2871 return findElement(By.xpath(DOC_ID_XPATH)).getText();
2872 }
2873
2874 protected String waitForDocInitiator() throws InterruptedException {
2875 waitForElementPresentByXpath(DOC_INITIATOR_XPATH);
2876
2877 return findElement(By.xpath(DOC_INITIATOR_XPATH)).getText();
2878 }
2879
2880 protected String waitForDocStatus() throws InterruptedException {
2881 waitForElementPresentByXpath(DOC_STATUS_XPATH);
2882
2883 return findElement(By.xpath(DOC_STATUS_XPATH)).getText();
2884 }
2885
2886 protected void waitForTitleToEqualKualiPortalIndex() throws InterruptedException {
2887 waitForTitleToEqualKualiPortalIndex(this.getClass().toString());
2888 }
2889
2890 protected void waitForTitleToEqualKualiPortalIndex(String message) throws InterruptedException {
2891 Thread.sleep(2000);
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903 }
2904
2905
2906
2907
2908
2909 protected void waitAndClickKRAD() throws InterruptedException {
2910 waitAndClickByLinkText(KRAD_XPATH);
2911 }
2912
2913
2914
2915
2916
2917
2918 protected boolean isKrad(){
2919 return (AutomatedFunctionalTestUtils.REMOTE_UIF_KRAD.equalsIgnoreCase(getUiFramework()));
2920 }
2921
2922
2923
2924
2925
2926
2927 public String getUiFramework() {
2928 return uiFramework;
2929 }
2930
2931
2932
2933
2934 public void setUiFramework(String uiFramework) {
2935 this.uiFramework = uiFramework;
2936 }
2937 }