1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.admin.test;
17
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertTrue;
20
21 import edu.samplu.common.UpgradedSeleniumITBase;
22 import org.junit.Test;
23
24
25
26
27
28
29 public class IdentityPermissionBlanketAppIT extends UpgradedSeleniumITBase{
30 @Override
31 public String getTestUrl() {
32 return PORTAL;
33 }
34
35 @Test
36 public void testPermission() throws Exception {
37 assertEquals("Kuali Portal Index", selenium.getTitle());
38 selenium.click("link=Administration");
39 selenium.waitForPageToLoad("30000");
40 assertEquals("Kuali Portal Index", selenium.getTitle());
41 selenium.click("link=Permission");
42 selenium.waitForPageToLoad("30000");
43 assertEquals("Kuali Portal Index", selenium.getTitle());
44 selenium.selectFrame("iframeportlet");
45 selenium.click("//img[@alt='create new']");
46 selenium.waitForPageToLoad("30000");
47
48 String docId = selenium.getText("//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]");
49 selenium.type("//input[@id='document.documentHeader.documentDescription']", "Validation Test Permission");
50 selenium.type("//input[@id='document.newMaintainableObject.templateId']", "10012");
51 selenium.select("//select[@id='document.newMaintainableObject.namespaceCode']", IdentityResponsibilityBlanketAppIT.LABEL_KUALI_KUALI_SYSTEMS);
52 selenium.type("//input[@id='document.newMaintainableObject.name']", "Validation Test Permission1");
53 selenium.click("methodToCall.blanketApprove");
54 selenium.waitForPageToLoad("30000");
55 selenium.selectWindow("null");
56 selenium.click("//img[@alt='doc search']");
57 selenium.waitForPageToLoad("30000");
58 assertEquals("Kuali Portal Index", selenium.getTitle());
59 selenium.selectFrame("iframeportlet");
60 selenium.click("//input[@name='methodToCall.search' and @value='search']");
61 selenium.waitForPageToLoad("30000");
62 docId= "link=" + docId;
63 assertTrue(selenium.isElementPresent(docId));
64 if(selenium.isElementPresent(docId)){
65 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
66 }else{
67 assertEquals(docId, selenium.getText("//table[@id='row']/tbody/tr[1]/td[1]"));
68 assertEquals("FINAL", selenium.getText("//table[@id='row']/tbody/tr[1]/td[4]"));
69 }
70 }
71 }