1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
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
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
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 }