1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.travelview;
17
18 import edu.samplu.common.UpgradedSeleniumITBase;
19 import org.junit.Test;
20
21 import static org.junit.Assert.*;
22
23
24
25
26 public class MaintenanceAddDeleteFiscalOfficerIT extends UpgradedSeleniumITBase {
27
28 @Override
29 public String getTestUrl() {
30 return PORTAL;
31 }
32
33 @Test
34
35
36
37 public void testVerifyAddDeleteFiscalOfficer() throws Exception {
38 selenium.click("link=KRAD");
39 selenium.waitForPageToLoad("50000");
40 selenium.click("link=Travel Account Maintenance (New)");
41 selenium.waitForPageToLoad("100000");
42 selenium.selectFrame("iframeportlet");
43 selenium.type("id=u1067_add_control", "1234567890");
44 selenium.type("id=u1101_add_control", "2");
45 selenium.click("id=u1066_add");
46
47 for (int second = 0;; second++) {
48 if (second >= 15) {
49 fail("timeout");
50 }
51
52 if (selenium.isElementPresent("name=document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number")) {
53 break;
54 }
55
56 Thread.sleep(1000);
57 }
58
59 assertEquals("1234567890", selenium.getValue("name=document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number"));
60 assertEquals("2", selenium.getValue("name=document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].foId"));
61 selenium.click("css=#u1065_line0");
62
63 for (int second = 0;; second++) {
64 if (second >= 15) {
65 fail("timeout");
66 }
67
68 if (!selenium.isElementPresent("name=document.newMaintainableObject.dataObject.fiscalOfficer.accounts[0].number")) {
69 break;
70 }
71
72 Thread.sleep(1000);
73 }
74 }
75 }