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.mainmenu.test;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertTrue;
20  
21  import org.junit.Test;
22  import org.openqa.selenium.By;
23  
24  import edu.samplu.common.ITUtil;
25  import edu.samplu.common.WebDriverLegacyITBase;
26  
27  /**
28   * 
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   */
31  public class CreateSampleEDocLiteLegacyIT extends WebDriverLegacyITBase {
32      @Override
33      public String getTestUrl() {
34          return ITUtil.PORTAL;
35      }
36      @Test
37      public void testUntitled() throws Exception {    
38          assertEquals("Kuali Portal Index", getTitle());
39          // click on the main menu eDoc Lite link
40          waitAndClickByLinkText("eDoc Lite");
41          waitForPageToLoad();
42          Thread.sleep(3000);
43          assertEquals("Kuali Portal Index", getTitle());
44          selectFrame("iframeportlet");
45          waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
46          waitForPageToLoad();
47          // click on the create new.
48          waitAndClickByLinkText("Create Document");
49          waitForPageToLoad();
50          Thread.sleep(3000);
51          String docId = getTextByXpath("//table/tbody/tr[4]/td[@class='datacell1']");
52          waitAndTypeByName("userName", "Viral Chauhan");
53          waitAndTypeByName("rqstDate", "12/03/2020");
54          checkByName("fundedBy");
55          waitAndTypeByName("addText","Note Added.");
56          waitAndClickByXpath("//td[@class='datacell']/div/img");
57          waitForPageToLoad();
58          waitAndClickByXpath("//input[@value='submit']");
59          assertEquals(Boolean.FALSE, isElementPresentByXpath("//input[@value='submit']"));
60          assertEquals(Boolean.FALSE, isElementPresentByXpath("//input[@value='save']"));
61          assertEquals(Boolean.FALSE, isElementPresentByXpath("//input[@value='cancel']"));
62          waitForPageToLoad();
63          selectTopFrame();
64          waitAndClickByXpath("//img[@alt='doc search']");
65          waitForPageToLoad();
66          selectFrame("iframeportlet");
67          waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
68          waitForPageToLoad();
69          isElementPresent(By.linkText(docId));
70          
71      }
72  }