1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.common;
17
18 import com.thoughtworks.selenium.SeleneseTestBase;
19 import edu.samplu.admin.test.AdminTmplMthdSTNavBase;
20 import org.apache.commons.lang.RandomStringUtils;
21 import org.apache.commons.logging.Log;
22 import org.apache.commons.logging.LogFactory;
23 import org.junit.After;
24 import org.junit.Before;
25 import org.junit.BeforeClass;
26 import org.junit.Rule;
27 import org.junit.rules.TestName;
28 import org.openqa.selenium.Alert;
29 import org.openqa.selenium.By;
30 import org.openqa.selenium.JavascriptExecutor;
31 import org.openqa.selenium.WebDriver;
32 import org.openqa.selenium.WebDriverException;
33 import org.openqa.selenium.WebElement;
34 import org.openqa.selenium.chrome.ChromeDriverService;
35 import org.openqa.selenium.interactions.Actions;
36 import org.openqa.selenium.remote.RemoteWebDriver;
37 import org.openqa.selenium.support.ui.Select;
38 import org.testng.annotations.AfterMethod;
39 import org.testng.annotations.BeforeMethod;
40
41 import java.util.ArrayList;
42 import java.util.Calendar;
43 import java.util.List;
44 import java.util.Set;
45 import java.util.concurrent.TimeUnit;
46
47 import static org.junit.Assert.assertEquals;
48 import static org.junit.Assert.assertNotSame;
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 public abstract class WebDriverLegacyITBase implements Failable {
68
69
70
71
72 public static final String ADMINISTRATION_LINK_TEXT = "Administration";
73
74
75
76
77 public static final String AGENDA_LOOKUP_LINK_TEXT = "Agenda Lookup";
78
79
80
81
82 public static final String ARIA_INVALID_XPATH = "//input[@aria-invalid]";
83
84
85
86
87 public static final String BLANKET_APPROVE_NAME = "methodToCall.blanketApprove";
88
89
90
91
92
93 public static final String CANCEL_NAME = "methodToCall.cancel";
94
95
96
97
98
99 public static final String CANCEL2_XPATH = "//a[contains(text(), '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')])[3]";
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 int DEFAULT_WAIT_SEC = 30;
140
141
142
143
144 public static final String DIV_LEFT_ERRMSG = "//div[@class='left-errmsg-tab']/div/div";
145
146
147
148
149 public static final String DOC_ID_XPATH = "//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]";
150
151
152
153
154 public static final String DOC_ID_XPATH_2 = "//table[@id='row']/tbody/tr[1]/td[1]";
155
156
157
158
159 public static final String DOC_ID_XPATH_3 ="//table[@id='row']/tbody/tr[1]/td[1]/a";
160
161
162
163
164 public static final String DOC_DESCRIPTION_XPATH ="//input[@id='document.documentHeader.documentDescription']";
165
166
167
168
169 public static final String DOC_SEARCH_XPATH = "//img[@alt='doc search']";
170
171
172
173
174 public static final String DOC_SEARCH_XPATH_TITLE = "//a[@title='Document Search']";
175
176
177
178
179 public static final String DOC_STATUS_ENROUTE = "ENROUTE";
180
181
182
183
184 public static final String DOC_STATUS_FINAL = "FINAL";
185
186
187
188
189 public static final String DOC_STATUS_SAVED = "SAVED";
190
191
192
193
194 public static final String DOC_STATUS_XPATH = "//table[@class='headerinfo']//tr[1]/td[2]";
195
196
197
198
199 public static final String DOC_STATUS_XPATH_2 = "//table[@id='row']/tbody/tr[1]/td[4]";
200
201
202
203
204 public static final String DOC_SUBMIT_SUCCESS_MSG_XPATH ="//div[contains(div,'Document was successfully submitted.')]";
205
206
207
208
209 public static final String EDIT_LINK_TEXT = "edit";
210
211
212
213
214
215 public static final boolean JGROWL_ERROR_FAILURE = false;
216
217
218
219
220 public static final String IFRAMEPORTLET_NAME = "iframeportlet";
221
222
223
224
225 public static final String KITCHEN_SINK_XPATH = "(//a[contains(text(),'Uif Components (Kitchen Sink)')])[2]";
226
227
228
229
230 public static final String KRAD_XPATH = "KRAD";
231
232
233
234
235 public static final String KUALI_UIF_COMPONENTS_WINDOW_XPATH = "Kuali :: Uif Components";
236
237
238
239
240 public static final String KUALI_VIEW_WINDOW_TITLE = "Kuali :: View Title";
241
242
243
244
245 public static final String LOGOUT_XPATH = "//input[@name='imageField' and @value='Logout']";
246
247
248
249
250 public static final String MAIN_MENU_LINK_TEXT = "Main Menu";
251
252
253
254
255 public static final String REGEX_ERROR = "^[\\s\\S]*error[\\s\\S]*$";
256
257
258
259
260 public static final String REGEX_VALID = "^.*\\bvalid\\b.*$";
261
262
263
264
265 public static final String REMOTE_PUBLIC_USER_PROPERTY = "remote.public.user";
266
267
268
269
270 public static final String REMOTE_PUBLIC_USERPOOL_PROPERTY = "remote.public.userpool";
271
272
273
274
275 public static final String REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY = "remote.public.wait.seconds";
276
277
278
279
280 public static final String RETURN_VALUE_LINK_TEXT = "return value";
281
282
283
284
285 public static final String RICH_MESSAGES_WINDOW_TITLE = "Kuali :: Rich Messages";
286
287
288
289
290 public static final String SAVE_SUCCESSFUL_XPATH = "//div[contains(div,'Document was successfully saved.')]";
291
292
293
294
295 public static final String SAVE_XPATH="//input[@name='methodToCall.save' and @alt='save']";
296
297
298
299
300
301 public static final String SAVE_XPATH_2 = "//*[@name='methodToCall.save' and @alt='save']";
302
303
304
305
306 public static final String SAVE_XPATH_3 = "//input[@title='search' and @name='methodToCall.search']";
307
308
309
310
311 public static final String SEARCH_XPATH="//input[@name='methodToCall.search' and @value='search']";
312
313
314
315
316 public static final String SUBMIT_XPATH="//input[@name='methodToCall.route' and @alt='submit']";
317
318
319
320
321 public static final String SEARCH_XPATH_2 = "//input[@value='search']";
322
323
324
325
326 public static final String SEARCH_XPATH_3 = "//button[contains(text(),'Search')]";
327
328
329
330
331 public static final String SUB_COLLECTION_UIF_DISCLOSURE_SPAN_UIF_HEADER_TEXT_SPAN_XPATH =
332 "div.uif-group.uif-collectionGroup.uif-tableCollectionGroup.uif-tableSubCollection.uif-disclosure span.uif-headerText-span";
333
334
335
336
337 public static final String TIMEOUT_MESSAGE = "timeout";
338
339
340
341
342 public static final String TRAVEL_ACCOUNT_LOOKUP_LINK_TEXT = "Travel Account Lookup";
343
344
345
346
347 public static final String UIF_COMPONENTS_KITCHEN_SINK_LINK_TEXT = "Uif Components (Kitchen Sink)";
348
349
350
351
352 public static final String VALIDATION_FRAMEWORK_DEMO_XPATH = "(//a[contains(text(),'Validation Framework Demo')])[2]";
353
354
355
356
357 public static final String XML_INGESTER_LINK_TEXT = "XML Ingester";
358
359 protected WebDriver driver;
360 protected String user = "admin";
361 protected int waitSeconds = DEFAULT_WAIT_SEC;
362 protected boolean passed = false;
363 static ChromeDriverService chromeDriverService;
364 private Log log = LogFactory.getLog(getClass());
365
366 public @Rule
367 TestName testName = new TestName();
368
369 protected String testMethodName;
370
371 protected String jGrowlHeader;
372
373 String sessionId = null;
374
375
376
377
378
379
380 @BeforeClass
381 public static void chromeDriverService() throws Exception {
382 chromeDriverService = WebDriverUtil.chromeDriverCreateCheck();
383 if (chromeDriverService != null)
384 chromeDriverService.start();
385 }
386
387
388
389
390
391
392
393 public abstract String getTestUrl();
394
395
396
397
398
399
400
401
402 @Before
403 @BeforeMethod
404 public void setUp() throws Exception {
405
406 if (testName != null) {
407 testMethodName = testName.getMethodName();
408 } else {
409 testMethodName = "TODO TestNG test method name.";
410 }
411
412 try {
413 waitSeconds = Integer.parseInt(System.getProperty(REMOTE_PUBLIC_WAIT_SECONDS_PROPERTY, DEFAULT_WAIT_SEC + ""));
414 String givenUser = WebDriverUtil.determineUser(this.toString());
415 if (givenUser != null) {
416 user = givenUser;
417 }
418
419 driver = WebDriverUtil.setUp(getUserName(), getTestUrl(), getClass().getSimpleName(), testMethodName);
420 this.sessionId = ((RemoteWebDriver) driver).getSessionId().toString();
421 } catch (Exception e) {
422 fail("Exception in setUp " + e.getMessage());
423 e.printStackTrace();
424 }
425 WebDriverUtil.login(driver, user, this);
426 jGrowlHeader = getClass().getSimpleName() + "." + testMethodName;
427 jGrowl("setUp");
428 }
429
430
431
432
433
434
435
436
437 @After
438 @AfterMethod
439 public void tearDown() throws Exception {
440 try {
441 if (!passed) {
442 jGrowlSticky("FAILURE!");
443 }
444 WebDriverUtil.tearDown(passed, sessionId, this.toString().trim(), user);
445 } catch (Exception e) {
446 System.out.println("Exception in tearDown " + e.getMessage());
447 e.printStackTrace();
448 } finally {
449 if (driver != null) {
450 if (ITUtil.dontTearDownPropertyNotSet()) {
451 driver.close();
452 driver.quit();
453 }
454 } else {
455 System.out.println("WebDriver is null for " + this.getClass().toString() + ", if using saucelabs, has" +
456 " sauceleabs been uncommented in WebDriverUtil.java? If using a remote hub did you include the port?");
457 }
458 }
459 }
460
461
462
463
464 protected void passed() {
465 passed = true;
466 jGrowlSticky("Passed");
467 }
468
469 protected void agendaLookupAssertions() throws Exception {
470 testLookUp();
471 assertTextPresent("Rules");
472 waitAndClick(By.xpath(CANCEL2_XPATH));
473 }
474
475
476
477
478
479 protected void alertAccept() {
480 Alert alert = driver.switchTo().alert();
481
482 alert.accept();
483 }
484
485
486
487
488
489 protected void alertDismiss() {
490 Alert alert = driver.switchTo().alert();
491
492 alert.dismiss();
493 }
494
495 protected void assertAttributeClassRegexDoesntMatch(String field, String regex) throws InterruptedException {
496 String attribute = getAttributeByName(field, "class");
497 SeleneseTestBase.assertTrue("getAttributeByName(" + field + ", \"class\") should not be null", attribute != null);
498 SeleneseTestBase.assertFalse("attribute " + attribute + " matches regex " + regex + " and it should not",
499 attribute.matches(regex));
500 }
501
502 protected void assertAttributeClassRegexMatches(String field, String regex) throws InterruptedException {
503 String attribute = getAttributeByName(field, "class");
504 SeleneseTestBase.assertTrue("getAttributeByName(" + field + ", \"class\") should not be null", attribute != null);
505 SeleneseTestBase.assertTrue("attribute " + attribute + " doesn't match regex " + regex, attribute.matches(regex));
506 }
507
508 protected void assertBlanketApproveButtonsPresent() {
509 assertElementPresentByName("methodToCall.route");
510 assertElementPresentByName("methodToCall.save");
511 assertElementPresentByName(BLANKET_APPROVE_NAME, "Blanket Approve button not present does " + user + " have permssion?");
512 assertElementPresentByName("methodToCall.close");
513 assertElementPresentByName(CANCEL_NAME);
514 }
515
516 protected void assertCancelConfirmation() throws InterruptedException {
517 waitAndClickByLinkText("Cancel");
518 alertDismiss();
519 }
520
521 protected void assertDocFinal(String docId) throws InterruptedException {
522 jiraAwareWaitFor(By.linkText("spreadsheet"), "");
523
524 if (isElementPresent(By.linkText(docId))) {
525 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getDocStatus());
526 } else {
527 SeleneseTestBase.assertEquals(docId,driver.findElement(By.xpath(DOC_ID_XPATH_2)));
528 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getDocStatus());
529 }
530 }
531
532 protected void assertElementPresentByName(String name) {
533 driver.findElement(By.name(name));
534 }
535
536 protected void assertElementPresentByName(String name, String message) {
537 try {
538 driver.findElement(By.name(name));
539 } catch (Exception e) {
540 SeleneseTestBase.fail(name + " not present " + message);
541 }
542 }
543
544 protected void assertElementPresentByXpath(String locator) {
545 driver.findElement(By.xpath(locator));
546 }
547
548 protected void assertElementPresentByXpath(String locator, String message) {
549 try {
550 driver.findElement(By.xpath(locator));
551 } catch (Exception e) {
552 jiraAwareFail(By.xpath(locator), message, e);
553 }
554 }
555
556 protected void assertElementPresentByLinkText(String linkText) {
557 driver.findElement(By.linkText(linkText));
558 }
559
560 protected void assertElementPresent(String locator) {
561 driver.findElement(By.cssSelector(locator));
562 }
563
564 protected void assertFocusTypeBlurError(String field, String textToType) throws InterruptedException {
565 fireEvent(field, "focus");
566 waitAndTypeByName(field, textToType);
567 fireEvent(field, "blur");
568 Thread.sleep(200);
569 assertAttributeClassRegexMatches(field, REGEX_ERROR);
570 }
571
572 protected void assertFocusTypeBlurError(String field, String[] errorInputs) throws InterruptedException {
573 for (String errorInput: errorInputs) {
574 assertFocusTypeBlurError(field, errorInput);
575 clearTextByName(field);
576 }
577 }
578
579 protected void assertFocusTypeBlurValid(String field, String textToType) throws InterruptedException {
580 fireEvent(field, "focus");
581 waitAndTypeByName(field, textToType);
582 fireEvent(field, "blur");
583 Thread.sleep(200);
584 assertAttributeClassRegexMatches(field, REGEX_VALID);
585 assertAttributeClassRegexDoesntMatch(field, REGEX_ERROR);
586 }
587
588 protected void assertFocusTypeBlurValid(String field, String[] validInputs) throws InterruptedException {
589 for (String validInput: validInputs) {
590 assertFocusTypeBlurValid(field, validInput);
591 clearTextByName(field);
592 }
593 }
594
595
596
597
598
599
600
601
602 protected void assertPopUpWindowUrl(By by, String windowName, String url) {
603 driver.findElement(by).click();
604 String parentWindowHandle = driver.getWindowHandle();
605
606 driver.switchTo().window(windowName).findElements(By.tagName("head"));
607 SeleneseTestBase.assertEquals(url, driver.getCurrentUrl());
608 driver.switchTo().window(parentWindowHandle);
609 }
610
611 protected void assertTableLayout() {
612 String pageSource = driver.getPageSource();
613 SeleneseTestBase.assertTrue(pageSource.contains("Table Layout"));
614 SeleneseTestBase.assertTrue(pageSource.contains("Field 1"));
615 SeleneseTestBase.assertTrue(pageSource.contains("Field 2"));
616 SeleneseTestBase.assertTrue(pageSource.contains("Field 3"));
617 SeleneseTestBase.assertTrue(pageSource.contains("Field 4"));
618 SeleneseTestBase.assertTrue(pageSource.contains("Actions"));
619 }
620
621 protected void assertTextPresent(String text) {
622 assertTextPresent(text, "");
623 }
624
625 protected void assertTextPresent(String text, String message) {
626 if (!driver.getPageSource().contains(text)) {
627 SeleneseTestBase.fail(text + " not present " + message);
628 }
629 }
630
631
632
633
634
635
636
637
638 protected void blanketApproveTest() throws InterruptedException {
639 ITUtil.checkForIncidentReport(driver.getPageSource(), BLANKET_APPROVE_NAME, this, "");
640 waitAndClickByName(BLANKET_APPROVE_NAME,
641 "No blanket approve button does the user " + getUserName() + " have permission?");
642 Thread.sleep(2000);
643
644 checkForDocError();
645
646 ITUtil.checkForIncidentReport(driver.getPageSource(), DOC_SEARCH_XPATH, this, "Blanket Approve failure");
647 waitAndClickDocSearch();
648 SeleneseTestBase.assertEquals("Kuali Portal Index", driver.getTitle());
649 selectFrameIframePortlet();
650 waitAndClickSearch();
651 }
652
653 protected void check(By by) throws InterruptedException {
654 WebElement element = driver.findElement(by);
655
656 if (!element.isSelected()) {
657 element.click();
658 }
659 }
660
661 protected void checkByName(String name) throws InterruptedException {
662 check(By.name(name));
663 }
664
665 protected void checkByXpath(String locator) throws InterruptedException {
666 check(By.xpath(locator));
667 }
668
669 protected void checkErrorMessageItem(String message) {
670 final String error_locator = "//li[@class='uif-errorMessageItem']";
671 assertElementPresentByXpath(error_locator);
672 String errorText = null;
673
674 try {
675 errorText = getTextByXpath(error_locator);
676 } catch (InterruptedException e) {
677 e.printStackTrace();
678 }
679
680 if (errorText != null && errorText.contains("errors")) {
681 SeleneseTestBase.fail(errorText + message);
682 }
683 }
684
685 public void checkForDocError() {
686 if (driver.findElements(By.xpath(ITUtil.DIV_ERROR_LOCATOR)).size() > 0) {
687 String errorText = driver.findElement(By.xpath(ITUtil.DIV_ERROR_LOCATOR)).getText();
688 if (errorText != null && errorText.contains("error(s) found on page.")) {
689 errorText = ITUtil.blanketApprovalCleanUpErrorText(errorText);
690 if (driver.findElements(By.xpath(ITUtil.DIV_EXCOL_LOCATOR)).size() > 0) {
691 errorText = ITUtil.blanketApprovalCleanUpErrorText(driver.findElement(
692 By.xpath(ITUtil.DIV_EXCOL_LOCATOR)).getText());
693 }
694 if (driver.findElements(By.xpath(DIV_LEFT_ERRMSG)).size() > 0) {
695 errorText = errorText + ITUtil.blanketApprovalCleanUpErrorText(driver.findElement(By.xpath(DIV_LEFT_ERRMSG)).getText());
696 }
697 SeleneseTestBase.fail(errorText);
698 }
699 }
700 }
701
702 protected void checkForIncidentReport() {
703 checkForIncidentReport("", "");
704 }
705
706 protected void checkForIncidentReport(String locator) {
707 checkForIncidentReport(locator, "");
708 }
709
710 protected void checkForIncidentReport(String locator, String message) {
711 ITUtil.checkForIncidentReport(driver.getPageSource(), locator, this, message);
712 }
713
714 protected void checkForIncidentReport(String locator, Failable failable, String message) {
715 ITUtil.checkForIncidentReport(driver.getPageSource(), locator, failable, message);
716 }
717
718 protected void clearText(By by) throws InterruptedException {
719 driver.findElement(by).clear();
720 }
721
722 protected void clearText(String selector) throws InterruptedException {
723 clearText(By.cssSelector(selector));
724 }
725
726 protected void clearTextByName(String name) throws InterruptedException {
727 clearText(By.name(name));
728 }
729
730 protected void clearTextByXpath(String locator) throws InterruptedException {
731 clearText(By.xpath(locator));
732 }
733
734 protected void close() {
735 driver.close();
736 }
737
738 protected void colapseExpandByXpath(String clickLocator, String visibleLocator) throws InterruptedException {
739 waitAndClickByXpath(clickLocator);
740 waitNotVisibleByXpath(visibleLocator);
741 waitAndClickByXpath(clickLocator);
742 waitIsVisibleByXpath(visibleLocator);
743 }
744
745 protected String configNameSpaceBlanketApprove() throws Exception {
746 String docId = waitForDocId();
747 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Namespace " + ITUtil.DTS_TWO);
748 assertBlanketApproveButtonsPresent();
749 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", "VTN" + ITUtil.DTS_TWO);
750 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']",
751 "Validation Test NameSpace " + ITUtil.DTS_TWO);
752 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.applicationId']", "RICE");
753
754 return docId;
755 }
756
757 protected void contextLookupAssertions() throws Exception {
758 testLookUp();
759 assertTextPresent("Notes and Attachments");
760 waitAndClick(By.xpath(CANCEL2_XPATH));
761 passed();
762 }
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794 protected void expandColapseByXpath(String clickLocator, String visibleLocator) throws InterruptedException {
795 waitAndClickByXpath(clickLocator);
796 waitIsVisibleByXpath(visibleLocator);
797 waitAndClickByXpath(clickLocator);
798 waitNotVisibleByXpath(visibleLocator);
799 }
800
801
802
803
804
805
806 public String[] getAllWindowTitles() {
807 return (String[]) driver.getWindowHandles().toArray();
808 }
809
810 protected String getAttribute(By by, String attribute) throws InterruptedException {
811 jiraAwareWaitFor(by, "");
812
813 return driver.findElement(by).getAttribute(attribute);
814 }
815
816
817
818
819
820
821
822 protected String getAttributeByName(String name, String attribute) throws InterruptedException {
823 return getAttribute(By.name(name), attribute);
824 }
825
826
827
828
829
830
831
832 protected String getAttributeByXpath(String locator, String attribute) throws InterruptedException {
833 return getAttribute(By.xpath(locator), attribute);
834 }
835
836 protected String getBaseUrlString() {
837 return ITUtil.getBaseUrlString();
838 }
839
840 protected int getCssCount(String selector) {
841 return getCssCount(By.cssSelector(selector));
842 }
843
844 protected int getCssCount(By by) {
845 return (driver.findElements(by)).size();
846 }
847
848 protected String getDocStatus() {
849 return driver.findElement(By.xpath(DOC_STATUS_XPATH_2)).getText();
850 }
851
852 protected String[] getSelectOptions(By by) throws InterruptedException {
853 WebElement select1 = driver.findElement(by);
854 List<WebElement> options = select1.findElements(By.tagName("option"));
855 String[] optionValues = new String[options.size()];
856 int counter = 0;
857
858 for (WebElement option : options) {
859 optionValues[counter] = option.getAttribute("value");
860 counter++;
861 }
862
863 return optionValues;
864 }
865
866 protected String[] getSelectOptionsByName(String name) throws InterruptedException {
867 return getSelectOptions(By.name(name));
868 }
869
870 protected String[] getSelectOptionsByXpath(String locator) throws InterruptedException {
871 return getSelectOptions(By.xpath(locator));
872 }
873
874
875
876
877
878 public String getSessionId() {
879 return sessionId;
880 }
881
882 protected String getText(By by) throws InterruptedException {
883 return driver.findElement(by).getText();
884 }
885
886 protected String getTextByName(String name) throws InterruptedException {
887 return getText(By.name(name));
888 }
889
890 protected String getText(String locator) throws InterruptedException {
891 return getText(By.cssSelector(locator));
892 }
893
894 protected String getTextByXpath(String locator) throws InterruptedException {
895 return getText(By.xpath(locator));
896 }
897
898 protected String getTitle() {
899 return driver.getTitle();
900 }
901
902
903
904
905
906 public String getUserName() {
907 return user;
908 }
909
910
911
912
913
914 protected void gotoNestedFrame() {
915 driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
916 driver.switchTo().defaultContent();
917
918 if (driver.findElements(By.xpath("//iframe")).size() > 0) {
919 WebElement containerFrame = driver.findElement(By.xpath("//iframe"));
920 driver.switchTo().frame(containerFrame);
921 }
922
923 if (driver.findElements(By.xpath("//iframe")).size() > 0) {
924 WebElement contentFrame = driver.findElement(By.xpath("//iframe"));
925 driver.switchTo().frame(contentFrame);
926 }
927
928 driver.manage().timeouts().implicitlyWait(waitSeconds, TimeUnit.SECONDS);
929 }
930
931 @Override
932 public void fail(String message) {
933 SeleneseTestBase.fail(message);
934 jGrowlSticky(message);
935 }
936
937 protected void fireEvent(String name, String event) {
938 ((JavascriptExecutor) driver).executeScript("var elements=document.getElementsByName(\"" + name + "\");" +
939 "for (var i = 0; i < elements.length; i++){" +
940 "elements[i]." + event + "();}");
941 }
942
943 protected void fireEvent(String name, String value, String event) {
944 ((JavascriptExecutor) driver).executeScript("var elements=document.getElementsByName(\"" + name + "\");" +
945 "for (var i = 0; i < elements.length; i++){" +
946 "if(elements[i].value=='" + value + "')" +
947 "elements[i]." + event + "();}");
948 }
949
950
951
952
953
954 public void fireMouseOverEventByName(String name) {
955 this.fireMouseOverEvent(By.name(name));
956 }
957
958
959
960
961
962 public void fireMouseOverEventByXpath(String locator) {
963 this.fireMouseOverEvent(By.xpath(locator));
964 }
965
966
967
968
969
970 public void fireMouseOverEvent(By by) {
971 Actions builder = new Actions(driver);
972 Actions hover = builder.moveToElement(driver.findElement(by));
973 hover.perform();
974 }
975
976 protected boolean isElementPresent(By by) {
977 return (driver.findElements(by)).size() > 0;
978 }
979
980 protected boolean isElementPresent(String locator) {
981 return (driver.findElements(By.cssSelector(locator))).size() > 0;
982 }
983
984 protected boolean isElementPresentByName(String name) {
985 return isElementPresent(By.name(name));
986 }
987
988 protected boolean isElementPresentByXpath(String locator) {
989 return isElementPresent(By.xpath(locator));
990 }
991
992 protected boolean isElementPresentByLinkText(String locator) {
993 return isElementPresent(By.linkText(locator));
994 }
995
996 protected Boolean isTextPresent(String text) {
997 if (driver.getPageSource().contains(text)) {
998 return Boolean.TRUE;
999 }
1000
1001 return Boolean.FALSE;
1002 }
1003
1004 protected boolean isVisible(String locator) {
1005 return driver.findElement(By.cssSelector(locator)).isDisplayed();
1006 }
1007
1008 protected boolean isVisible(By by) {
1009 return driver.findElement(by).isDisplayed();
1010 }
1011
1012 protected boolean isVisibleByXpath(String locator) {
1013 return isVisible(By.xpath(locator));
1014 }
1015
1016 protected void jGrowl(String message) {
1017 try {
1018 String javascript="jQuery.jGrowl('" + message + "' , {sticky: false, header : '" + jGrowlHeader + "'});";
1019 ((JavascriptExecutor) driver).executeScript(javascript);
1020 } catch (Throwable t) {
1021 jGrowlException(t);
1022 }
1023 }
1024
1025
1026
1027
1028
1029 protected void jGrowlSticky(String message) {
1030 try {
1031 String javascript="jQuery.jGrowl('" + message + "' , {sticky: true, header : '" + jGrowlHeader + "'});";
1032 ((JavascriptExecutor) driver).executeScript(javascript);
1033 } catch (Throwable t) {
1034 jGrowlException(t);
1035 }
1036 }
1037
1038 private void jGrowlException(Throwable t) {
1039 System.out.println("jGrowl failure " + t.getMessage());
1040 if (JGROWL_ERROR_FAILURE) {
1041 fail(t.getMessage());
1042 }
1043 }
1044
1045 private void jiraAwareFail(By by, String message, Throwable t) {
1046 JiraAwareFailureUtil.failOnMatchedJira(by.toString(), message, this);
1047
1048 fail(t.getMessage() + " " + by.toString() + " " + message + " " + driver.getCurrentUrl());
1049 }
1050
1051 protected void jiraAwareWaitAndClick(By by, String message) throws InterruptedException {
1052 try {
1053 jiraAwareWaitFor(by, message);
1054 (driver.findElement(by)).click();
1055 } catch (Exception e) {
1056 jiraAwareFail(by, message, e);
1057 }
1058 }
1059
1060 protected void jiraAwareWaitAndClick(By by, String message, Failable failable) throws InterruptedException {
1061 try {
1062 jiraAwareWaitFor(by, message, failable);
1063 (driver.findElement(by)).click();
1064 } catch (Exception e) {
1065 jiraAwareFail(by, message, e);
1066 }
1067 }
1068
1069 protected void jiraAwareWaitFor(By by, String message) throws InterruptedException {
1070 try {
1071 WebDriverUtil.waitFor(this.driver, this.waitSeconds, by, message);
1072 } catch (Throwable t) {
1073 jiraAwareFail(by, message, t);
1074 }
1075 }
1076
1077 protected void jiraAwareWaitFor(By by, String message, Failable failable) throws InterruptedException {
1078 try {
1079 WebDriverUtil.waitFor(this.driver, this.waitSeconds, by, message);
1080 } catch (Throwable t) {
1081 jiraAwareFail(by, message, t);
1082 }
1083 }
1084
1085 protected void open(String url) {
1086 driver.get(url);
1087 }
1088
1089 protected void selectFrameIframePortlet() {
1090 selectFrame(IFRAMEPORTLET_NAME);
1091 }
1092
1093 protected void selectFrame(String locator) {
1094
1095 if (IFRAMEPORTLET_NAME.equals(locator)) {
1096 gotoNestedFrame();
1097 } else {
1098 WebDriverUtil.selectFrameSafe(driver, locator);
1099 }
1100 }
1101
1102 protected void selectTopFrame() {
1103 driver.switchTo().defaultContent();
1104 }
1105
1106 protected void selectWindow(String locator) {
1107 driver.switchTo().window(locator);
1108 }
1109
1110 protected void selectByXpath(String locator, String selectText) throws InterruptedException {
1111 select(By.xpath(locator), selectText);
1112 }
1113
1114 protected void selectByName(String name, String selectText) throws InterruptedException {
1115 select(By.name(name), selectText);
1116 }
1117
1118 protected void select(By by, String selectText) throws InterruptedException {
1119 WebElement select1 = driver.findElement(by);
1120 List<WebElement> options = select1.findElements(By.tagName("option"));
1121
1122 for (WebElement option : options) {
1123 if (option.getText().equals(selectText)) {
1124 option.click();
1125 break;
1126 }
1127 }
1128 }
1129
1130 protected void selectOptionByName(String name, String optionValue) throws InterruptedException {
1131 selectOption(By.name(name), optionValue);
1132 }
1133
1134 protected void selectOptionByXpath(String locator, String optionValue) throws InterruptedException {
1135 selectOption(By.name(locator), optionValue);
1136 }
1137
1138 protected void selectOption(By by, String optionValue) throws InterruptedException {
1139 WebElement select1 = driver.findElement(by);
1140 List<WebElement> options = select1.findElements(By.tagName("option"));
1141
1142 for (WebElement option : options) {
1143 if (option.getAttribute("value").equals(optionValue)) {
1144 option.click();
1145 break;
1146 }
1147 }
1148 }
1149
1150
1151
1152
1153
1154 public void switchToWindow(String title) {
1155 Set<String> windows = driver.getWindowHandles();
1156
1157 for (String window : windows) {
1158 driver.switchTo().window(window);
1159 if (driver.getTitle().contains(title)) {
1160 return;
1161 }
1162 }
1163 }
1164
1165
1166 protected void testAddingNamespace() throws Exception {
1167 testAddingNamespace(this);
1168 }
1169
1170
1171 protected void testAddingNamespace(Failable failable) throws Exception {
1172 selectFrameIframePortlet();
1173 waitAndCreateNew();
1174 waitForPageToLoad();
1175 assertElementPresentByXpath(SAVE_XPATH_2, "save button does not exist on the page");
1176
1177
1178 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding PEANUTS");
1179 waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM");
1180 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", "PEANUTS");
1181 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", "The Peanuts Gang");
1182 checkByXpath("//input[@id='document.newMaintainableObject.active']");
1183 waitAndClickByXpath(SAVE_XPATH_2);
1184 waitForPageToLoad();
1185 checkForIncidentReport();
1186 assertDocumentStatusSaved();
1187
1188
1189 SeleneseTestBase.assertEquals(DOC_STATUS_SAVED, driver.findElement(By.xpath(
1190 "//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
1191 SeleneseTestBase.assertEquals("admin", driver.findElement(By.xpath(
1192 "//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
1193 }
1194
1195 protected void assertDocumentStatusSaved() {
1196 assertElementPresentByXpath(SAVE_SUCCESSFUL_XPATH,
1197 "Document is not saved successfully");
1198 }
1199
1200 protected void testAddingBrownGroup() throws Exception {
1201 selectFrameIframePortlet();
1202 waitAndCreateNew();
1203 waitForPageToLoad();
1204 String docId = waitForDocId();
1205
1206
1207 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Brown Group");
1208 waitAndTypeByName("document.documentHeader.explanation", "I want to add Brown Group to test KIM");
1209 selectOptionByName("document.groupNamespace", "KR-IDM");
1210 waitForPageToLoad();
1211 String groupName = "BrownGroup " + ITUtil.DTS_TWO;
1212 waitAndTypeByName("document.groupName", groupName);
1213 checkByName("document.active");
1214 waitAndClickByXpath(SAVE_XPATH_2);
1215 waitForPageToLoad();
1216 assertElementPresentByXpath(SAVE_SUCCESSFUL_XPATH,"Document is not saved successfully");
1217 checkForIncidentReport();
1218
1219
1220 SeleneseTestBase.assertEquals(DOC_STATUS_SAVED, driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
1221 SeleneseTestBase.assertEquals("admin", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
1222 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
1223 waitForPageToLoad();
1224 waitAndClickSearch();
1225 waitForPageToLoad();
1226 waitAndClickReturnValue();
1227 waitForPageToLoad();
1228 waitAndClickByName("methodToCall.addMember.anchorAssignees");
1229 waitForPageToLoad();
1230 waitAndClickSave();
1231 waitAndClickSubmit();
1232 waitForPageToLoad();
1233 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH,"Document is not submitted successfully");
1234 selectTopFrame();
1235 waitAndClickByLinkText("Administration");
1236 waitForPageToLoad();
1237 waitAndClickByLinkText("Group");
1238 waitForPageToLoad();
1239 selectFrameIframePortlet();
1240 waitAndTypeByName("name", groupName);
1241 waitAndClickSearch();
1242 isElementPresentByLinkText(groupName);
1243 }
1244
1245 protected void testAgendaEditRuleRefreshIT() throws Exception {
1246 selectFrameIframePortlet();
1247 waitAndClickByXpath("//div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button[1]"); // jiraAwareWaitAndClick("id=32");
1248 Thread.sleep(3000);
1249 waitAndClickByXpath("//a[@title='edit Agenda Definition with Agenda Id=T1000']",
1250 "Does user have edit permissions?");
1251 checkForIncidentReport("");
1252 Thread.sleep(3000);
1253 waitAndClickByXpath("//li/a[@class='agendaNode ruleNode']"); // jiraAwareWaitAndClick("//li[@id='473_node_0_parent_root']/a");
1254 waitAndClickByXpath("//li/a[@class='agendaNode logicNode whenTrueNode']");
1255 waitAndClickByLinkText("[-] collapse all");
1256
1257
1258 for (int i = 0; i < 6; i++) {
1259 for (int second = 0;; second++) {
1260 if (second >= waitSeconds)
1261 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
1262 try {
1263 if (isElementPresent(".kr-refresh-button"))
1264 break;
1265 } catch (Exception e) {}
1266 Thread.sleep(1000);
1267 }
1268 waitAndClick("button.kr-refresh-button");
1269 }
1270 }
1271
1272 protected void testAttributeDefinitionLookUp() throws Exception {
1273 waitForPageToLoad();
1274 selectFrameIframePortlet();
1275 waitAndClickByXpath("//button[contains(.,'earch')]");
1276 Thread.sleep(3000);
1277 waitForPageToLoad();
1278 driver.findElement(By.tagName("body")).getText().contains("Actions");
1279 waitAndClickByLinkText("1000");
1280 waitForPageToLoad();
1281 driver.findElement(By.tagName("body")).getText().contains("Attribute Inquiry");
1282 driver.findElement(By.tagName("body")).getText().contains("KRMS Attributes");
1283 driver.findElement(By.tagName("body")).getText().contains("Attribute Label");
1284 driver.findElement(By.tagName("body")).getText().contains("1000");
1285 driver.findElement(By.tagName("body")).getText().contains("peopleFlowId");
1286 driver.findElement(By.tagName("body")).getText().contains("KR-RULE");
1287 driver.findElement(By.tagName("body")).getText().contains("PeopleFlow");
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301 passed();
1302 }
1303
1304 protected void testCancelConfirmation() throws InterruptedException {
1305 waitAndCancelConfirmation();
1306 passed();
1307 }
1308
1309 protected void testConfigParamaterBlanketApprove() throws Exception {
1310 selectFrameIframePortlet();
1311 waitAndCreateNew();
1312 String docId = waitForDocId();
1313 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Parameter ");
1314 assertBlanketApproveButtonsPresent();
1315 SeleneseTestBase.assertEquals("", getTextByName(CANCEL_NAME));
1316 selectByXpath("//select[@id='document.newMaintainableObject.namespaceCode']", "KR-NS - Kuali Nervous System");
1317 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,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1318 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1319 waitAndClickByXpath(componentLookUp);
1320 waitAndClickSearch();
1321 waitAndClickReturnValue();
1322 String parameterName = "ValidationTestParameter" + ITUtil.DTS;
1323 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", parameterName);
1324 waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.description']",
1325 "Validation Test Parameter Description" + ITUtil.DTS);
1326 selectByXpath("//select[@id='document.newMaintainableObject.parameterTypeCode']", "Document Validation");
1327 waitAndClickByXpath("//input[@id='document.newMaintainableObject.evaluationOperatorCodeAllowed']");
1328 waitForPageToLoad();
1329 blanketApproveTest();
1330 assertDocFinal(docId);
1331 }
1332
1333 protected void testCreateNewAgenda() throws Exception {
1334 selectFrameIframePortlet();
1335 selectByName("document.newMaintainableObject.dataObject.namespace", "Kuali Rules Test");
1336 String agendaName = "Agenda Date :" + Calendar.getInstance().getTime().toString();
1337 waitAndTypeByName("document.newMaintainableObject.dataObject.agenda.name", "Agenda " + agendaName);
1338 waitAndTypeByName("document.newMaintainableObject.dataObject.contextName", "Context1");
1339 fireEvent("document.newMaintainableObject.dataObject.contextName", "blur");
1340 fireEvent("document.newMaintainableObject.dataObject.contextName", "focus");
1341 waitForElementPresentByName("document.newMaintainableObject.dataObject.agenda.typeId");
1342 selectByName("document.newMaintainableObject.dataObject.agenda.typeId", "Campus Agenda");
1343 waitForElementPresentByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]");
1344 waitAndTypeByName("document.newMaintainableObject.dataObject.customAttributesMap[Campus]", "BL");
1345 waitAndClickByXpath("//div[2]/button");
1346 waitForPageToLoad();
1347 waitAndClickByXpath("//div[2]/button[3]");
1348 waitForPageToLoad();
1349 selectTopFrame();
1350 waitAndClickByXpath("(//input[@name='imageField'])[2]");
1351 passed();
1352 }
1353
1354 protected void testCreateDocType() throws Exception {
1355 selectFrameIframePortlet();
1356 waitAndCreateNew();
1357 assertElementPresentByXpath("//*[@name='methodToCall.route' and @alt='submit']","save button does not exist on the page");
1358
1359
1360
1361 String docId = waitForDocId();
1362 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Creating new Document Type");
1363 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,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1364 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1365 waitAndClickByXpath(parentDocType);
1366 waitForPageToLoad();
1367 Thread.sleep(2000);
1368 waitAndClickSearch();
1369 waitForPageToLoad();
1370 waitAndClickReturnValue();
1371 String docTypeName = "TestDocType" + ITUtil.DTS;
1372 waitForElementPresentByXpath("//input[@id='document.newMaintainableObject.name']");
1373 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", docTypeName);
1374 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedDocHandlerUrl']","${kr.url}/maintenance.do?methodToCall=docHandler");
1375
1376
1377 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.label']", "TestDocument Label");
1378 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedHelpDefinitionUrl']","default.htm?turl=WordDocuments%2Fdocumenttype.htm");
1379 waitAndClickByXpath("//*[@name='methodToCall.route' and @alt='submit']");
1380 checkForIncidentReport();
1381 waitForPageToLoad();
1382 driver.switchTo().defaultContent();
1383 waitAndClickDocSearchTitle();
1384 waitForPageToLoad();
1385 selectFrameIframePortlet();
1386 waitAndClickSearch();
1387 Thread.sleep(2000);
1388 SeleneseTestBase.assertEquals(docId, driver.findElement(By.xpath(DOC_ID_XPATH_2)).getText());
1389 }
1390
1391 protected void testCreateNewCancel() throws Exception {
1392 selectFrameIframePortlet();
1393 waitAndCreateNew();
1394 testCancelConfirmation();
1395 }
1396
1397 protected List<String> testCreateNewParameter(String docId, String parameterName) throws Exception {
1398 waitForPageToLoad();
1399 docId = waitForDocId();
1400
1401 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Test Parameter");
1402 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-WKFLW");
1403 waitAndTypeByName("document.newMaintainableObject.componentCode", "ActionList");
1404 waitAndTypeByName("document.newMaintainableObject.applicationId", "KUALI");
1405 parameterName = "TestIndicator" + ITUtil.DTS_TWO;
1406 waitAndTypeByName("document.newMaintainableObject.name", parameterName);
1407 waitAndTypeByName("document.newMaintainableObject.value", "Y");
1408 waitAndTypeByName("document.newMaintainableObject.description", "for testing");
1409 selectOptionByName("document.newMaintainableObject.parameterTypeCode", "HELP");
1410 waitAndClickByXpath("//input[@name='document.newMaintainableObject.evaluationOperatorCode' and @value='A']");
1411 waitAndClickSave();
1412 waitAndClickSubmit();
1413 waitForPageToLoad();
1414 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH,"Document is not submitted successfully");
1415 selectTopFrame();
1416 waitAndClickDocSearchTitle();
1417 waitForPageToLoad();
1418 selectFrameIframePortlet();
1419 waitAndClickSearch();
1420 Thread.sleep(2000);
1421 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
1422 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
1423 selectTopFrame();
1424 List<String> params = new ArrayList<String>();
1425 params.add(docId);
1426 params.add(parameterName);
1427
1428 return params;
1429 }
1430
1431 protected List<String> testCreateNewParameterType(String docId, String parameterType, String parameterCode)throws Exception {
1432 waitForPageToLoad();
1433 docId = waitForDocId();
1434
1435
1436 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Test Parameter Type");
1437 parameterCode = RandomStringUtils.randomAlphabetic(4).toLowerCase();
1438 waitAndTypeByName("document.newMaintainableObject.code", parameterCode);
1439 parameterType = "testing " + ITUtil.DTS_TWO;
1440 waitAndTypeByName("document.newMaintainableObject.name", parameterType);
1441 waitAndClickSave();
1442 waitAndClickSubmit();
1443 waitForPageToLoad();
1444 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1445 selectTopFrame();
1446 waitAndClickDocSearchTitle();
1447 waitForPageToLoad();
1448 selectFrameIframePortlet();
1449 waitAndClickSearch();
1450 Thread.sleep(2000);
1451 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
1452 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
1453 selectTopFrame();
1454 List<String> params = new ArrayList<String>();
1455 params.add(docId);
1456 params.add(parameterType);
1457 params.add(parameterCode);
1458
1459 return params;
1460 }
1461
1462 protected void testCreateNewSearchReturnValueCancelConfirmation() throws InterruptedException, Exception {
1463 selectFrameIframePortlet();
1464 waitAndCreateNew();
1465 waitAndClickSearch2();
1466 waitAndClickReturnValue();
1467 waitAndCancelConfirmation();
1468 passed();
1469 }
1470
1471 protected List<String> testCopyParameter(String docId, String parameterName) throws Exception {
1472 selectFrameIframePortlet();
1473 waitAndClickCopy();
1474 waitForPageToLoad();
1475 docId = waitForDocId();
1476 waitAndTypeByName("document.documentHeader.documentDescription", "Copying Test Parameter");
1477 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-WKFLW");
1478 waitAndTypeByName("document.newMaintainableObject.componentCode", "ActionList");
1479 waitAndTypeByName("document.newMaintainableObject.applicationId", "KUALI");
1480 parameterName = "TestIndicator" + ITUtil.DTS_TWO;
1481 waitAndTypeByName("document.newMaintainableObject.name", parameterName);
1482 waitAndClickSave();
1483 waitAndClickSubmit();
1484 waitForPageToLoad();
1485 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH,"Document is not submitted successfully");
1486 selectTopFrame();
1487 waitAndClickDocSearchTitle();
1488 waitForPageToLoad();
1489 selectFrameIframePortlet();
1490 waitAndClickSearch();
1491 Thread.sleep(2000);
1492 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
1493 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
1494 selectTopFrame();
1495 List<String> params = new ArrayList<String>();
1496 params.add(docId);
1497 params.add(parameterName);
1498
1499 return params;
1500 }
1501
1502 protected List<String> testCopyParameterType(String docId, String parameterType, String parameterCode) throws Exception {
1503 selectFrameIframePortlet();
1504 waitAndClickCopy();
1505 waitForPageToLoad();
1506 docId = waitForDocId();
1507 waitAndTypeByName("document.documentHeader.documentDescription", "Copying Test Parameter");
1508 parameterCode = RandomStringUtils.randomAlphabetic(4).toLowerCase();
1509 waitAndTypeByName("document.newMaintainableObject.code", parameterCode);
1510 clearTextByName("document.newMaintainableObject.name");
1511 parameterType = "testing " + ITUtil.DTS_TWO;
1512 waitAndTypeByName("document.newMaintainableObject.name", parameterType);
1513 waitAndClickSave();
1514 waitAndClickSubmit();
1515 waitForPageToLoad();
1516 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1517 selectTopFrame();
1518 waitAndClickDocSearchTitle();
1519 waitForPageToLoad();
1520 selectFrameIframePortlet();
1521 waitAndClickSearch();
1522 Thread.sleep(2000);
1523 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
1524 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
1525 selectTopFrame();
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
1535 protected void testDocTypeLookup() throws Exception {
1536 selectFrameIframePortlet();
1537 waitAndClickByXpath("//input[@title='Search Parent Name']");
1538 waitForPageToLoad();
1539 waitAndClickByXpath(SAVE_XPATH_3);
1540 waitAndClickByXpath("//table[@id='row']/tbody/tr[contains(td[3],'RiceDocument')]/td[1]/a");
1541 waitForPageToLoad();
1542 waitAndClickByXpath(SAVE_XPATH_3);
1543 SeleneseTestBase.assertEquals("RiceDocument", getTextByXpath("//table[@id='row']/tbody/tr/td[4]/a"));
1544 waitAndClickByName("methodToCall.clearValues");
1545 waitAndTypeByName("name", "Kuali*D");
1546 waitAndClickByXpath(SAVE_XPATH_3);
1547 assertElementPresentByXpath("//table[@id='row']/tbody/tr[contains(td[3], 'KualiDocument')]");
1548 String docIdOld = getTextByXpath("//table[@id='row']/tbody/tr[contains(td[3], 'KualiDocument')]/td[2]/a");
1549 waitAndClickByName("methodToCall.clearValues");
1550 waitAndTypeByName("label", "KualiDocument");
1551 waitAndClickByXpath(SAVE_XPATH_3);
1552 assertElementPresentByXpath("//table[@id='row']/tbody/tr[contains(td[5], 'KualiDocument')]");
1553 waitAndClickByName("methodToCall.clearValues");
1554 waitAndTypeByName("documentTypeId", docIdOld);
1555 waitAndClickByXpath(SAVE_XPATH_3);
1556 assertElementPresentByXpath("//table[@id='row']/tbody/tr[contains(td[2], '" + docIdOld + "')]");
1557 }
1558
1559
1560 protected List<String> testEditParameterType(String docId, String parameterType, String parameterCode) throws Exception {
1561 selectFrameIframePortlet();
1562 waitAndClickEdit();
1563 waitForPageToLoad();
1564 docId = waitForDocId();
1565 waitAndTypeByName("document.documentHeader.documentDescription", "Editing Test Parameter");
1566 clearTextByName("document.newMaintainableObject.name");
1567 parameterType = "testing " + ITUtil.DTS_TWO;
1568 waitAndTypeByName("document.newMaintainableObject.name", parameterType);
1569 waitAndClickSave();
1570 waitAndClickSubmit();
1571 waitForPageToLoad();
1572 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1573 selectTopFrame();
1574 waitAndClickDocSearchTitle();
1575 waitForPageToLoad();
1576 selectFrameIframePortlet();
1577 waitAndClickSearch();
1578 Thread.sleep(2000);
1579 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
1580 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
1581 selectTopFrame();
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> testEditParameter(String docId, String parameterName) throws Exception
1591 {
1592 selectFrameIframePortlet();
1593 waitAndClickEdit();
1594 waitForPageToLoad();
1595 docId = waitForDocId();
1596 waitAndTypeByName("document.documentHeader.documentDescription", "Editing Test Parameter");
1597 clearTextByName("document.newMaintainableObject.value");
1598 waitAndTypeByName("document.newMaintainableObject.value", "N");
1599 waitAndClickSave();
1600 waitAndClickSubmit();
1601 waitForPageToLoad();
1602 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
1603 selectTopFrame();
1604 waitAndClickDocSearchTitle();
1605 waitForPageToLoad();
1606 selectFrameIframePortlet();
1607 waitAndClickSearch();
1608 Thread.sleep(2000);
1609 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
1610 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
1611 selectTopFrame();
1612 List<String> params = new ArrayList<String>();
1613 params.add(docId);
1614 params.add(parameterName);
1615 return params;
1616 }
1617
1618 protected void testEditRouteRulesDelegation() throws Exception {
1619 waitForPageToLoad();
1620 Thread.sleep(3000);
1621 SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
1622 selectFrameIframePortlet();
1623 waitAndClickSearch();
1624 waitForPageToLoad();
1625 Thread.sleep(3000);
1626 waitAndClickEdit();
1627 waitForPageToLoad();
1628 Thread.sleep(3000);
1629 SeleneseTestBase.assertTrue(isElementPresentByName(CANCEL_NAME));
1630 waitAndClickCancel();
1631 waitForPageToLoad();
1632 Thread.sleep(3000);
1633 waitAndClickByName("methodToCall.processAnswer.button0");
1634 waitForPageToLoad();
1635 passed();
1636 }
1637
1638 protected void testFiscalOfficerInfoMaintenanceNew() throws Exception {
1639 selectFrameIframePortlet();
1640 checkForIncidentReport("", "https://jira.kuali.org/browse/KULRICE-7723 FiscalOfficerInfoMaintenanceNewIT.testUntitled need a better name and user permission error");
1641 String docId = getTextByXpath("//*[@id='u13_control']");
1642 waitAndTypeByXpath("//input[@name='document.documentHeader.documentDescription']", "New FO Doc");
1643 waitAndTypeByXpath("//input[@name='document.newMaintainableObject.dataObject.id']", "5");
1644 waitAndTypeByXpath("//input[@name='document.newMaintainableObject.dataObject.userName']", "Jigar");
1645 waitAndClickByXpath("//button[@id='usave']");
1646 Integer docIdInt = Integer.valueOf(docId).intValue();
1647 selectTopFrame();
1648 waitAndClickByXpath("//img[@alt='action list']");
1649 selectFrameIframePortlet();
1650
1651 if(isElementPresentByLinkText("Last")){
1652 waitAndClickByLinkText("Last");
1653 waitAndClickByLinkText(docIdInt.toString());
1654 } else {
1655 waitAndClickByLinkText(docIdInt.toString());
1656 }
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691 }
1692
1693 protected void testIdentityGroupBlanketApprove() throws Exception {
1694 selectFrameIframePortlet();
1695 waitAndCreateNew();
1696 String docId = waitForDocId();
1697 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Group " + ITUtil.DTS_TWO);
1698 assertBlanketApproveButtonsPresent();
1699 selectByXpath("//select[@id='document.groupNamespace']", AdminTmplMthdSTNavBase.LABEL_KUALI_KUALI_SYSTEMS);
1700 waitAndTypeByXpath("//input[@id='document.groupName']", "Validation Test Group1 " + ITUtil.DTS_TWO);
1701 waitAndClickByName(
1702 "methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
1703 waitAndClickSearch();
1704 waitAndClickReturnValue();
1705 waitAndClickByName("methodToCall.addMember.anchorAssignees");
1706 waitForPageToLoad();
1707 blanketApproveTest();
1708 assertDocFinal(docId);
1709 }
1710
1711 protected void testIdentityPermissionBlanketApprove() throws Exception {
1712 selectFrameIframePortlet();
1713 waitAndCreateNew();
1714 String docId = waitForDocId();
1715 waitAndTypeByXpath("//input[@name='document.documentHeader.documentDescription']",
1716 "Validation Test Permission " + ITUtil.DTS_TWO);
1717 assertBlanketApproveButtonsPresent();
1718 waitAndTypeByXpath("//input[@name='document.documentHeader.organizationDocumentNumber']", "10012");
1719 selectByXpath("//select[@name='document.newMaintainableObject.namespaceCode']",
1720 AdminTmplMthdSTNavBase.LABEL_KUALI_KUALI_SYSTEMS);
1721 selectByXpath("//select[@name='document.newMaintainableObject.templateId']",
1722 AdminTmplMthdSTNavBase.LABEL_KUALI_DEFAULT);
1723 waitAndTypeByXpath("//input[@name='document.newMaintainableObject.name']",
1724 "ValidationTestPermission" + ITUtil.DTS_TWO);
1725 blanketApproveTest();
1726 assertDocFinal(docId);
1727 }
1728
1729 protected void testIdentityPersonBlanketApprove() throws Exception {
1730 selectFrameIframePortlet();
1731 waitAndCreateNew();
1732 String docId = waitForDocId();
1733 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Person");
1734 assertBlanketApproveButtonsPresent();
1735 waitAndTypeByXpath("//input[@id='document.principalName']", "principal" + RandomStringUtils.randomAlphabetic(3).toLowerCase());
1736 selectByName("newAffln.affiliationTypeCode", "Affiliate");
1737 selectByName("newAffln.campusCode", "BX - BLGTN OFF CAMPUS");
1738 selectByName("newAffln.campusCode", "BL - BLOOMINGTON");
1739 assertElementPresentByName("newAffln.dflt");
1740 waitAndClickByName("newAffln.dflt");
1741 waitAndClickByName("methodToCall.addAffln.anchor");
1742 waitAndClickByName("methodToCall.toggleTab.tabContact");
1743 selectByName("newName.namePrefix", "Mr");
1744 waitAndTypeByName("newName.firstName", "First");
1745 waitAndTypeByName("newName.lastName", "Last");
1746 selectByName("newName.nameSuffix", "Mr");
1747 waitAndClickByName("newName.dflt");
1748 waitAndClickByName("methodToCall.addName.anchor");
1749 waitForPageToLoad();
1750 blanketApproveTest();
1751 assertDocFinal(docId);
1752 }
1753
1754 protected void testIdentityResponsibilityBlanketApprove() throws Exception {
1755 selectFrameIframePortlet();
1756 waitAndCreateNew();
1757 String docId = waitForDocId();
1758 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Responsibility " + ITUtil.DTS_TWO);
1759 assertBlanketApproveButtonsPresent();
1760 selectByXpath("//select[@id='document.newMaintainableObject.namespaceCode']",
1761 AdminTmplMthdSTNavBase.LABEL_KUALI_KUALI_SYSTEMS);
1762 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']",
1763 "Validation Test Responsibility " + ITUtil.DTS_TWO);
1764 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.documentTypeName']", "Test " + ITUtil.DTS_TWO);
1765 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.routeNodeName']", "Test " + ITUtil.DTS_TWO);
1766 waitAndClickByXpath("//input[@id='document.newMaintainableObject.actionDetailsAtRoleMemberLevel']");
1767 waitAndClickByXpath("//input[@id='document.newMaintainableObject.required']");
1768 blanketApproveTest();
1769 assertDocFinal(docId);
1770 }
1771
1772 protected void testIdentityRoleBlanketApprove() throws Exception {
1773 selectFrameIframePortlet();
1774 waitAndCreateNew();
1775 waitAndClickByXpath(SEARCH_XPATH, "No search button to click.");
1776 waitAndClickByLinkText(RETURN_VALUE_LINK_TEXT, "No return value link");
1777 String docId = waitForDocId();
1778 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Role " + ITUtil.DTS_TWO);
1779 assertBlanketApproveButtonsPresent();
1780 selectByXpath("//select[@id='document.roleNamespace']", AdminTmplMthdSTNavBase.LABEL_KUALI_KUALI_SYSTEMS);
1781 waitAndTypeByXpath("//input[@id='document.roleName']", "Validation Test Role " + ITUtil.DTS_TWO,
1782 "No Role Name input to type in.");
1783 waitAndClickByName(
1784 "methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalId:member.memberId,principalName:member.memberName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchorAssignees");
1785 waitAndClickByXpath(SEARCH_XPATH, "No search button to click.");
1786 waitAndClickByLinkText(RETURN_VALUE_LINK_TEXT, "No return value link");
1787 waitAndClickByName("methodToCall.addMember.anchorAssignees");
1788 waitForPageToLoad();
1789 blanketApproveTest();
1790 assertDocFinal(docId);
1791 }
1792
1793 protected void testLocationCampusBlanketApprove() throws Exception {
1794 selectFrameIframePortlet();
1795 waitAndCreateNew();
1796 String docId = waitForDocId();
1797 waitAndTypeByName("document.documentHeader.documentDescription", "Validation Test Campus");
1798 assertBlanketApproveButtonsPresent();
1799 waitAndTypeByName("document.newMaintainableObject.code", RandomStringUtils.randomAlphabetic(2));
1800 waitAndTypeByName("document.newMaintainableObject.name", "Validation Test Campus" + ITUtil.DTS);
1801 waitAndTypeByName("document.newMaintainableObject.shortName", "VTC");
1802 selectByName("document.newMaintainableObject.campusTypeCode", "B - BOTH");
1803 blanketApproveTest();
1804 assertDocFinal(docId);
1805 }
1806
1807 protected void testLocationCountryBlanketApprove() throws InterruptedException {
1808 selectFrameIframePortlet();
1809 waitAndCreateNew();
1810 String docId = waitForDocId();
1811 assertBlanketApproveButtonsPresent();
1812 String twoUpperCaseLetters = RandomStringUtils.randomAlphabetic(2).toUpperCase();
1813 String countryName = "Validation Test Country " + ITUtil.DTS + " " + twoUpperCaseLetters;
1814 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, countryName);
1815 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", twoUpperCaseLetters);
1816 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", countryName);
1817 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.alternateCode']", "V" + twoUpperCaseLetters);
1818 blanketApproveTest();
1819 assertDocFinal(docId);
1820 }
1821
1822 protected void testLocationCountyBlanketApprove() throws Exception {
1823 selectFrameIframePortlet();
1824 waitAndCreateNew();
1825 String docId = waitForDocId();
1826 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test County");
1827 assertBlanketApproveButtonsPresent();
1828 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1829 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1830 waitAndClickByXpath(countryLookUp);
1831 waitAndTypeByName("code", "US");
1832 waitAndClickSearch();
1833 waitAndClickReturnValue();
1834 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", RandomStringUtils.randomAlphabetic(2).toUpperCase());
1835 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,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1836 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1837 waitAndClickByXpath(stateLookUp);
1838 waitAndTypeByName("code", "IN");
1839 waitAndClickSearch();
1840 waitAndClickReturnValue();
1841 String countyName = "Validation Test County" + ITUtil.DTS;
1842 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", countyName);
1843 waitAndClickByXpath("//input[@id='document.newMaintainableObject.active']");
1844 blanketApproveTest();
1845 assertDocFinal(docId);
1846 }
1847
1848 protected void testLocationPostBlanketApprove() throws Exception {
1849 selectFrameIframePortlet();
1850 waitAndCreateNew();
1851 String docId = waitForDocId();
1852 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Postal Code");
1853 assertBlanketApproveButtonsPresent();
1854 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1855 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1856 waitAndClickByXpath(countryLookUp);
1857 waitAndTypeByName("code", "US");
1858 waitAndClickSearch();
1859 waitAndClickReturnValue();
1860 String code = RandomStringUtils.randomNumeric(5);
1861 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", code);
1862 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,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1863 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1864 waitAndClickByXpath(stateLookUp);
1865 waitAndClickSearch();
1866 waitAndClickByXpath("//table[@id='row']/tbody/tr[4]/td[1]/a");
1867 String cityName = "Validation Test Postal Code " + code;
1868 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.cityName']", cityName);
1869 blanketApproveTest();
1870 assertDocFinal(docId);
1871 }
1872
1873 protected void testLocationStateBlanketApprove() throws Exception {
1874 selectFrameIframePortlet();
1875 waitAndCreateNew();
1876 String docId = waitForDocId();
1877 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test State");
1878 assertBlanketApproveButtonsPresent();
1879
1880
1881 String countryLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.location.impl.country.CountryBo!!).(((code:document.newMaintainableObject.countryCode,))).((`document.newMaintainableObject.countryCode:code,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
1882 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
1883 waitAndClickByXpath(countryLookUp);
1884 waitAndClickSearch();
1885 waitAndClickReturnValue();
1886 String code = RandomStringUtils.randomAlphabetic(2).toUpperCase();
1887 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", code);
1888 String state = "Validation Test State " + code;
1889 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", state);
1890 waitAndClickByXpath("//input[@id='document.newMaintainableObject.active']");
1891 blanketApproveTest();
1892 assertDocFinal(docId);
1893 }
1894
1895 protected void testLookUp() throws Exception {
1896 waitForPageToLoad();
1897 selectFrameIframePortlet();
1898
1899
1900 waitAndClick(By.xpath(SEARCH_XPATH_3));
1901 waitAndClickByLinkText(EDIT_LINK_TEXT, "edit button not present does user " + user + " have permission?");
1902 checkForIncidentReport("submit");
1903 assertTextPresent("ubmit");
1904 assertTextPresent("ave");
1905 assertTextPresent("pprove");
1906 assertTextPresent("lose");
1907 assertTextPresent("ancel");
1908 }
1909
1910 protected void performParameterInquiry(String parameterField) throws Exception {
1911 waitAndTypeByName("name", parameterField);
1912 waitAndClickSearch();
1913 isElementPresentByLinkText(parameterField);
1914 waitAndClickByLinkText(parameterField);
1915 waitForPageToLoad();
1916 Thread.sleep(2000);
1917 switchToWindow("Kuali :: Inquiry");
1918 Thread.sleep(2000);
1919 }
1920
1921 protected List<String> testLookUpParameterType(String docId, String parameterType, String parameterCode) throws Exception {
1922 performParameterInquiry(parameterType);
1923 SeleneseTestBase.assertEquals(parameterCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim().toLowerCase());
1924 SeleneseTestBase.assertEquals(parameterType, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim().toLowerCase());
1925 waitAndClickCloseWindow();
1926 switchToWindow("null");
1927 List<String> params = new ArrayList<String>();
1928 params.add(docId);
1929 params.add(parameterType);
1930 params.add(parameterCode);
1931
1932 return params;
1933 }
1934
1935 protected List<String> testLookUpParameter(String docId, String parameterName) throws Exception {
1936 performParameterInquiry(parameterName);
1937 SeleneseTestBase.assertEquals(parameterName, getTextByXpath(
1938 "//div[@class='tab-container']/table//span[@id='name.div']").trim());
1939 SeleneseTestBase.assertEquals("Y", getTextByXpath("//div[@class='tab-container']/table//span[@id='value.div']")
1940 .trim());
1941 waitAndClickCloseWindow();
1942 switchToWindow("null");
1943 List<String> params = new ArrayList<String>();
1944 params.add(docId);
1945 params.add(parameterName);
1946
1947 return params;
1948 }
1949
1950 protected void testPeopleFlow() throws Exception {
1951 selectFrameIframePortlet();
1952
1953
1954
1955
1956 jGrowl("Create New");
1957 waitAndClickByLinkText("Create New");
1958
1959
1960
1961 waitForElementPresent("div[data-header_for='PeopleFlow-MaintenanceView'] div[data-label='Document Number'] > span");
1962 String docId = getText("div[data-header_for='PeopleFlow-MaintenanceView'] div[data-label='Document Number'] > span");
1963 jGrowlSticky("Doc Id is " + docId);
1964 driver.findElement(By.name("document.documentHeader.documentDescription")).clear();
1965 driver.findElement(By.name("document.documentHeader.documentDescription")).sendKeys("Description for Document");
1966 new Select(driver.findElement(By.name("document.newMaintainableObject.dataObject.namespaceCode"))).selectByVisibleText("KUALI - Kuali Systems");
1967 driver.findElement(By.name("document.newMaintainableObject.dataObject.name")).clear();
1968 driver.findElement(By.name("document.newMaintainableObject.dataObject.name")).sendKeys("Document Name" + ITUtil.DTS);
1969
1970 jGrowl("Add Member kr");
1971 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).clear();
1972 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).sendKeys("kr");
1973 driver.findElement(By.cssSelector("button[data-loadingmessage='Adding Line...']")).click();
1974 Thread.sleep(3000);
1975
1976 jGrowl("Add Member admin");
1977 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).clear();
1978 driver.findElement(By.name("newCollectionLines['document.newMaintainableObject.dataObject.members'].memberName")).sendKeys("admin");
1979 driver.findElement(By.cssSelector("button[data-loadingmessage='Adding Line...']")).click();
1980 Thread.sleep(3000);
1981
1982 driver.findElement(By.cssSelector("div[data-parent='PeopleFlow-MaintenanceView'] > div.uif-footer button~button~button")).click();
1983 jGrowl("Blanket Approve");
1984 Thread.sleep(5000);
1985
1986
1987
1988
1989 driver.switchTo().window(driver.getWindowHandles().toArray()[0].toString());
1990 driver.findElement(By.cssSelector("img[alt=\"doc search\"]")).click();
1991 Thread.sleep(5000);
1992 jGrowl("Document Search is " + docId + " present?");
1993 selectFrameIframePortlet();
1994 driver.findElement(By.cssSelector("td.infoline > input[name=\"methodToCall.search\"]")).click();
1995 Thread.sleep(5000);
1996 jGrowl("Is doc status final?");
1997 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, driver.findElement(By.xpath("//table[@id='row']/tbody/tr/td[4]")).getText());
1998 driver.switchTo().defaultContent();
1999 driver.findElement(By.name("imageField")).click();
2000 Thread.sleep(5000);
2001
2002 }
2003
2004 protected void testTermLookupAssertions() throws Exception {
2005 testLookUp();
2006 assertTextPresent("Term Parameters");
2007 waitAndClick(By.xpath(CANCEL2_XPATH));
2008 passed();
2009 }
2010
2011 protected void testTermSpecificationLookupAssertions() throws Exception {
2012 testLookUp();
2013 assertTextPresent("Context");
2014 waitAndClick(By.xpath(CANCEL2_XPATH));
2015 passed();
2016 }
2017
2018 protected List<String> testVerifyModifiedParameter(String docId, String parameterName) throws Exception {
2019 performParameterInquiry(parameterName);
2020 SeleneseTestBase.assertEquals(parameterName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
2021 SeleneseTestBase.assertEquals("N", getTextByXpath("//div[@class='tab-container']/table//span[@id='value.div']").trim());
2022 waitAndClickCloseWindow();
2023 switchToWindow("null");
2024 List<String> params = new ArrayList<String>();
2025 params.add(docId);
2026 params.add(parameterName);
2027
2028 return params;
2029 }
2030
2031 protected List<String> testVerifyCopyParameterType(String docId, String parameterType, String parameterCode) throws Exception
2032 {
2033 performParameterInquiry(parameterType);
2034 SeleneseTestBase.assertEquals(parameterType, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim().toLowerCase());
2035 waitAndClickCloseWindow();
2036 switchToWindow("null");
2037 List<String> params = new ArrayList<String>();
2038 params.add(docId);
2039 params.add(parameterType);
2040 params.add(parameterCode);
2041
2042 return params;
2043 }
2044
2045 protected List<String> testCreateNewPermission(String docId, String permissionName) throws Exception
2046 {
2047 waitForPageToLoad();
2048 Thread.sleep(2000);
2049 docId = waitForDocId();
2050 waitAndClickSave();
2051 waitForPageToLoad();
2052 assertElementPresentByXpath("//div[contains(.,'Document Description (Description) is a required field.')]/img[@alt='error']");
2053 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding Permission removeme");
2054 waitAndClickSubmit();
2055 waitForPageToLoad();
2056 assertElementPresentByXpath("//div[@class='error']");
2057 assertElementPresentByXpath("//div[contains(.,'Template (Template) is a required field.')]/img[@alt='error']");
2058 assertElementPresentByXpath("//div[contains(.,'Permission Namespace (Permission Namespace) is a required field.')]/img[@alt='error']");
2059 assertElementPresentByXpath("//div[contains(.,'Permission Name (Permission Name) is a required field.')]/img[@alt='error']");
2060 selectOptionByName("document.newMaintainableObject.templateId", "36");
2061 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-SYS");
2062 permissionName = "removeme" + ITUtil.DTS_TWO;
2063 waitAndTypeByName("document.newMaintainableObject.name", permissionName);
2064 waitAndTypeByName("document.newMaintainableObject.description", "namespaceCode=KR*");
2065 checkByName("document.newMaintainableObject.active");
2066 waitAndClickSave();
2067 waitForPageToLoad();
2068 assertElementPresentByXpath(SAVE_SUCCESSFUL_XPATH);
2069 SeleneseTestBase.assertEquals(DOC_STATUS_SAVED, getTextByXpath(DOC_STATUS_XPATH));
2070 waitAndClickSubmit();
2071 waitForPageToLoad();
2072 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH,"Document is not submitted successfully");
2073 SeleneseTestBase.assertEquals(DOC_STATUS_ENROUTE, getTextByXpath(DOC_STATUS_XPATH));
2074 List<String> params = new ArrayList<String>();
2075 params.add(docId);
2076 params.add(permissionName);
2077
2078 return params;
2079 }
2080
2081 protected List<String> testLookUpPermission(String docId, String permissionName) throws Exception
2082 {
2083 waitForPageToLoad();
2084 waitAndTypeByName("name", permissionName);
2085 waitAndClickSearch();
2086 isElementPresentByLinkText(permissionName);
2087 List<String> params = new ArrayList<String>();
2088 params.add(docId);
2089 params.add(permissionName);
2090
2091 return params;
2092 }
2093
2094 protected List<String> testEditPermission(String docId, String permissionName) throws Exception
2095 {
2096 waitAndClickEdit();
2097 waitForPageToLoad();
2098 Thread.sleep(2000);
2099 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Editing Permission removeme");
2100 uncheckByName("document.newMaintainableObject.active");
2101 waitAndClickSubmit();
2102 waitForPageToLoad();
2103 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
2104 List<String> params = new ArrayList<String>();
2105 params.add(docId);
2106 params.add(permissionName);
2107
2108 return params;
2109 }
2110
2111 protected List<String> testVerifyPermission(String docId, String permissionName) throws Exception
2112 {
2113 waitForPageToLoad();
2114 waitAndTypeByName("name", permissionName);
2115 waitAndClickByXpath("//input[@title='Active Indicator - No']");
2116 waitAndClickSearch();
2117 isElementPresentByLinkText(permissionName);
2118 List<String> params = new ArrayList<String>();
2119 params.add(docId);
2120 params.add(permissionName);
2121
2122 return params;
2123 }
2124
2125 protected List<String> testCreateNewPerson(String docId, String personName) throws Exception
2126 {
2127 waitForPageToLoad();
2128 docId = waitForDocId();
2129 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding Charlie Brown");
2130 waitAndTypeByName("document.documentHeader.explanation", "I want to add Charlie Brown to test KIM");
2131
2132
2133 personName = "cbrown" + ITUtil.DTS_TWO;
2134 waitAndTypeByName("document.principalName", personName);
2135 waitAndClickSave();
2136 waitForPageToLoad();
2137 assertElementPresentByXpath(SAVE_SUCCESSFUL_XPATH);
2138 SeleneseTestBase.assertEquals(DOC_STATUS_SAVED, getTextByXpath(DOC_STATUS_XPATH));
2139 waitAndClickSubmit();
2140 waitForPageToLoad();
2141 assertElementPresentByXpath("//div[contains(.,'At least one affiliation must be entered.')]/img[@alt='error']");
2142 assertElementPresentByXpath("//div[contains(.,'At least one name must be entered.')]/img[@alt='error']");
2143 selectOptionByName("newAffln.affiliationTypeCode", "STDNT");
2144 selectOptionByName("newAffln.campusCode", "BL");
2145 checkByName("newAffln.dflt");
2146 waitAndClickByName("methodToCall.addAffln.anchor");
2147 waitForPageToLoad();
2148 Thread.sleep(3000);
2149 selectOptionByName("newName.nameCode", "PRM");
2150 selectOptionByName("newName.namePrefix", "Mr");
2151 waitAndTypeByName("newName.firstName", "Charlie");
2152 waitAndTypeByName("newName.lastName", "Brown");
2153 checkByName("newName.dflt");
2154 waitAndClickByName("methodToCall.addName.anchor");
2155 waitForPageToLoad();
2156 waitAndClickSubmit();
2157 waitForPageToLoad();
2158 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, "Document is not submitted successfully");
2159 SeleneseTestBase.assertEquals(DOC_STATUS_ENROUTE, getTextByXpath(DOC_STATUS_XPATH));
2160 List<String> params = new ArrayList<String>();
2161 params.add(docId);
2162 params.add(personName);
2163
2164 return params;
2165 }
2166
2167 protected List<String> testLookUpPerson(String docId, String personName) throws Exception
2168 {
2169 waitForPageToLoad();
2170 waitAndTypeByName("principalName", personName);
2171 waitAndClickSearch();
2172 isElementPresentByLinkText(personName);
2173 waitAndClickByName("methodToCall.clearValues");
2174 waitAndTypeByName("firstName", "Charlie");
2175 waitAndClickSearch();
2176 isElementPresentByLinkText(personName);
2177 waitAndClickByName("methodToCall.clearValues");
2178 waitAndTypeByName("lastName", "Brown");
2179 waitAndClickSearch();
2180 isElementPresentByLinkText(personName);
2181 waitAndClickByName("methodToCall.clearValues");
2182 waitAndTypeByName("campusCode", "BL");
2183 waitAndClickSearch();
2184 isElementPresentByLinkText(personName);
2185 List<String> params = new ArrayList<String>();
2186 params.add(docId);
2187 params.add(personName);
2188
2189 return params;
2190 }
2191
2192 protected List<String> testVerifyPerson(String docId, String personName) throws Exception
2193 {
2194 waitAndClickByLinkText(personName);
2195 waitForPageToLoad();
2196 Thread.sleep(5000);
2197 switchToWindow("Kuali :: Person");
2198 Thread.sleep(2000);
2199 SeleneseTestBase.assertEquals(personName, getTextByXpath("//div[@class='tab-container']/table//tr[2]/td[1]/div").trim());
2200 SeleneseTestBase.assertEquals("BL - BLOOMINGTON", getTextByXpath("//div[@class='tab-container']/table[3]//tr[2]/td[2]/div").trim());
2201 SeleneseTestBase.assertEquals("Student", getTextByXpath("//select/option[@selected]").trim());
2202 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Overview']");
2203 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Contact']");
2204 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Privacy Preferences']");
2205 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Membership']");
2206 waitAndClickByName("methodToCall.showAllTabs");
2207 Thread.sleep(3000);
2208 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Overview']");
2209 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Contact']");
2210 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Privacy Preferences']");
2211 assertElementPresentByXpath("//table[@class='tab']//input[@title='close Membership']");
2212 waitAndClickByName("methodToCall.hideAllTabs");
2213 Thread.sleep(3000);
2214 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Overview']");
2215 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Contact']");
2216 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Privacy Preferences']");
2217 assertElementPresentByXpath("//table[@class='tab']//input[@title='open Membership']");
2218 waitAndClickCloseWindow();
2219 switchToWindow("null");
2220 List<String> params = new ArrayList<String>();
2221 params.add(docId);
2222 params.add(personName);
2223
2224 return params;
2225 }
2226
2227 protected void testUifTooltip(String NAME_FIELD_1, String NAME_FIELD_2) throws Exception {
2228
2229 fireEvent(NAME_FIELD_1, "focus");
2230 fireMouseOverEventByName(NAME_FIELD_1);
2231
2232
2233 SeleneseTestBase.assertEquals("This tooltip is triggered by focus or and mouse over.", getText(
2234 "td.jquerybubblepopup-innerHtml"));
2235
2236
2237 fireEvent(NAME_FIELD_1, "blur");
2238 SeleneseTestBase.assertFalse(isVisible("div.jquerybubblepopup.jquerybubblepopup-black") && isVisible(
2239 "td.jquerybubblepopup-innerHtml"));
2240 Thread.sleep(5000);
2241 fireEvent("field119", "focus");
2242
2243
2244 fireMouseOverEventByName(NAME_FIELD_2);
2245 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(.,\"This is a tool-tip with different position and tail options\")]"));
2246
2247
2248 waitAndTypeByName(NAME_FIELD_2, "a");
2249 Thread.sleep(5000);
2250 SeleneseTestBase.assertFalse(isVisibleByXpath(
2251 "//td[contains(.,\"This is a tool-tip with different position and tail options\")]"));
2252
2253
2254 waitAndTypeByName(NAME_FIELD_1, "1");
2255 fireEvent(NAME_FIELD_1, "blur");
2256 fireMouseOverEventByName(NAME_FIELD_1);
2257 Thread.sleep(10000);
2258 SeleneseTestBase.assertTrue("https://jira.kuali.org/browse/KULRICE-8141 Investigate why UifTooltipIT.testTooltip fails around jquerybubblepopup",
2259 isVisibleByXpath("//div[@class='jquerybubblepopup jquerybubblepopup-kr-error-cs']") &&
2260 !(isVisibleByXpath("//div[@class='jquerybubblepopup jquerybubblepopup-black']")));
2261
2262
2263 passed();
2264 }
2265
2266 protected void testValidCharsConstraintIT() throws Exception {
2267 assertFocusTypeBlurValidation("field50", new String[]{"12.333", "-123.33"}, new String[]{"123.33"});
2268 assertFocusTypeBlurValidation("field51", new String[]{"A"}, new String[]{"-123.33"});
2269
2270
2271 assertFocusTypeBlurValidation("field77", new String[]{"1.1"},new String[]{"12"});
2272 assertFocusTypeBlurValidation("field52", new String[]{"5551112222"},new String[]{"555-111-1111"});
2273 assertFocusTypeBlurValidation("field53", new String[]{"1ClassName.java"},new String[]{"ClassName.java"});
2274 assertFocusTypeBlurValidation("field54", new String[]{"aaaaa"},new String[]{"aaaaa@kuali.org"});
2275 assertFocusTypeBlurValidation("field84", new String[]{"aaaaa"},new String[]{"http://www.kuali.org"});
2276 assertFocusTypeBlurValidation("field55", new String[]{"023512"},new String[]{"022812"});
2277 assertFocusTypeBlurValidation("field75", new String[]{"02/35/12"},new String[]{"02/28/12"});
2278 assertFocusTypeBlurValidation("field82", new String[]{"13:22"},new String[]{"02:33"});
2279 assertFocusTypeBlurValidation("field83", new String[]{"25:22"},new String[]{"14:33"});
2280 assertFocusTypeBlurValidation("field57", new String[]{"0"},new String[]{"2020"});
2281 assertFocusTypeBlurValidation("field58", new String[]{"13"},new String[]{"12"});
2282 assertFocusTypeBlurValidation("field61", new String[]{"5555-444"},new String[]{"55555-4444"});
2283 assertFocusTypeBlurValidation("field62", new String[]{"aa5bb6_a"},new String[]{"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"});
2284 assertFocusTypeBlurValidation("field63", new String[]{"fff555"},new String[]{"aa22 _/"});
2285 assertFocusTypeBlurValidation("field64", new String[]{"AABB55"},new String[]{"ABCDEFGHIJKLMNOPQRSTUVWXY,Z abcdefghijklmnopqrstuvwxy,z"});
2286 assertFocusTypeBlurValidation("field76", new String[]{"AA~BB%"},new String[]{"abcABC %$#@&<>\\{}[]*-+!=.()/\"\"',:;?"});
2287 assertFocusTypeBlurValidation("field65", new String[]{"sdfs$#$# dsffs"},new String[]{"sdfs$#$#sffs"});
2288 assertFocusTypeBlurValidation("field66", new String[]{"abcABCD"},new String[]{"ABCabc"});
2289 assertFocusTypeBlurValidation("field67", new String[]{"(111)B-(222)A"},new String[]{"(12345)-(67890)"});
2290 assertFocusTypeBlurValidation("field68", new String[]{"A.66"},new String[]{"a.4"});
2291 assertFocusTypeBlurValidation("field56", new String[]{"2020-06-02"},new String[]{"2020-06-02 03:30:30.22"});
2292 }
2293
2294 protected void assertFocusTypeBlurValidation(String field, String[] errorInputs, String[] validInputs) throws InterruptedException {
2295 assertFocusTypeBlurError(field, errorInputs);
2296 clearTextByName(field);
2297 assertFocusTypeBlurValid(field, validInputs);
2298 }
2299
2300 protected void testSubCollectionSize() throws Exception {
2301 checkForIncidentReport(COLLECTIONS_LINK_TEXT);
2302
2303
2304 waitAndClickByLinkText(COLLECTIONS_LINK_TEXT);
2305
2306
2307 for (int second = 0;; second++) {
2308 if (second >= waitSeconds)
2309 fail(TIMEOUT_MESSAGE);
2310 try {
2311 if (getText(SUB_COLLECTION_UIF_DISCLOSURE_SPAN_UIF_HEADER_TEXT_SPAN_XPATH).equals("SubCollection - (3 lines)"))
2312 {
2313 break;
2314 }
2315 } catch (Exception e) {}
2316 Thread.sleep(1000);
2317 }
2318
2319
2320 SeleneseTestBase.assertEquals("SubCollection - (3 lines)", getText(SUB_COLLECTION_UIF_DISCLOSURE_SPAN_UIF_HEADER_TEXT_SPAN_XPATH));
2321 SeleneseTestBase.assertEquals("SubCollection - (2 lines)", getTextByXpath(
2322 "//a[@id='subCollection1_line1_toggle']/span"));
2323 }
2324
2325 protected void testDefaultTestsTableLayout() throws Exception {
2326 assertTableLayout();
2327 waitAndTypeByName("newCollectionLines['list1'].field1", "asdf1");
2328 waitAndTypeByName("newCollectionLines['list1'].field2", "asdf2");
2329 waitAndTypeByName("newCollectionLines['list1'].field3", "asdf3");
2330 waitAndTypeByName("newCollectionLines['list1'].field4", "asdf4");
2331 waitAndClickByXpath("//button[contains(.,'add')]"); // the first button is the one we want
2332
2333 for (int second = 0;; second++) {
2334 if (second >= waitSeconds)
2335 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
2336 try {
2337 if (getAttributeByName("newCollectionLines['list1'].field1", "value").equals(""))
2338 break;
2339 } catch (Exception e) {}
2340 Thread.sleep(1000);
2341 }
2342
2343 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field1", "value"));
2344 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field2", "value"));
2345 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field3", "value"));
2346 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field4", "value"));
2347 SeleneseTestBase.assertEquals("asdf1", getAttributeByName("list1[0].field1", "value"));
2348 SeleneseTestBase.assertEquals("asdf2", getAttributeByName("list1[0].field2", "value"));
2349 SeleneseTestBase.assertEquals("asdf3", getAttributeByName("list1[0].field3", "value"));
2350 SeleneseTestBase.assertEquals("asdf4", getAttributeByName("list1[0].field4", "value"));
2351 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-Base-TableLayout_disclosureContent']/div/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button"));
2352 passed();
2353 }
2354
2355
2356
2357 protected void testAddBlankLine() throws Exception {
2358 waitAndClickByLinkText("Add Blank Line");
2359 waitAndClickByXpath("//button[contains(.,'Add Line')]");
2360 Thread.sleep(3000);
2361 assertElementPresentByName("list1[0].field1");
2362 assertTableLayout();
2363 SeleneseTestBase.assertEquals("", getAttributeByName("list1[0].field1", "value"));
2364 SeleneseTestBase.assertEquals("", getAttributeByName("list1[0].field2", "value"));
2365 SeleneseTestBase.assertEquals("", getAttributeByName("list1[0].field3", "value"));
2366 SeleneseTestBase.assertEquals("", getAttributeByName("list1[0].field4", "value"));
2367 SeleneseTestBase.assertEquals("5", getAttributeByName("list1[1].field1", "value"));
2368 SeleneseTestBase.assertEquals("6", getAttributeByName("list1[1].field2", "value"));
2369 SeleneseTestBase.assertEquals("7", getAttributeByName("list1[1].field3", "value"));
2370 SeleneseTestBase.assertEquals("8", getAttributeByName("list1[1].field4", "value"));
2371 SeleneseTestBase.assertEquals("Total: 419", driver.findElement(By.xpath("//fieldset/div/div[2]/div[2]")).getText());
2372 waitAndTypeByName("list1[0].field1", "1");
2373 waitAndTypeByName("list1[0].field2", "1");
2374 waitAndTypeByName("list1[0].field3", "1");
2375 waitAndTypeByName("list1[0].field4", "1");
2376 SeleneseTestBase.assertEquals("Total: 420", driver.findElement(By.xpath("//fieldset/div/div[2]/div[2]")).getText());
2377 }
2378
2379
2380
2381
2382 protected void testActionColumnPlacement() throws Exception {
2383
2384
2385
2386 waitAndClickByLinkText("Column Sequence");
2387 Thread.sleep(2000);
2388
2389
2390
2391
2392 for (int second = 0;; second++) {
2393 if (second >= waitSeconds)
2394 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
2395 try {
2396 if (isElementPresentByXpath("//tr[2]/td[6]/div/fieldset/div/div[2]/button"))
2397 break;
2398 } catch (Exception e) {}
2399 Thread.sleep(1000);
2400 }
2401 SeleneseTestBase.assertTrue(isElementPresentByXpath("//tr[2]/td[6]/div/fieldset/div/div[2]/button"));
2402
2403
2404
2405 for (int second = 0;; second++) {
2406 if (second >= waitSeconds)
2407 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
2408 try {
2409 if (isElementPresentByXpath("//div[2]/div[2]/div[2]/table/tbody/tr[2]/td/div/fieldset/div/div[2]/button"))
2410 break;
2411 } catch (Exception e) {}
2412 Thread.sleep(1000);
2413 }
2414 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[2]/div[2]/div[2]/table/tbody/tr[2]/td/div/fieldset/div/div[2]/button"));
2415
2416
2417
2418 for (int second = 0;; second++) {
2419 if (second >= waitSeconds)
2420 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
2421 try {
2422 if (isElementPresentByXpath("//tr[2]/td[3]/div/fieldset/div/div[2]/button"))
2423 break;
2424 } catch (Exception e) {}
2425 Thread.sleep(1000);
2426 }
2427 SeleneseTestBase.assertTrue(isElementPresentByXpath("//tr[2]/td[3]/div/fieldset/div/div[2]/button"));
2428 }
2429
2430 protected void testAddViaLightbox() throws Exception {
2431 waitAndClickByLinkText("Add Via Lightbox");
2432 SeleneseTestBase.assertEquals("Total: 419", driver.findElement(By.xpath("//fieldset/div/div[2]/div[2]")).getText());
2433 waitAndClickByXpath("//button[contains(.,'Add Line')]");
2434 Thread.sleep(3000);
2435 waitAndTypeByXpath("//form/div/table/tbody/tr/td/div/input", "1");
2436 waitAndTypeByXpath("//form/div/table/tbody/tr[2]/td/div/input", "1");
2437 waitAndTypeByXpath("//form/div/table/tbody/tr[3]/td/div/input", "1");
2438 waitAndTypeByXpath("//form/div/table/tbody/tr[4]/td/div/input", "1");
2439 waitAndClickByXpath("//button[@id='Collections-AddViaLightbox-TableTop_add']");
2440 Thread.sleep(3000);
2441 SeleneseTestBase.assertEquals("Total: 420", driver.findElement(By.xpath("//fieldset/div/div[2]/div[2]")).getText());
2442 }
2443
2444 protected void testColumnSequence() throws Exception {
2445 waitAndClickByLinkText("Column Sequence");
2446 Thread.sleep(3000);
2447 waitAndTypeByName("newCollectionLines['list1'].field1", "1");
2448 waitAndTypeByName("newCollectionLines['list1'].field2", "1");
2449 waitAndTypeByName("newCollectionLines['list1'].field3", "1");
2450 waitAndTypeByName("newCollectionLines['list1'].field4", "1");
2451 waitAndClick(By.id("Collections-ColumnSequence-TableDefault_add"));
2452 Thread.sleep(3000);
2453
2454
2455 testIfRowHasBeenAdded();
2456
2457
2458 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-ColumnSequence-TableDefault_disclosureContent']/div[@class='dataTables_wrapper']/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button"));
2459 }
2460
2461 protected void testSequencerow() throws Exception {
2462 waitAndClickByLinkText("Save Row");
2463 Thread.sleep(3000);
2464 waitAndTypeByName("newCollectionLines['list1'].field1", "1");
2465 waitAndTypeByName("newCollectionLines['list1'].field2", "1");
2466 waitAndTypeByName("newCollectionLines['list1'].field3", "1");
2467 waitAndTypeByName("newCollectionLines['list1'].field4", "1");
2468 waitAndClickByXpath("//button[contains(.,'add')]");
2469 Thread.sleep(3000);
2470
2471
2472 testIfRowHasBeenAdded();
2473
2474
2475 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Collections-SaveRow-Table_disclosureContent']/div[@class='dataTables_wrapper']/table/tbody/tr[2]/td[6]/div/fieldset/div/div[@class='uif-boxLayout uif-horizontalBoxLayout clearfix']/button"));
2476
2477 }
2478
2479 protected void testIfRowHasBeenAdded() throws Exception {
2480
2481 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field1", "value"));
2482 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field2", "value"));
2483 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field3", "value"));
2484 SeleneseTestBase.assertEquals("", getAttributeByName("newCollectionLines['list1'].field4", "value"));
2485 SeleneseTestBase.assertEquals("1", getAttributeByName("list1[0].field1", "value"));
2486 SeleneseTestBase.assertEquals("1", getAttributeByName("list1[0].field2", "value"));
2487 SeleneseTestBase.assertEquals("1", getAttributeByName("list1[0].field3", "value"));
2488 SeleneseTestBase.assertEquals("1", getAttributeByName("list1[0].field4", "value"));
2489 }
2490
2491
2492 protected void testCollectionTotalling() throws Exception {
2493
2494 waitForElementPresent("div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']");
2495 SeleneseTestBase.assertEquals("Total: 419", getText(
2496 "div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']"));
2497 clearText("div#Demo-CollectionTotaling-Section1 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section1] input[name='list1[0].field1']");
2498 waitAndType("div#Demo-CollectionTotaling-Section1 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section1] input[name='list1[0].field1']","10");
2499 waitAndClick("div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']");
2500 Thread.sleep(5000);
2501 SeleneseTestBase.assertEquals("Total: 424", getText(
2502 "div#Demo-CollectionTotaling-Section1 div[role='grid'] div[data-label='Total']"));
2503
2504
2505 SeleneseTestBase.assertEquals("Total: 419", getText(
2506 "div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']"));
2507 clearText("div#Demo-CollectionTotaling-Section2 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section2] input[name='list1[0].field1']");
2508 waitAndType("div#Demo-CollectionTotaling-Section2 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section2] input[name='list1[0].field1']","9");
2509 waitAndClick("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']");
2510 Thread.sleep(5000);
2511 SeleneseTestBase.assertEquals("Total: 423", getText(
2512 "div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']"));
2513
2514
2515 SeleneseTestBase.assertEquals("", getTextByXpath("//div[3]/div[3]/table/tfoot/tr/th[2]"));
2516
2517
2518 SeleneseTestBase.assertEquals("Total: 369", getTextByXpath(
2519 "//div[3]/div[3]/table/tfoot/tr/th[3]/div/fieldset/div/div[2]/div[2]"));
2520
2521
2522 SeleneseTestBase.assertEquals("Total:", getTextByXpath("//*[@id='u100213_span']"));
2523 SeleneseTestBase.assertEquals("419", getTextByXpath(
2524 "//div[4]/div[3]/table/tfoot/tr/th[2]/div/fieldset/div/div[2]/div[2]"));
2525
2526
2527 SeleneseTestBase.assertEquals("Total: 382", getTextByXpath("//div[2]/div/fieldset/div/div[2]/div[2]"));
2528 clearText("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']");
2529 waitAndType("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']","11");
2530 waitAndClick("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']");
2531 Thread.sleep(5000);
2532 SeleneseTestBase.assertEquals("Total: 385", getTextByXpath("//div[2]/div/fieldset/div/div[2]/div[2]"));
2533
2534
2535 clearText("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']");
2536 waitAndType("div#Demo-CollectionTotaling-Section6 > div[role='grid'] > table > tbody div[data-parent=Demo-CollectionTotaling-Section6] input[name='list1[0].field4']","15.25");
2537 waitAndClick("div#Demo-CollectionTotaling-Section2 div[role='grid'] div[data-label='Total']");
2538 Thread.sleep(5000);
2539 SeleneseTestBase.assertEquals("Page Average: 11.917", getTextByXpath("//div[2]/fieldset/div/div[2]/div"));
2540 }
2541
2542 protected void testConfigurationTestView(String idPrefix) throws Exception {
2543 waitForElementPresentByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']");
2544
2545
2546 String styleValue = getAttributeByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']", "style");
2547
2548
2549 SeleneseTestBase.assertTrue(idPrefix + "textInputField label does not contain expected style", styleValue.replace(" ", "").contains("color:red"));
2550
2551
2552 String refreshTextSelectLocator = "//select[@id='" + idPrefix + "RefreshTextField_control']";
2553 String[] options1 = getSelectOptionsByXpath(refreshTextSelectLocator);
2554 String dropDownSelectLocator = "//select[@id='" + idPrefix + "DropDown_control']";
2555 selectByXpath(dropDownSelectLocator, "Vegetables");
2556 Thread.sleep(3000);
2557
2558
2559 String[] options2 = getSelectOptionsByXpath(refreshTextSelectLocator);
2560
2561
2562 SeleneseTestBase.assertFalse(
2563 "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",
2564 options1[options1.length - 1].equalsIgnoreCase(options2[options2.length - 1]));
2565
2566
2567 selectByXpath(dropDownSelectLocator, "None");
2568 Thread.sleep(3000);
2569 SeleneseTestBase.assertEquals("true", getAttributeByXpath(refreshTextSelectLocator, "disabled"));
2570 }
2571
2572
2573
2574
2575 protected void confirmAddLineControlsPresent(String idPrefix, String addLineIdSuffix) {
2576 String[] addLineIds = {"StartTime", "StartTimeAmPm", "AllDay"};
2577
2578 for (String id : addLineIds) {
2579 String tagId = "//*[@id='" + idPrefix + id + addLineIdSuffix + "']";
2580 SeleneseTestBase.assertTrue("Did not find id " + tagId, isElementPresentByXpath(tagId));
2581 }
2582 }
2583
2584 protected void testAddLineWithSpecificTime(String idPrefix, String addLineIdSuffix) throws Exception {
2585 waitForElementPresentByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']");
2586 confirmAddLineControlsPresent(idPrefix, addLineIdSuffix);
2587 String startTimeId = "//*[@id='" + idPrefix + "StartTime" + addLineIdSuffix + "']";
2588 String inputTime = "7:06";
2589 waitAndTypeByXpath(startTimeId, inputTime);
2590 String amPmSelectLocator = "//*[@id='" + idPrefix + "StartTimeAmPm" + addLineIdSuffix + "']";
2591 selectByXpath(amPmSelectLocator, "PM");
2592 SeleneseTestBase.assertEquals("PM", getAttributeByXpath(amPmSelectLocator, "value"));
2593 Thread.sleep(5000);
2594 waitAndClickByXpath("//button");
2595 Thread.sleep(5000);
2596
2597
2598 SeleneseTestBase.assertTrue("line (//input[@value='7:06'])is not present https://jira.kuali.org/browse/KULRICE-8162 Configuration Test View Time Info add line button doesn't addline",
2599 isElementPresentByXpath("//input[@value='7:06']"));
2600 }
2601
2602 protected void testAddLineWithAllDay(String idPrefix, String addLineIdSuffix) throws Exception {
2603 waitForElementPresentByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']");
2604 confirmAddLineControlsPresent(idPrefix, addLineIdSuffix);
2605 String startTimeId = "//*[@id='" + idPrefix + "StartTime" + addLineIdSuffix + "']";
2606 String inputTime = "5:20";
2607 waitAndTypeByXpath(startTimeId, inputTime);
2608 String allDaySelector = "//*[@id='" + idPrefix + "AllDay" + addLineIdSuffix + "']";
2609 Thread.sleep(5000);
2610 waitAndClickByXpath(allDaySelector);
2611 Thread.sleep(5000);
2612 waitAndClick("div#ConfigurationTestView-ProgressiveRender-TimeInfoSection button");
2613 Thread.sleep(5000);
2614 }
2615
2616 protected void testAddLineAllDay(String idPrefix, String addLineIdSuffix) throws Exception {
2617 waitForElementPresentByXpath("//span[@id='" + idPrefix + "TextInputField_label_span']");
2618 confirmAddLineControlsPresent(idPrefix, addLineIdSuffix);
2619
2620
2621 String cssCountRows = "div#ConfigurationTestView-ProgressiveRender-TimeInfoSection.uif-group div#ConfigurationTestView-ProgressiveRender-TimeInfoSection_disclosureContent.uif-disclosureContent table tbody tr";
2622 int rowCount = (getCssCount(cssCountRows));
2623 String allDayId = "//*[@id='" + idPrefix + "AllDay" + addLineIdSuffix + "']";
2624 Thread.sleep(5000);
2625 waitAndClickByXpath(allDayId);
2626 waitAndClick("div#ConfigurationTestView-ProgressiveRender-TimeInfoSection button");
2627 Thread.sleep(5000);
2628
2629
2630 assertEquals("line was not added", rowCount + 1, (getCssCount(cssCountRows)));
2631 }
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658 protected void testCategoryLookUp() throws Exception {
2659 waitForPageToLoad();
2660 selectFrameIframePortlet();
2661 waitAndClickByXpath("//button[contains(.,'earch')]");
2662 Thread.sleep(3000);
2663 waitForPageToLoad();
2664 driver.findElement(By.tagName("body")).getText().contains("Actions");
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675 }
2676
2677 protected void testCreateSampleEDocLite() throws Exception {
2678 waitForPageToLoad();
2679 Thread.sleep(3000);
2680 SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
2681 selectFrameIframePortlet();
2682 waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
2683 waitForPageToLoad();
2684
2685
2686 waitAndClickByLinkText("Create Document");
2687 waitForPageToLoad();
2688 Thread.sleep(3000);
2689 String docId = getTextByXpath("//table/tbody/tr[4]/td[@class='datacell1']");
2690 waitAndTypeByName("userName", "Viral Chauhan");
2691 waitAndTypeByName("rqstDate", "12/03/2020");
2692 checkByName("fundedBy");
2693 waitAndTypeByName("addText", "Note Added.");
2694 waitAndClickByXpath("//td[@class='datacell']/div/img");
2695 waitForPageToLoad();
2696 waitAndClickByXpath("//input[@value='submit']");
2697 SeleneseTestBase.assertEquals(Boolean.FALSE,(Boolean) isElementPresentByXpath("//input[@value='submit']"));
2698 SeleneseTestBase.assertEquals(Boolean.FALSE, (Boolean) isElementPresentByXpath("//input[@value='save']"));
2699 SeleneseTestBase.assertEquals(Boolean.FALSE,(Boolean) isElementPresentByXpath("//input[@value='cancel']"));
2700 waitForPageToLoad();
2701 selectTopFrame();
2702 waitAndClickDocSearch();
2703 waitForPageToLoad();
2704 selectFrameIframePortlet();
2705 waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
2706 waitForPageToLoad();
2707 isElementPresent(By.linkText(docId));
2708 }
2709
2710 protected void testTermLookUp() throws Exception {
2711 testLookUp();
2712 assertTextPresent("Term Parameters");
2713 waitAndClick(By.xpath(CANCEL2_XPATH));
2714 passed();
2715 }
2716
2717 protected void testWorkFlowRouteRulesBlanketApp() throws Exception {
2718 waitForPageToLoad();
2719 Thread.sleep(3000);
2720 SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
2721 selectFrameIframePortlet();
2722
2723
2724 waitAndClickCreateNew();
2725 waitForPageToLoad();
2726
2727
2728 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:documentTypeName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
2729 waitForPageToLoad();
2730
2731
2732 waitAndTypeByName("name", "RoutingRuleDocument");
2733
2734
2735 waitAndClickSearch();
2736 waitForPageToLoad();
2737
2738
2739 waitAndClickReturnValue();
2740 waitForPageToLoad();
2741
2742
2743 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.bo.RuleTemplateBo!!).(((name:ruleTemplateName))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
2744 waitForPageToLoad();
2745
2746
2747 waitAndTypeByName("name", "RuleRoutingTemplate");
2748
2749
2750 waitAndClickSearch();
2751 waitForPageToLoad();
2752
2753
2754 waitAndClickReturnValue();
2755 waitForPageToLoad();
2756
2757
2758 waitAndClickByName("methodToCall.createRule");
2759 waitForPageToLoad();
2760 String docId = waitForDocId();
2761 SeleneseTestBase.assertTrue(isElementPresentByName(CANCEL_NAME));
2762
2763
2764 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Test Routing Rule");
2765
2766
2767 waitAndClickByXpath("//input[@id='document.newMaintainableObject.forceAction']");
2768
2769
2770 waitAndTypeByXpath("//textarea[@id='document.newMaintainableObject.description']", "Test Routing Rule1");
2771
2772
2773 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.fieldValues(1321~docTypeFullName)']",
2774 "DocumentTypeDocument");
2775
2776
2777 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kim.impl.identity.PersonImpl!!).(((principalName:document.newMaintainableObject.add.personResponsibilities.principalName,))).((`document.newMaintainableObject.add.personResponsibilities.principalName:principalName,`)).((<>)).(([])).((**)).((^^)).((&&)).((/personImpl/)).((~~)).(::::;"
2778 + getBaseUrlString() + "/kr/lookup.do;::::).anchor15");
2779 waitForPageToLoad();
2780
2781
2782 waitAndClickSearch();
2783 waitForPageToLoad();
2784
2785
2786 waitAndClickReturnValue();
2787 waitForPageToLoad();
2788
2789
2790 selectByXpath("//select[@id='document.newMaintainableObject.add.personResponsibilities.actionRequestedCd']",
2791 "ACKNOWLEDGE");
2792
2793
2794 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.add.personResponsibilities.priority']", "1");
2795
2796
2797 waitAndClickByName("methodToCall.addLine.personResponsibilities.(!!org.kuali.rice.kew.rule.PersonRuleResponsibility!!).(:::;15;:::).anchor15");
2798 waitForPageToLoad();
2799 checkForIncidentReport(BLANKET_APPROVE_NAME);
2800 waitAndClickByName(BLANKET_APPROVE_NAME);
2801 waitForPageToLoad();
2802 driver.switchTo().defaultContent();
2803 Thread.sleep(2000);
2804 waitAndClickDocSearch();
2805 waitForPageToLoad();
2806 SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
2807 selectFrameIframePortlet();
2808 waitAndClickSearch();
2809 waitForPageToLoad();
2810 SeleneseTestBase.assertTrue(isElementPresent(By.linkText(docId)));
2811
2812 if (isElementPresent(By.linkText(docId))) {
2813 assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2), "https://jira.kuali.org/browse/KULRICE-9051 WorkFlow Route Rules Blanket Approval submit status results in Enroute, not Final");
2814 } else {
2815 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_2));
2816 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
2817 }
2818 }
2819
2820 protected void testCreateNewRRDTravelRequestDestRouting() throws Exception {
2821 selectFrameIframePortlet();
2822 waitAndClick("img[alt=\"create new\"]");
2823 waitForPageToLoad();
2824 waitAndClickByName("methodToCall.performLookup.(!!org.kuali.rice.kew.rule.RuleBaseValues!!).(((id:parentRuleId))).((``)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;;::::).anchor");
2825 waitForPageToLoad();
2826 waitAndClickByXpath("//td[@class='infoline']/input[@name='methodToCall.search']");
2827 waitForPageToLoad();
2828 waitAndClick("a[title=\"return valueRule Id=1046 \"]");
2829 waitForPageToLoad();
2830 waitAndClickByName("parentResponsibilityId");
2831 waitAndClickByName("methodToCall.createDelegateRule");
2832 waitForPageToLoad();
2833 Thread.sleep(3000);
2834 waitAndClickCancel();
2835 waitForPageToLoad();
2836 waitAndClickByName("methodToCall.processAnswer.button0");
2837 waitForPageToLoad();
2838 driver.switchTo().defaultContent();
2839 waitAndClickByXpath("(//input[@name='imageField'])[2]");
2840 waitForPageToLoad();
2841 passed();
2842 }
2843
2844 protected void testWorkFlowRouteRulesCreateNew() throws Exception {
2845 waitForPageToLoad();
2846 Thread.sleep(5000);
2847 SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
2848 selectFrameIframePortlet();
2849 waitAndClickCreateNew();
2850 waitForPageToLoad();
2851 Thread.sleep(3000);
2852 waitAndClickByName(CANCEL_NAME,"https://jira.kuali.org/browse/KULRICE-8161 Work Flow Route Rules cancel new yields 404 not found");
2853
2854
2855 waitForPageToLoad();
2856 Thread.sleep(3000);
2857 waitAndClickByName("methodToCall.processAnswer.button0",
2858 "https://jira.kuali.org/browse/KULRICE-7753 : WorkFlowRouteRulesIT cancel confirmation missing from create new Route Rules.");
2859 passed();
2860 }
2861
2862
2863
2864
2865
2866 protected void testWorkFlowRouteRulesEditRouteRules() throws Exception {
2867 waitForPageToLoad();
2868 SeleneseTestBase.assertEquals("Kuali Portal Index", getTitle());
2869 selectFrameIframePortlet();
2870 waitAndClickSearch();
2871 waitAndClickEdit();
2872 waitForPageToLoad();
2873 selectFrameIframePortlet();
2874 Thread.sleep(3000);
2875 waitAndClickCancel();
2876 waitForPageToLoad();
2877 Thread.sleep(3000);
2878 waitAndClickByName("methodToCall.processAnswer.button0");
2879 passed();
2880 }
2881
2882 protected String testCreateNewComponent(String componentName, String componentCode) throws Exception {
2883 return testCreateNewComponent(componentName, componentCode, "");
2884 }
2885
2886 protected String testCreateNewComponent(String componentName, String componentCode, String message) throws Exception {
2887 waitForPageToLoad();
2888 String docId = waitForDocId();
2889
2890
2891 waitAndTypeByName("document.documentHeader.documentDescription", "Adding Test Component");
2892 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-IDM");
2893 waitAndTypeByName("document.newMaintainableObject.code", componentCode);
2894 waitAndTypeByName("document.newMaintainableObject.name", componentName);
2895 checkByName("document.newMaintainableObject.active");
2896 waitAndClickSave();
2897 waitAndClickSubmit();
2898 waitForPageToLoad();
2899 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH, CREATE_NEW_DOCUMENT_NOT_SUBMITTED_SUCCESSFULLY_MESSAGE_TEXT + message);
2900 selectTopFrame();
2901 waitAndClickDocSearchTitle();
2902 waitForPageToLoad();
2903 selectFrameIframePortlet();
2904 waitAndClickSearch();
2905 Thread.sleep(2000);
2906 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
2907 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
2908 selectTopFrame();
2909 return docId;
2910 }
2911
2912
2913 protected void testLookUpComponent(String docId, String componentName, String componentCode) throws Exception {
2914 selectFrameIframePortlet();
2915
2916 waitAndTypeByName("name", componentName);
2917 waitAndClickSearch();
2918 isElementPresentByLinkText(componentName);
2919 waitAndClickByLinkText(componentName);
2920 waitForPageToLoad();
2921 Thread.sleep(2000);
2922 switchToWindow("Kuali :: Inquiry");
2923 Thread.sleep(2000);
2924 SeleneseTestBase.assertEquals(componentName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
2925 SeleneseTestBase.assertEquals(componentCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim());
2926 waitAndClickCloseWindow();
2927 switchToWindow("null");
2928 }
2929
2930 protected void testEditComponent(String docId, String componentName, String componentCode) throws Exception {
2931 selectFrameIframePortlet();
2932 waitAndClickEdit();
2933 waitForPageToLoad();
2934 docId = waitForDocId();
2935 waitAndTypeByName("document.documentHeader.documentDescription", "Editing Test Component");
2936 clearTextByName("document.newMaintainableObject.name");
2937 waitAndTypeByName("document.newMaintainableObject.name", componentName);
2938 waitAndClickSave();
2939 waitAndClickSubmit();
2940 waitForPageToLoad();
2941 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH,"Document is not submitted successfully");
2942 selectTopFrame();
2943 waitAndClickDocSearchTitle();
2944 waitForPageToLoad();
2945 selectFrameIframePortlet();
2946 waitAndClickSearch();
2947 Thread.sleep(2000);
2948 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
2949 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
2950 selectTopFrame();
2951 }
2952
2953 protected void testCopyComponent(String docId, String componentName, String componentCode) throws Exception {
2954 selectFrameIframePortlet();
2955 waitAndClickCopy();
2956 waitForPageToLoad();
2957 docId = waitForDocId();
2958 waitAndTypeByName("document.documentHeader.documentDescription", "Copying Test Component");
2959 selectOptionByName("document.newMaintainableObject.namespaceCode", "KR-IDM");
2960 waitAndTypeByName("document.newMaintainableObject.code", componentCode);
2961 clearTextByName("document.newMaintainableObject.name");
2962 waitAndTypeByName("document.newMaintainableObject.name", componentName);
2963 waitAndClickSave();
2964 waitAndClickSubmit();
2965 waitForPageToLoad();
2966 checkForDocError();
2967 assertElementPresentByXpath(DOC_SUBMIT_SUCCESS_MSG_XPATH,"Document is not submitted successfully");
2968 selectTopFrame();
2969 waitAndClickDocSearchTitle();
2970 waitForPageToLoad();
2971 selectFrameIframePortlet();
2972 waitAndClickSearch();
2973 Thread.sleep(2000);
2974 SeleneseTestBase.assertEquals(docId, getTextByXpath(DOC_ID_XPATH_3));
2975 SeleneseTestBase.assertEquals(DOC_STATUS_FINAL, getTextByXpath(DOC_STATUS_XPATH_2));
2976 selectTopFrame();
2977 }
2978
2979 protected void testVerifyCopyComponent(String docId, String componentName, String componentCode) throws Exception {
2980 selectFrameIframePortlet();
2981 waitAndTypeByName("name", componentName);
2982 waitAndClickSearch();
2983 isElementPresentByLinkText(componentName);
2984 waitAndClickByLinkText(componentName);
2985 waitForPageToLoad();
2986 Thread.sleep(2000);
2987 switchToWindow("Kuali :: Inquiry");
2988 Thread.sleep(2000);
2989 SeleneseTestBase.assertEquals(componentName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
2990 SeleneseTestBase.assertEquals(componentCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim());
2991 waitAndClickCloseWindow();
2992 switchToWindow("null");
2993 }
2994
2995
2996
2997
2998 protected void testPageHelp() throws Exception {
2999
3000 fireMouseOverEventByXpath("//h2/span[@class='uif-headerText-span']");
3001 SeleneseTestBase.assertEquals("Sample text for page help", getText("td.jquerybubblepopup-innerHtml"));
3002
3003
3004 waitAndClickByXpath("//input[@alt='Help for Help Page']");
3005 Thread.sleep(5000);
3006 switchToWindow("Kuali Foundation");
3007 Thread.sleep(5000);
3008 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
3009 }
3010
3011
3012
3013
3014 protected void testTooltipHelp() throws Exception {
3015
3016 if (isElementPresentByXpath("//td[contains(text(),'Sample text for section help - tooltip help')]")) {
3017 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for section help - tooltip help')]"));
3018 }
3019
3020 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - label left')]")) {
3021 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label left')]"));
3022 }
3023
3024 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - label right')]")) {
3025 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label right')]"));
3026 }
3027
3028 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - label top')]")) {
3029 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label top')]"));
3030 }
3031
3032 if (isElementPresentByXpath("//td[contains(text(),'Sample text for standalone help widget tooltip which will never be rendered')]")) {
3033 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for standalone help widget tooltip which will never be rendered')]"));
3034 }
3035
3036 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip')]")) {
3037 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip')]"));
3038 }
3039
3040 if (isElementPresentByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]")) {
3041 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]"));
3042 }
3043
3044 if (isElementPresentByXpath("//td[contains(text(),'Sample text for field help - there is also an on-focus tooltip')]")) {
3045 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also an on-focus tooltip')]"));
3046 }
3047
3048 if (isElementPresentByXpath("//td[contains(text(),'Sample text for on-focus event tooltip')]")) {
3049 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for on-focus event tooltip')]"));
3050 }
3051
3052 if (isElementPresentByXpath("//td[contains(text(),'Sample text for check box help')]")) {
3053 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for check box help')]"));
3054 }
3055
3056
3057 fireMouseOverEventByXpath("//div[@id='ConfigurationTestView-Help-Section1']/div/h3[@class='uif-headerText']");
3058 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for section help - tooltip help')]"));
3059 String javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" + "element[0].style.display='none'";
3060 ((JavascriptExecutor) driver).executeScript(javascript);
3061 Thread.sleep(3000);
3062 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for section help - tooltip help')]"));
3063
3064
3065 SeleneseTestBase.assertFalse(isElementPresent("#ConfigurationTestView-Help-Section1 input.uif-helpImage"));
3066
3067
3068 fireMouseOverEventByXpath("//label[@id='field-label-left_label']");
3069 Thread.sleep(3000);
3070 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label left')]"));
3071 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +
3072 "element[1].style.display='none'";
3073 Thread.sleep(3000);
3074 ((JavascriptExecutor) driver).executeScript(javascript);
3075 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label left')]"));
3076
3077
3078 fireMouseOverEventByXpath("//label[@id='field-label-right_label']");
3079 Thread.sleep(3000);
3080 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label righ')]"));
3081 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +"element[2].style.display='none'";
3082 ((JavascriptExecutor) driver).executeScript(javascript);
3083 Thread.sleep(3000);
3084 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label righ')]"));
3085
3086
3087 fireMouseOverEventByXpath("//label[@id='field-label-top_label']");
3088 Thread.sleep(3000);
3089 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label top')]"));
3090 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" + "element[3].style.display='none'";
3091 ((JavascriptExecutor) driver).executeScript(javascript);
3092 Thread.sleep(3000);
3093 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - label top')]"));
3094
3095
3096 SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@id='standalone-help-not-rendered']"));
3097
3098
3099 fireMouseOverEventByXpath("//label[@id='override-tooltip_label']");
3100 Thread.sleep(3000);
3101 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip')]"));
3102 if (isElementPresentByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]")) {
3103 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for label tooltip - this will not be rendered as it is overridden by the help tooltip')]"));
3104 }
3105 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" + "element[4].style.display='none'";
3106 ((JavascriptExecutor) driver).executeScript(javascript);
3107 Thread.sleep(3000);
3108 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also a tooltip on the label but it is overridden by the help tooltip')]"));
3109
3110
3111 fireMouseOverEventByXpath("//input[@id='on-focus-tooltip_control']");
3112 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for on-focus event tooltip')]"));
3113 fireMouseOverEventByXpath("//label[@id='on-focus-tooltip_label']");
3114 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also an on-focus tooltip')]"));
3115 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +"element[5].style.display='none'";
3116 ((JavascriptExecutor) driver).executeScript(javascript);
3117 Thread.sleep(3000);
3118 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" + "element[6].style.display='none'";
3119 ((JavascriptExecutor) driver).executeScript(javascript);
3120 Thread.sleep(3000);
3121 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for field help - there is also an on-focus tooltip')]"));
3122 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for on-focus event tooltip')]"));
3123
3124
3125 fireMouseOverEventByXpath("//label[@id='checkbox_label']");
3126 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for check box help')]"));
3127 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" + "element[7].style.display='none'";
3128 ((JavascriptExecutor) driver).executeScript(javascript);
3129 Thread.sleep(3000);
3130 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for check box help')]"));
3131 }
3132
3133
3134
3135
3136 protected void testDisplayOnlyTooltipHelp() throws Exception {
3137
3138 if (isElementPresentByXpath("//td[contains(text(),'Sample text for sub-section help')]")) {
3139 SeleneseTestBase.assertFalse(isVisible("//td[contains(text(),'Sample text for sub-section help')]"));
3140 }
3141
3142 if (isElementPresentByXpath("//td[contains(text(),'Sample text for read only field help')]")) {
3143 SeleneseTestBase.assertFalse(isVisible("//td[contains(text(),'Sample text for read only field help')]"));
3144 }
3145
3146
3147 fireMouseOverEventByXpath("//span[contains(text(),'Display only fields')]");
3148 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for sub-section help')]"));
3149 String javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +
3150 "element[0].style.display='none'";
3151 ((JavascriptExecutor) driver).executeScript(javascript);
3152 SeleneseTestBase.assertFalse(isVisibleByXpath("//td[contains(text(),'Sample text for sub-section help')]"));
3153
3154
3155 fireMouseOverEventByXpath("//label[@for='display-field_control']");
3156 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'Sample text for read only field help')]"));
3157 javascript="var element = document.getElementsByClassName('jquerybubblepopup jquerybubblepopup-black');" +
3158 "element[0].style.display='none'";
3159 ((JavascriptExecutor) driver).executeScript(javascript);
3160 }
3161
3162
3163
3164
3165 protected void testMissingTooltipHelp() throws Exception {
3166
3167 SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
3168
3169
3170 SeleneseTestBase.assertFalse(isElementPresent("#ConfigurationTestView-Help-Section2 input.uif-helpImage"));
3171
3172
3173 fireMouseOverEventByXpath("//div[@id='ConfigurationTestView-Help-Section2']/div");
3174 SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
3175 SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
3176
3177
3178 fireMouseOverEventByXpath("//label[@id='missing-tooltip-help_label']");
3179 SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
3180 SeleneseTestBase.assertFalse(isElementPresentByXpath("//*[@class='jquerybubblepopup jquerybubblepopup-black']"));
3181 }
3182
3183
3184
3185
3186
3187 protected void testExternalHelp2() throws Exception {
3188
3189 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for External Help\"]"), "HelpWindow", "http://www.kuali.org/?section");
3190
3191
3192 assertPopUpWindowUrl(By.xpath("//div[@id='field-label-left-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
3193 "http://www.kuali.org/?label_left");
3194
3195
3196 assertPopUpWindowUrl(By.xpath("//div[@id='field-label-right-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
3197 "http://www.kuali.org/?label_right");
3198
3199
3200 assertPopUpWindowUrl(By.xpath("//div[@id='field-label-top-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
3201 "http://www.kuali.org/?system_parm");
3202
3203
3204 assertPopUpWindowUrl(By.id("standalone-external-help"), "HelpWindow", "http://www.kuali.org/?widget_only");
3205 }
3206
3207
3208
3209
3210
3211 protected void testDisplayOnlyExternalHelp2() throws Exception {
3212
3213 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Display only fields\"]"), "HelpWindow", "http://www.kuali.org/?sub_section");
3214
3215
3216 assertPopUpWindowUrl(By.xpath("//div[@id='display-field-external-help']/fieldset/input[@title='Help for Field Label']"), "HelpWindow",
3217 "http://www.kuali.org/?display_field");
3218 }
3219
3220
3221
3222
3223
3224 protected void testMissingExternalHelp2() throws Exception {
3225
3226 SeleneseTestBase.assertFalse(isElementPresent(By.cssSelector("input[title=\"Help for Missing External Help\"]")));
3227
3228
3229 SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='external-help-externalHelpUrl-empty']/*[@class='uif-helpImage']"));
3230
3231
3232 SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='external-help-helpdefinition-empty']/*[@class='uif-helpImage']"));
3233
3234
3235 SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='external-help-system-parm-missing']/*[@class='uif-helpImage']"));
3236
3237
3238 SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@id='standalone-external-help-missing']"));
3239 }
3240
3241 protected void testReferenceCampusTypeBlanketApprove() throws Exception {
3242 selectFrameIframePortlet();
3243 waitAndCreateNew();
3244 String docId = waitForDocId();
3245 assertBlanketApproveButtonsPresent();
3246 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Campus Type " + ITUtil.DTS_TWO);
3247 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", RandomStringUtils.randomAlphabetic(2));
3248 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", "Indianapolis" + ITUtil.DTS_TWO);
3249 blanketApproveTest();
3250 assertDocFinal(docId);
3251 }
3252
3253 protected void testSearchEditCancel() throws InterruptedException {
3254 selectFrameIframePortlet();
3255 waitAndClickSearch2();
3256 waitAndClickEdit();
3257 testCancelConfirmation();
3258 }
3259
3260 protected void testServerErrorsIT() throws Exception {
3261 waitAndClickByXpath("//button[contains(.,'Get Error Messages')]");
3262 waitForPageToLoad();
3263 Thread.sleep(5000);
3264 assertElementPresent("div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"] .uif-errorMessageItem");
3265 waitIsVisibleByXpath("//div[@data-header_for='Demo-ValidationLayout-Section1']");
3266 assertElementPresentByXpath("//*[@data-messageitemfor='Demo-ValidationLayout-Section1' and @class='uif-errorMessageItem']");
3267 assertElementPresent("div[data-role=\"InputField\"] img[alt=\"Error\"]");
3268 assertElementPresentByXpath("//a[contains(.,'Section 1 Title')]");
3269 fireMouseOverEventByXpath("//a[contains(.,'Field 1')]");
3270 assertElementPresent(".uif-errorMessageItem-field");
3271 waitAndClickByXpath("//a[contains(.,'Field 1')]");
3272 Thread.sleep(2000);
3273 waitIsVisible(".jquerybubblepopup-innerHtml");
3274 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems");
3275 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
3276 waitAndTypeByName("field1", "");
3277 fireEvent("field1", "blur");
3278 fireEvent("field1", "focus");
3279 waitIsVisible(".jquerybubblepopup-innerHtml");
3280 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
3281 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems");
3282 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field");
3283 waitAndTypeByName("field1", "t");
3284
3285 for (int second = 0;; second++) {
3286 if (second >= waitSeconds) {
3287 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
3288 }
3289 try {
3290 if (!isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems")) {
3291 break;
3292 }
3293 } catch (Exception e) {}
3294 Thread.sleep(1000);
3295 }
3296
3297 waitIsVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-errorMessageItem-field");
3298 SeleneseTestBase.assertFalse(isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
3299 }
3300
3301 protected void testServerInfoIT() throws Exception {
3302 waitAndClickByXpath("//button[contains(.,'Get Info Messages')]");
3303 waitIsVisibleByXpath("//div[@data-messagesfor='Demo-ValidationLayout-SectionsPage']");
3304 SeleneseTestBase.assertTrue(isVisibleByXpath("//div[@data-messagesfor='Demo-ValidationLayout-SectionsPage']"));
3305 SeleneseTestBase.assertTrue(isElementPresent("div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"] .uif-infoMessageItem"));
3306 SeleneseTestBase.assertTrue(isVisible("div[data-messagesfor=\"Demo-ValidationLayout-Section1\"]"));
3307 SeleneseTestBase.assertTrue(isElementPresent("div[data-messagesfor=\"Demo-ValidationLayout-Section1\"] .uif-infoMessageItem"));
3308 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@data-role='InputField']//img[@alt='Information']"));
3309 fireMouseOverEventByXpath("//a[contains(.,'Field 1')]");
3310 SeleneseTestBase.assertTrue(isElementPresent(".uif-infoHighlight"));
3311 waitAndClickByXpath("//a[contains(.,'Field 1')]");
3312
3313 for (int second = 0;; second++) {
3314 if (second >= waitSeconds)
3315 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
3316 try {
3317 if (isVisible(".jquerybubblepopup-innerHtml"))
3318 break;
3319 } catch (Exception e) {}
3320 Thread.sleep(1000);
3321 }
3322
3323 SeleneseTestBase.assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems"));
3324 SeleneseTestBase.assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-infoMessageItem-field"));
3325 waitAndTypeByName("field1", "");
3326 fireEvent("field1", "blur");
3327 fireEvent("field1", "focus");
3328
3329 for (int second = 0;; second++) {
3330 if (second >= waitSeconds)
3331 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
3332 try {
3333 if (isVisible(".jquerybubblepopup-innerHtml"))
3334 break;
3335 } catch (Exception e) {}
3336 Thread.sleep(1000);
3337 }
3338
3339 SeleneseTestBase.assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-infoMessageItem-field"));
3340 for (int second = 0;; second++) {
3341 if (second >= waitSeconds)
3342 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
3343 try {
3344 if (isVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"))
3345 break;
3346 } catch (Exception e) {}
3347 Thread.sleep(1000);
3348 }
3349
3350 SeleneseTestBase.assertTrue(isVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field"));
3351 waitAndTypeByName("field1", "b");
3352 fireEvent("field1", "blur");
3353 fireEvent("field1", "focus");
3354
3355 for (int second = 0;; second++) {
3356 if (second >= waitSeconds)
3357 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
3358 try {
3359 if (!isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"))
3360 break;
3361 } catch (Exception e) {}
3362 Thread.sleep(1000);
3363 }
3364
3365 fireEvent("field1", "blur");
3366 Thread.sleep(3000);
3367 SeleneseTestBase.assertTrue(!isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-infoMessageItem-field"));
3368 SeleneseTestBase.assertFalse(isElementPresent(".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
3369 fireEvent("field1", "focus");
3370 clearTextByName("field1");
3371 fireEvent("field1", "blur");
3372 SeleneseTestBase.assertTrue(isElementPresent("div.uif-hasError"));
3373 SeleneseTestBase.assertTrue(isElementPresent("img[src*=\"error.png\"]"));
3374 }
3375
3376 protected void testServerWarningsIT() throws Exception {
3377 waitAndClickByXpath("//button[contains(.,'Get Warning Messages')]");
3378 waitForPageToLoad();
3379 Thread.sleep(3000);
3380 com.thoughtworks.selenium.SeleneseTestBase.assertTrue("div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"] not visible",
3381 isVisible("div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"]"));
3382 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3383 "div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"] .uif-warningMessageItem not present",
3384 isElementPresent("div[data-messagesfor=\"Demo-ValidationLayout-SectionsPage\"] .uif-warningMessageItem"));
3385 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3386 "div[data-messagesfor=\"Demo-ValidationLayout-Section1\"] not visible", isVisible(
3387 "div[data-messagesfor=\"Demo-ValidationLayout-Section1\"]"));
3388 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3389 "div[data-messagesfor=\"Demo-ValidationLayout-Section1\"] .uif-warningMessageItem not present",
3390 isElementPresent("div[data-messagesfor=\"Demo-ValidationLayout-Section1\"] .uif-warningMessageItem"));
3391 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3392 "div[data-role=\"InputField\"] img[alt=\"Warning\"] not present", isElementPresent(
3393 "div[data-role=\"InputField\"] img[alt=\"Warning\"]"));
3394 fireMouseOverEvent(By.xpath("//a[contains(.,'Field 1')]"));
3395 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3396 ".uif-warningHighlight no present when //a[contains(.,'Field 1')] is moused over",
3397 isElementPresent(".uif-warningHighlight"));
3398 waitAndClickByXpath("//a[contains(.,'Field 1')]");
3399 waitForElementVisible(".jquerybubblepopup-innerHtml", " after click on //a[contains(.,'Field 1')]");
3400 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3401 ".jquerybubblepopup-innerHtml > .uif-serverMessageItems not visible", isVisible(
3402 ".jquerybubblepopup-innerHtml > .uif-serverMessageItems"));
3403 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3404 ".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field not visible",
3405 isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field"));
3406 waitAndTypeByName("field1", "");
3407 fireEvent("field1", "blur");
3408 fireMouseOverEventByName("field1");
3409 waitForElementVisible(".jquerybubblepopup-innerHtml",
3410 " not visible after typing nothing in name=field1 then firing blur and focus events");
3411 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3412 ".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field not visible after typing nothing in name=field1 then firing blur and focus events",
3413 isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field"));
3414 waitForElementVisible(".jquerybubblepopup-innerHtml> .uif-clientMessageItems",
3415 " not visible after typing nothing in name=field1 then firing blur and focus events");
3416 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3417 ".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field not visible after typing nothing in name=field1 then firing blur and focus events",
3418 isVisible(".jquerybubblepopup-innerHtml > .uif-clientMessageItems .uif-errorMessageItem-field"));
3419 waitAndTypeByName("field1", "b");
3420 fireEvent("field1", "blur");
3421 fireMouseOverEventByName("field1");
3422 waitForElementVisible(".jquerybubblepopup-innerHtml> .uif-serverMessageItems", "");
3423 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3424 ".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field not visible after typing b in name=field1 then firing blur and focus events",
3425 isVisible(".jquerybubblepopup-innerHtml > .uif-serverMessageItems .uif-warningMessageItem-field"));
3426 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(".jquerybubblepopup-innerHtml > .uif-clientMessageItems",
3427 !isElementPresent(
3428 ".jquerybubblepopup-innerHtml > .uif-clientMessageItems"));
3429 clearTextByName("field1");
3430 fireEvent("field1", "blur");
3431 fireMouseOverEventByName("field1");
3432 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3433 ".uif-hasError is not present after typing nothing in name=field1 and then firing focus and blur events",
3434 isElementPresent(".uif-hasError"));
3435 com.thoughtworks.selenium.SeleneseTestBase.assertTrue(
3436 "img[src*=\"error.png\"] is not present after typing nothing in name=field1 and then firing focus and blur events",
3437 isElementPresent("img[src*=\"error.png\"]"));
3438 passed();
3439 }
3440
3441
3442
3443
3444 protected void testViewHelp() throws Exception {
3445
3446 fireMouseOverEventByXpath("//h1/span[@class='uif-headerText-span']");
3447 SeleneseTestBase.assertEquals("View help", getText("td.jquerybubblepopup-innerHtml"));
3448
3449
3450 waitAndClickByXpath("//input[@alt='Help for Configuration Test View']");
3451 Thread.sleep(5000);
3452 switchToWindow("Kuali Foundation");
3453 Thread.sleep(5000);
3454 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
3455 }
3456
3457
3458
3459
3460 protected void testViewHelp2() throws Exception {
3461
3462 if (isElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']")) {
3463 SeleneseTestBase.assertFalse(driver.findElement(By.cssSelector("td.jquerybubblepopup-innerHtml")).isDisplayed());
3464 }
3465
3466
3467 fireMouseOverEventByXpath("//h1/span[@class='uif-headerText-span']");
3468 Thread.sleep(2000);
3469 SeleneseTestBase.assertTrue(isVisibleByXpath("//td[contains(text(),'View help')]"));
3470 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Configuration Test View\"]"), "HelpWindow", "http://www.kuali.org/");
3471 }
3472
3473 protected void testVerifyAddDeleteFiscalOfficerLegacy() throws Exception {
3474 selectFrameIframePortlet();
3475 waitAndTypeByName("document.documentHeader.documentDescription", ITUtil.DTS_TWO);
3476 waitAndTypeByName("newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].number","1234567890");
3477 waitAndTypeByName("newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].foId", "2");
3478 waitAndClickByXpath("//button[@data-loadingmessage='Adding Line...']");
3479 waitForElementPresentByName("document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number");
3480 SeleneseTestBase.assertEquals("1234567890", getAttributeByName(
3481 "document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number", "value"));
3482 SeleneseTestBase.assertEquals("2", getAttributeByName(
3483 "document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].foId", "value"));
3484 waitAndClickByXpath("//button[@data-loadingmessage='Deleting Line...']");
3485 Thread.sleep(3000);
3486 SeleneseTestBase.assertEquals(Boolean.FALSE, (Boolean) isElementPresentByName(
3487 "document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number"));
3488 passed();
3489 }
3490
3491 protected void testVerifyAddDeleteNoteLegacy() throws Exception {
3492 selectFrameIframePortlet();
3493 waitAndClick("div.tableborders.wrap.uif-boxLayoutVerticalItem.clearfix span.uif-headerText-span > img.uif-disclosure-image");
3494 waitForElementPresent("button[title='Add a Note'].uif-action.uif-primaryActionButton.uif-smallActionButton");
3495 waitAndClickByName("newCollectionLines['document.notes'].noteText");
3496 waitAndTypeByName("newCollectionLines['document.notes'].noteText", "Test note");
3497 waitAndClick("button[title='Add a Note'].uif-action.uif-primaryActionButton.uif-smallActionButton");
3498 waitForElementPresentByName("document.notes[0].noteText");
3499 SeleneseTestBase.assertEquals("Test note", getTextByXpath("//pre"));
3500 waitAndClick("button[title='Delete a Note'].uif-action.uif-primaryActionButton.uif-smallActionButton");
3501 SeleneseTestBase.assertEquals(Boolean.FALSE, (Boolean) isElementPresentByName("document.notes[0].noteText"));
3502 passed();
3503 }
3504
3505 protected void testVerifyAdHocRecipientsLegacy() throws Exception {
3506 selectFrameIframePortlet();
3507 waitAndClickByLinkText("Fiscal Officer Accounts");
3508 assertElementPresentByXpath(
3509 "//select[@name=\"newCollectionLines['document.adHocRoutePersons'].actionRequested\"]");
3510 assertElementPresentByXpath(
3511 "//input[@name=\"newCollectionLines['document.adHocRoutePersons'].name\" and @type=\"text\"]");
3512 assertElementPresentByXpath(
3513 "//select[@name=\"newCollectionLines['document.adHocRouteWorkgroups'].actionRequested\"]");
3514 assertElementPresentByXpath(
3515 "//input[@name=\"newCollectionLines['document.adHocRouteWorkgroups'].recipientNamespaceCode\" and @type='text']");
3516 assertElementPresentByXpath(
3517 "//input[@name=\"newCollectionLines['document.adHocRouteWorkgroups'].recipientName\" and @type='text']");
3518 passed();
3519 }
3520
3521 protected void testVerifyButtonsLegacy() throws Exception {
3522 selectFrameIframePortlet();
3523 assertElementPresentByXpath("//button[contains(.,'ubmit')]");
3524 assertElementPresentByXpath("//button[contains(.,'ave')]");
3525 assertElementPresentByXpath("//button[contains(.,'lanket approve')]");
3526 assertElementPresentByXpath("//button[contains(.,'lose')]");
3527 assertElementPresentByXpath("//a[contains(.,'ancel')]");
3528 passed();
3529 }
3530
3531 protected void testVerifyConstraintText() throws Exception {
3532 selectFrameIframePortlet();
3533 SeleneseTestBase.assertEquals("* indicates required field", getText(
3534 "div.uif-boxLayout.uif-horizontalBoxLayout.clearfix > span.uif-message.uif-requiredInstructionsMessage.uif-boxLayoutHorizontalItem"));
3535 SeleneseTestBase.assertEquals("Must not be more than 10 characters", getText(
3536 "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"));
3537 SeleneseTestBase.assertEquals("Must not be more than 10 characters", getText(
3538 "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"));
3539 SeleneseTestBase.assertEquals("Must not be more than 10 characters", getText(
3540 "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"));
3541 passed();
3542 }
3543
3544 protected void testVerifyEditedComponent(String docId, String componentName, String componentCode) throws Exception {
3545 selectFrameIframePortlet();
3546 waitAndTypeByName("name", componentName);
3547 waitAndClickSearch();
3548 isElementPresentByLinkText(componentName);
3549 waitAndClickByLinkText(componentName);
3550 waitForPageToLoad();
3551 Thread.sleep(2000);
3552 switchToWindow("Kuali :: Inquiry");
3553 Thread.sleep(2000);
3554 SeleneseTestBase.assertEquals(componentName, getTextByXpath("//div[@class='tab-container']/table//span[@id='name.div']").trim());
3555 SeleneseTestBase.assertEquals(componentCode, getTextByXpath("//div[@class='tab-container']/table//span[@id='code.div']").trim());
3556 waitAndClickCloseWindow();
3557 switchToWindow("null");
3558 List<String> parameterList=new ArrayList<String>();
3559 }
3560
3561 protected void testVerifyDisclosures() throws Exception {
3562 selectFrameIframePortlet();
3563 assertElementPresentByXpath("//span[contains(text(),'Document Overview')]");
3564 assertElementPresentByXpath("//span[contains(text(),'Document Overview')]");
3565 assertElementPresentByXpath("//span[contains(text(),'Account Information')]");
3566 assertElementPresentByXpath("//span[contains(text(),'Fiscal Officer Accounts')]");
3567 assertElementPresentByXpath("//span[contains(text(),'Notes and Attachments')]");
3568 assertElementPresentByXpath("//span[contains(text(),'Ad Hoc Recipients')]");
3569 assertElementPresentByXpath("//span[contains(text(),'Route Log')]");
3570 colapseExpandByXpath("//span[contains(text(),'Document Overview')]//img", "//label[contains(text(),'Organization Document Number')]");
3571 colapseExpandByXpath("//span[contains(text(),'Account Information')]//img","//label[contains(text(),'Travel Account Type Code')]");
3572 colapseExpandByXpath("//span[contains(text(),'Fiscal Officer Accounts')]//img","//a[contains(text(),'Lookup/Add Multiple Lines')]");
3573 expandColapseByXpath("//span[contains(text(),'Notes and Attachments')]//img","//label[contains(text(),'Note Text')]");
3574 expandColapseByXpath("//span[contains(text(),'Ad Hoc Recipients')]","//span[contains(text(),'Ad Hoc Group Requests')]");
3575
3576
3577 waitAndClickByXpath("//span[contains(text(),'Route Log')]//img");
3578 selectFrame("routeLogIFrame");
3579 waitIsVisibleByXpath("//img[@alt='refresh']");
3580
3581
3582 selectTopFrame();
3583 selectFrameIframePortlet();
3584 waitAndClickByXpath("//span[contains(text(),'Route Log')]//img");
3585 selectFrame("routeLogIFrame");
3586 waitNotVisibleByXpath("//img[@alt='refresh']");
3587 passed();
3588 }
3589
3590 protected void testVerifyDocumentOverviewLegacy() throws Exception {
3591 selectFrameIframePortlet();
3592 assertTextPresent("Document Overview");
3593 assertElementPresentByXpath("//input[@name='document.documentHeader.documentDescription']");
3594 assertElementPresentByXpath("//input[@name='document.documentHeader.organizationDocumentNumber']");
3595 assertElementPresentByXpath("//textarea[@name='document.documentHeader.explanation']");
3596 passed();
3597 }
3598
3599 protected void testVerifyExpandCollapse() throws Exception {
3600 selectFrameIframePortlet();
3601 assertElementPresentByXpath("//button[contains(@class, 'uif-expandDisclosuresButton')]");
3602 assertElementPresentByXpath("//button[contains(@class, 'uif-collapseDisclosuresButton')]");
3603 passed();
3604 }
3605
3606 protected void testVerifyFieldsLegacy() throws Exception {
3607 selectFrameIframePortlet();
3608 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.number' and @type='text' and @size=10 and @maxlength=10]");
3609 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.extension.accountTypeCode' and @type='text' and @size=2 and @maxlength=3]");
3610 assertElementPresentByXpath(
3611 "//input[@name='document.newMaintainableObject.dataObject.subAccount' and @type='text' and @size=10 and @maxlength=10]");
3612 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.subsidizedPercent' and @type='text' and @size=6 and @maxlength=20]");
3613 assertElementPresentByXpath(
3614 "//input[@name='document.newMaintainableObject.dataObject.foId' and @type='text' and @size=5 and @maxlength=10]");
3615 assertElementPresentByXpath(
3616 "//input[@name=\"newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].number\" and @type='text' and @size=10 and @maxlength=10]");
3617 assertElementPresentByXpath(
3618 "//input[@name=\"newCollectionLines['document.newMaintainableObject.dataObject.fiscalOfficer.accounts'].foId\" and @type='text' and @size=5 and @maxlength=10]");
3619 passed();
3620 }
3621
3622 protected void testVerifyHeaderFieldsLegacy() throws Exception {
3623 selectFrameIframePortlet();
3624 assertElementPresentByXpath("//div[contains(@class, 'uif-documentNumber')]");
3625 assertElementPresentByXpath("//div[contains(@class, 'uif-documentInitiatorNetworkId')]");
3626 assertElementPresentByXpath("//div[contains(@class, 'uif-documentStatus')]");
3627 assertElementPresentByXpath("//div[contains(@class, 'uif-documentCreateDate')]");
3628 passed();
3629 }
3630
3631 protected void testVerifyLookupAddMultipleLinesLegacy() throws Exception {
3632 selectFrameIframePortlet();
3633 assertElementPresentByXpath("//a[contains(text(),'Lookup/Add Multiple Lines')]");
3634 passed();
3635 }
3636
3637 protected void testVerifyNotesAndAttachments() throws Exception {
3638 selectFrameIframePortlet();
3639 waitAndClickByXpath("//span[contains(text(),'Notes and Attachments')]");
3640 waitForElementPresentByXpath("//button[@title='Add a Note']");
3641 assertElementPresentByXpath("//span[contains(text(),'Notes and Attachments')]");
3642 assertElementPresentByXpath("//textarea[@name=\"newCollectionLines['document.notes'].noteText\"]");
3643 assertElementPresentByXpath("//input[@name='attachmentFile']");
3644
3645
3646 passed();
3647 }
3648
3649 protected void testVerifyQuickfinderIconsLegacy() throws Exception {
3650 selectFrameIframePortlet();
3651 assertTextPresent("Document Overview");
3652 assertElementPresentByXpath("//*[@id='quickfinder1']");
3653 assertElementPresentByXpath("//*[@id='quickfinder2']");
3654 assertElementPresentByXpath("//*[@id='quickfinder3']");
3655 assertElementPresentByXpath("//*[@id='quickfinder4_add']");
3656
3657
3658 passed();
3659 }
3660
3661 protected void testVerifyRouteLog() throws Exception {
3662 selectFrameIframePortlet();
3663 waitAndClickByLinkText("Route Log");
3664 waitForElementPresent("//iframe[contains(@src,'RouteLog.do')]");
3665 passed();
3666 }
3667
3668 protected void testVerifySave() throws Exception {
3669 selectFrameIframePortlet();
3670 waitAndTypeByName("document.documentHeader.documentDescription", "Test Document " + ITUtil.DTS);
3671 waitAndClickByName("document.newMaintainableObject.dataObject.number");
3672 waitAndTypeByName("document.newMaintainableObject.dataObject.number", "1234567890");
3673 waitAndTypeByName("document.newMaintainableObject.dataObject.extension.accountTypeCode", "EAT");
3674 waitAndTypeByName("document.newMaintainableObject.dataObject.subAccount", "a1");
3675 waitAndClick(
3676 "button[data-loadingmessage='Saving...'].uif-action.uif-primaryActionButton.uif-boxLayoutHorizontalItem");
3677 Thread.sleep(2000);
3678
3679
3680 passed();
3681 }
3682
3683 protected void testVerifySubsidizedPercentWatermarkLegacy() throws Exception {
3684 selectFrameIframePortlet();
3685
3686
3687
3688 assertElementPresentByXpath("//input[@name='document.newMaintainableObject.dataObject.subsidizedPercent']");
3689 passed();
3690 }
3691
3692 protected void testWorkFlowDocTypeBlanketApprove() throws Exception {
3693 selectFrameIframePortlet();
3694 waitAndCreateNew();
3695 String docId = waitForDocId();
3696 assertBlanketApproveButtonsPresent();
3697 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Validation Test Document Type " + ITUtil.DTS);
3698 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,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
3699 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
3700 waitAndClickByXpath(parentDocType);
3701 waitAndClickSearch();
3702 waitAndClickReturnValue();
3703 String docTypeName = "DocType" + ITUtil.DTS;
3704 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", docTypeName);
3705 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedDocHandlerUrl']",
3706 "${kr.url}/maintenance.do?methodToCall=docHandler");
3707 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.label']",
3708 "Workflow Maintenance Document Type Document");
3709 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.unresolvedHelpDefinitionUrl']",
3710 "default.htm?turl=WordDocuments%2Fdocumenttype.htm");
3711 blanketApproveTest();
3712 assertDocFinal(docId);
3713 }
3714
3715 protected void uncheck(By by) throws InterruptedException {
3716 WebElement element = driver.findElement(by);
3717 if (element.isSelected()) {
3718 element.click();
3719 }
3720 }
3721
3722 protected void uncheckByName(String name) throws InterruptedException {
3723 uncheck(By.name(name));
3724 }
3725
3726 protected void uncheckByXpath(String locator) throws InterruptedException {
3727 uncheck(By.xpath(locator));
3728 }
3729
3730 protected boolean validateErrorImage(boolean validateVisible) throws Exception {
3731 Thread.sleep(500);
3732 boolean valid = false;
3733
3734 for (int second = 0;; second++) {
3735 if ((valid = validateErrorImage(validateVisible, second, ARIA_INVALID_XPATH)) == true) {
3736 break;
3737 }
3738 }
3739
3740 if (validateVisible) {
3741 SeleneseTestBase.assertTrue(isElementPresentByXpath(ARIA_INVALID_XPATH));
3742 } else {
3743 SeleneseTestBase.assertTrue(!isElementPresentByXpath(ARIA_INVALID_XPATH));
3744 }
3745
3746 return valid;
3747 }
3748
3749 private boolean validateErrorImage(boolean validateVisible, int second, String xpath) throws InterruptedException {
3750 if (second >= 5)
3751 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
3752 try {
3753 if (validateVisible) {
3754 if (isElementPresentByXpath(xpath))
3755 ;
3756 return true;
3757 } else {
3758 if (!isElementPresentByXpath(xpath))
3759 return true;
3760 }
3761 } catch (Exception e) {}
3762 Thread.sleep(1000);
3763 return false;
3764 }
3765
3766 protected void verifyRichMessagesValidationBasicFunctionality() throws Exception
3767 {
3768 SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field1']"));
3769 SeleneseTestBase.assertTrue(isElementPresentByXpath("//a[contains(text(), 'Kuali')]"));
3770 SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='checkbox' and @name='field2']"));
3771 Thread.sleep(3000);
3772 }
3773
3774 protected void verifyRichMessagesValidationAdvancedFunctionality() throws Exception
3775 {
3776
3777 SeleneseTestBase.assertTrue(isElementPresentByXpath("//span[@style='color: green;']"));
3778 SeleneseTestBase.assertTrue(isElementPresentByXpath("//span[@style='color: blue;']"));
3779
3780
3781 SeleneseTestBase.assertTrue(isElementPresentByXpath("//span[@class='fl-text-underline fl-text-larger']"));
3782
3783
3784 SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field3']"));
3785 SeleneseTestBase.assertTrue(isElementPresentByXpath("//select[@name='field4']"));
3786 SeleneseTestBase.assertTrue(isElementPresentByXpath("//button[contains(text(), 'Action Button')]"));
3787
3788
3789 SeleneseTestBase.assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/span[contains(., 'Color')]"));
3790 SeleneseTestBase.assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/i/b[contains(., 'Html')]"));
3791 SeleneseTestBase.assertTrue(isElementPresentByXpath("//label[contains(., 'Label With')]/img[@class='uif-image inlineBlock']"));
3792 Thread.sleep(3000);
3793 }
3794
3795 protected void verifyRichMessagesValidationLettersNumbersValidation() throws Exception
3796 {
3797
3798 SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field5']"));
3799 waitAndTypeByXpath(
3800 "//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock']/input[@name= 'field5']",
3801 "abc");
3802 SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
3803 clearTextByXpath(
3804 "//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock']/input[@name= 'field5']");
3805 waitAndTypeByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock']/input[@name= 'field5']","abc12");
3806 waitAndTypeByXpath("//input[@name= 'field6']", "");
3807 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
3808 Thread.sleep(3000);
3809 clearTextByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']/input[@name= 'field5']");
3810 waitAndTypeByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']/input[@name= 'field5']","abc");
3811 waitAndTypeByXpath("//input[@name= 'field6']", "");
3812
3813
3814 waitAndTypeByXpath("//input[@name= 'field6']", "123");
3815 SeleneseTestBase.assertFalse(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
3816 clearTextByXpath("//input[@name= 'field6']");
3817 waitAndTypeByXpath("//input[@name= 'field6']", "123ab");
3818 fireEvent("field6", "blur");
3819 Thread.sleep(5000);
3820 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-field uif-inputField uif-inputField-labelTop inlineBlock uif-hasError']"));
3821 Thread.sleep(3000);
3822 }
3823
3824 protected void verifyRichMessagesValidationRadioAndCheckBoxGroupFunctionality() throws Exception
3825 {
3826
3827 SeleneseTestBase.assertTrue(isElementPresentByXpath("//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='1']"));
3828 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3829 "//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='2']"));
3830 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3831 "//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='3']"));
3832 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3833 "//fieldset[@class='uif-verticalRadioFieldset']/span/input[@type='radio' and @name='field24' and @value='4']"));
3834
3835
3836 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3837 "//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='1']"));
3838 SeleneseTestBase.assertTrue(isElementPresentByXpath("//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='2']"));
3839 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3840 "//fieldset[@class='uif-verticalCheckboxesFieldset']/span/input[@type='checkbox' and @name='field115' and @value='3']"));
3841 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3842 "//fieldset[@class='uif-verticalCheckboxesFieldset']/span/label/div/select[@name='field4']"));
3843
3844
3845 SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='checkbox' and @name='bField1']"));
3846 SeleneseTestBase.assertTrue(isElementPresentByXpath("//input[@type='text' and @name='field103']"));
3847 }
3848
3849 protected void verifyRichMessagesValidationLinkDeclarationsFunctionality() throws Exception
3850 {
3851
3852 waitAndClickByXpath("//div[contains(., 'Testing link tag')]/a");
3853 Thread.sleep(9000);
3854 switchToWindow("Open Source Software | www.kuali.org");
3855 switchToWindow(RICH_MESSAGES_WINDOW_TITLE);
3856
3857
3858 waitAndClickByXpath("//div[contains(., 'Testing methodToCall action')]/a");
3859 Thread.sleep(3000);
3860 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3861 "//div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages uif-pageValidationMessages-error']"));
3862 SeleneseTestBase.assertTrue(isElementPresentByXpath(
3863 "//div[@id='Demo-AdvancedMessagesSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
3864 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Demo-RadioCheckboxMessageSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
3865
3866
3867 waitAndClickByXpath("//div[contains(., 'Testing methodToCall action (no client validation check)')]/a");
3868 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages uif-pageValidationMessages-error']"));
3869 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-validationMessages uif-groupValidationMessages']"));
3870 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages uif-pageValidationMessages-error']"));
3871 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Demo-AdvancedMessagesSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
3872 SeleneseTestBase.assertTrue(isElementPresentByXpath("//div[@id='Demo-RadioCheckboxMessageSection']/div[@class='uif-validationMessages uif-groupValidationMessages uif-pageValidationMessages-error']"));
3873 Thread.sleep(3000);
3874 }
3875
3876
3877
3878
3879
3880
3881 protected void waitAndClickAdministration(Failable failable) throws InterruptedException {
3882 waitAndClickByLinkText(ADMINISTRATION_LINK_TEXT, failable);
3883 }
3884
3885 protected void waitAndCancelConfirmation() throws InterruptedException {
3886 waitAndClickCancel();
3887 waitAndClickByName("methodToCall.processAnswer.button0");
3888 }
3889
3890 protected void waitAndClick(By by) throws InterruptedException {
3891 jiraAwareWaitAndClick(by, "");
3892 }
3893
3894 protected void waitAndClick(By by, Failable failable) throws InterruptedException {
3895 jiraAwareWaitAndClick(by, "", failable);
3896 }
3897
3898 protected void waitAndClick(String locator, String message) throws InterruptedException {
3899 jiraAwareWaitAndClick(By.cssSelector(locator), message);
3900 }
3901
3902 protected void waitAndClickByLinkText(String text) throws InterruptedException {
3903 jiraAwareWaitAndClick(By.linkText(text), "");
3904 }
3905
3906 protected void waitAndClickByLinkText(String text, String message) throws InterruptedException {
3907 jiraAwareWaitAndClick(By.linkText(text), message);
3908 }
3909
3910 protected void waitAndClickByLinkText(String text, Failable failable) throws InterruptedException {
3911 jiraAwareWaitAndClick(By.linkText(text), "", failable);
3912 }
3913
3914 protected void waitAndClickByLinkText(String text, String message, Failable failable) throws InterruptedException {
3915 jiraAwareWaitAndClick(By.linkText(text), message, failable);
3916 }
3917
3918 protected void waitAndClickByName(String name) throws InterruptedException {
3919 jiraAwareWaitAndClick(By.name(name), "");
3920 }
3921
3922 protected void waitAndClickByXpath(String xpath) throws InterruptedException {
3923 waitAndClick(By.xpath(xpath));
3924 }
3925
3926 protected void waitAndClickByXpath(String xpath, Failable failable) throws InterruptedException {
3927 waitAndClick(By.xpath(xpath), failable);
3928 }
3929
3930 protected void waitAndClickByName(String name, String message) throws InterruptedException {
3931 jiraAwareWaitAndClick(By.name(name), message);
3932 }
3933
3934 protected void waitAndClickByXpath(String xpath, String message) throws InterruptedException {
3935 jiraAwareWaitAndClick(By.xpath(xpath), message);
3936 }
3937
3938
3939
3940
3941
3942 protected void waitAndClickCancel() throws InterruptedException {
3943 waitAndClickByName(CANCEL_NAME);
3944 }
3945
3946
3947
3948
3949
3950 protected void waitAndClickCloseWindow() throws InterruptedException {
3951 waitAndClickByXpath(CLOSE_WINDOW_XPATH_TITLE);
3952 }
3953
3954
3955
3956
3957
3958 protected void waitAndClickCopy() throws InterruptedException {
3959 waitAndClickByLinkText(COPY_LINK_TEXT);
3960 }
3961
3962
3963
3964
3965
3966 protected void waitAndClickDocSearch() throws InterruptedException {
3967 waitAndClickByXpath(DOC_SEARCH_XPATH);
3968 }
3969
3970
3971
3972
3973
3974 protected void waitAndClickDocSearchTitle() throws InterruptedException {
3975 waitAndClickByXpath(DOC_SEARCH_XPATH_TITLE);
3976 }
3977
3978
3979
3980
3981
3982 protected void waitAndClickLogout() throws InterruptedException {
3983 waitAndClickByXpath(LOGOUT_XPATH, this);
3984 }
3985
3986
3987
3988
3989
3990
3991 protected void waitAndClickLogout(Failable failable) throws InterruptedException {
3992 waitAndClickByXpath(LOGOUT_XPATH, failable);
3993 }
3994
3995
3996
3997
3998
3999
4000 protected void waitAndClickMainMenu(Failable failable) throws InterruptedException {
4001 waitAndClickByLinkText(MAIN_MENU_LINK_TEXT, failable);
4002 }
4003
4004
4005
4006
4007
4008 protected void waitAndClickSave() throws InterruptedException {
4009 waitAndClickByXpath(SAVE_XPATH);
4010 }
4011
4012
4013
4014
4015
4016 private void waitAndClickSearch() throws InterruptedException {
4017 waitAndClickByXpath(SEARCH_XPATH);
4018 }
4019
4020
4021
4022
4023
4024 protected void waitAndClickSubmit() throws InterruptedException {
4025 waitAndClickByXpath(SUBMIT_XPATH);
4026 }
4027
4028
4029
4030
4031
4032
4033
4034 protected void waitAndClickXMLIngester(Failable failable) throws InterruptedException {
4035 waitAndClickByLinkText(XML_INGESTER_LINK_TEXT, failable);
4036 }
4037
4038 protected void waitAndType(By by, String text) throws InterruptedException {
4039 waitAndType(by, text, "");
4040 }
4041
4042 protected void waitAndType(By by, String text, String message) throws InterruptedException {
4043 try {
4044 jiraAwareWaitFor(by, "");
4045 (driver.findElement(by)).sendKeys(text);
4046 } catch (Exception e) {
4047 JiraAwareFailureUtil.failOnMatchedJira(by.toString(), this);
4048 fail(e.getMessage() + " " + by.toString() + " unable to type text '" + text + "' " + message
4049 + " current url " + driver.getCurrentUrl()
4050 + "\n" + ITUtil.deLinespace(driver.getPageSource()));
4051 }
4052 }
4053
4054 protected void waitAndType(String selector, String text) throws InterruptedException {
4055 waitAndType(By.cssSelector(selector), text);
4056 }
4057
4058 protected void waitAndTypeByXpath(String locator, String text) throws InterruptedException {
4059 waitAndType(By.xpath(locator), text);
4060 }
4061
4062 protected void waitAndTypeByXpath(String locator, String text, String message) throws InterruptedException {
4063 waitAndType(By.xpath(locator), text, message);
4064 }
4065
4066 protected void waitAndTypeByName(String name, String text) throws InterruptedException {
4067 waitAndType(By.name(name), text);
4068 }
4069
4070 protected void waitAndCreateNew() throws InterruptedException {
4071 selectFrameIframePortlet();
4072 try {
4073 jGrowl("Create New");
4074 waitAndClickCreateNew();
4075 } catch (Exception e) {
4076 System.out.println("waitAndClickByXpath(\"//img[@alt='create new']\") failed trying title method with " + e.getMessage());
4077 waitAndClickByXpath("//a[@title='Create a new record']");
4078 }
4079 }
4080
4081
4082
4083
4084
4085 protected void waitAndClickCreateNew() throws InterruptedException {
4086 waitAndClickByXpath(CREATE_NEW_XPATH);
4087 }
4088
4089 protected void waitAndClickEdit() throws InterruptedException {
4090 waitAndClickByLinkText(EDIT_LINK_TEXT);
4091 }
4092
4093 protected void waitAndClickReturnValue() throws InterruptedException {
4094 waitAndClickByLinkText(RETURN_VALUE_LINK_TEXT);
4095 }
4096
4097 protected void waitAndClickSearch2() throws InterruptedException {
4098 waitAndClickByXpath(SEARCH_XPATH_2);
4099 }
4100
4101 protected String waitForDocId() throws InterruptedException {
4102 waitForElementPresentByXpath(DOC_ID_XPATH);
4103
4104 return driver.findElement(By.xpath(DOC_ID_XPATH)).getText();
4105 }
4106
4107 protected void waitForElementPresent(String locator) throws InterruptedException {
4108 jiraAwareWaitFor(By.cssSelector(locator), "");
4109 }
4110
4111 protected void waitForElementPresentByXpath(String locator) throws InterruptedException {
4112 jiraAwareWaitFor(By.xpath(locator), "");
4113 }
4114
4115 protected void waitForElementPresentByName(String name) throws InterruptedException {
4116 jiraAwareWaitFor(By.name(name), "");
4117 }
4118
4119 protected void waitForTitleToEqualKualiPortalIndex() throws InterruptedException {
4120 waitForTitleToEqualKualiPortalIndex("");
4121 }
4122
4123 protected void waitIsVisible(By by) throws InterruptedException {
4124 for (int second = 0;; second++) {
4125 if (second >= waitSeconds) {
4126 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
4127 }
4128 if (isVisible(by)) {
4129 break;
4130 }
4131 Thread.sleep(1000);
4132 }
4133 }
4134
4135 protected void waitForElementVisible(String elementLocator, String message) throws InterruptedException {
4136 boolean failed = false;
4137
4138 for (int second = 0;; second++) {
4139 if (second >= waitSeconds)
4140 failed = true;
4141 try {
4142 if (failed || (driver.findElements(By.cssSelector(elementLocator))).size() > 0)
4143 break;
4144 } catch (Exception e) {}
4145 Thread.sleep(1000);
4146 }
4147
4148 checkForIncidentReport(elementLocator);
4149
4150 if (failed)
4151 fail("timeout of " + waitSeconds + " seconds waiting for " + elementLocator + " " + message + " " + driver.getCurrentUrl());
4152 }
4153
4154 protected void waitIsVisible(String locator) throws InterruptedException {
4155 waitIsVisible(By.cssSelector(locator));
4156 }
4157
4158 protected void waitIsVisibleByXpath(String locator) throws InterruptedException {
4159 waitIsVisible(By.xpath(locator));
4160 }
4161
4162 protected void waitForTitleToEqualKualiPortalIndex(String message) throws InterruptedException {
4163 Thread.sleep(2000);
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175 }
4176
4177 protected void waitAndClick(String locator) throws InterruptedException {
4178 waitAndClick(locator, "");
4179 }
4180
4181 protected void waitForPageToLoad() {
4182
4183 }
4184
4185 protected void waitFor(By by) throws InterruptedException {
4186 jiraAwareWaitFor(by, "");
4187 }
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198 private void waitFor(By by, String message) throws InterruptedException {
4199 WebDriverUtil.waitFor(this.driver, this.waitSeconds, by, message);
4200 }
4201
4202
4203
4204
4205
4206 protected void waitAndClickKRAD() throws InterruptedException {
4207 waitAndClickByLinkText(KRAD_XPATH);
4208 }
4209
4210 protected void waitNotVisible(By by) throws InterruptedException {
4211 for (int second = 0;; second++) {
4212 if (second >= waitSeconds) {
4213 SeleneseTestBase.fail(TIMEOUT_MESSAGE);
4214 }
4215 if (!isVisible(by)) {
4216 break;
4217 }
4218 Thread.sleep(1000);
4219 }
4220 }
4221
4222 protected void waitNotVisibleByXpath(String locator) throws InterruptedException {
4223 waitNotVisible(By.xpath(locator));
4224 }
4225 }