1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.admin;
17
18 import org.kuali.rice.testtools.common.JiraAwareFailable;
19 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20 import org.kuali.rice.testtools.selenium.WebDriverUtils;
21 import org.openqa.selenium.By;
22
23
24
25
26 public abstract class AddingNameSpacesAftBase extends AdminTmplMthdAftNavBase {
27
28
29
30
31 public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL+"?channelTitle=Namespace&channelUrl="+ WebDriverUtils
32 .getBaseUrlString()+"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.namespace.NamespaceBo&docFormKey=88888888&returnLocation="+ AutomatedFunctionalTestUtils.PORTAL_URL+"&hideReturnLink=true";
33
34 @Override
35 protected String getBookmarkUrl() {
36 return BOOKMARK_URL;
37 }
38
39
40
41
42
43
44 @Override
45 protected String getLinkLocator() {
46 return "Namespace";
47 }
48
49 public void testAddingNamespaceBookmark(JiraAwareFailable failable) throws Exception {
50 testAddingNamespace(this);
51 passed();
52 }
53
54 public void testAddingNamespaceNav(JiraAwareFailable failable) throws Exception {
55 testAddingNamespace(this);
56 passed();
57 }
58
59 public void testSearchEditBackNav(JiraAwareFailable failable) throws Exception {
60 testSearchEditBack(this);
61 passed();
62 }
63
64 public void testSearchSearchBackNav(JiraAwareFailable failable) throws Exception {
65 testSearchSearchBack(this, "code", "KR-SYS");
66 passed();
67 }
68
69 protected void testAddingNamespace(JiraAwareFailable failable) throws Exception {
70 selectFrameIframePortlet();
71 waitAndCreateNew();
72 waitForElementPresentByXpath(SAVE_XPATH_2, "save button does not exist on the page");
73
74
75 waitAndTypeByXpath(DOC_DESCRIPTION_XPATH, "Adding PEANUTS");
76 waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM");
77 waitAndTypeByXpath(DOC_CODE_XPATH, "PEANUTS");
78 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']", "The Peanuts Gang");
79 checkByXpath("//input[@id='document.newMaintainableObject.active']");
80 waitAndClickByXpath(SAVE_XPATH_2);
81 waitForElementPresentByXpath(SAVE_SUCCESSFUL_XPATH, "Document is not saved successfully");
82
83
84 assertEquals(DOC_STATUS_SAVED, findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
85 assertEquals("admin", findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
86 }
87 }