View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package edu.samplu.admin.test;
17  
18  import static org.junit.Assert.assertEquals;
19  
20  import edu.samplu.common.AdminMenuLegacyITBase;
21  import edu.samplu.common.ITUtil;
22  import edu.samplu.common.WebDriverLegacyITBase;
23  
24  import org.junit.Test;
25  import org.openqa.selenium.By;
26  
27  /**
28   * tests adding a namespace to Rice.
29   * 
30   * @author Kuali Rice Team (rice.collab@kuali.org)
31   */
32  public class AddingNameSpaceLegacyIT extends AdminMenuLegacyITBase {
33      /**
34       * This overridden method ...
35       * 
36       * @see edu.samplu.common.MenuLegacyITBase#getLinkLocator()
37       */
38      @Override
39      protected String getLinkLocator() {
40          return "Namespace";
41      }
42      @Test
43      public void testAddingNamespace() throws Exception {
44          
45  //        assertEquals("Kuali Portal Index", getTitle());
46  //        waitAndClickByLinkText("Administration");
47  //        waitForPageToLoad();
48  //        Thread.sleep(2000);
49  //        assertEquals("Kuali Portal Index", getTitle());
50  //        waitAndClickByLinkText("Namespace");
51  //        waitForPageToLoad();
52  //        Thread.sleep(3000);
53  //        assertEquals("Kuali Portal Index", getTitle());
54  //        selectFrame("iframeportlet");
55  //        assertElementPresentByXpath("//img[@alt='create new']","create new button does not exist on the page");
56  //        waitAndClickByXpath("//img[@alt='create new']");
57          super.gotoCreateNew();
58          waitForPageToLoad();
59          assertElementPresentByXpath("//*[@name='methodToCall.save' and @alt='save']","save button does not exist on the page");
60          //Enter details for Namespace.
61          waitAndTypeByXpath("//input[@id='document.documentHeader.documentDescription']", "Adding PEANUTS");
62          waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM");
63          waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", "PEANUTS");
64          waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']","The Peanuts Gang");
65          checkByXpath("//input[@id='document.newMaintainableObject.active']");
66          waitAndClickByXpath("//*[@name='methodToCall.save' and @alt='save']");
67          waitForPageToLoad();
68          checkForIncidentReport();
69          assertElementPresentByXpath("//div[contains(div,'Document was successfully saved.')]", "Document is not saved successfully");
70          //checks it is saved and initiator is admin.
71          assertEquals("SAVED", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
72          assertEquals("admin", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
73          
74      }
75  
76      
77  }