001    /**
002     * Copyright 2005-2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package edu.samplu.mainmenu.test;
017    
018    import static org.junit.Assert.assertEquals;
019    import static org.junit.Assert.assertTrue;
020    
021    import org.junit.Test;
022    import org.openqa.selenium.By;
023    
024    import edu.samplu.common.ITUtil;
025    import edu.samplu.common.WebDriverLegacyITBase;
026    
027    /**
028     * 
029     * @author Kuali Rice Team (rice.collab@kuali.org)
030     */
031    public class CreateSampleEDocLiteLegacyIT extends WebDriverLegacyITBase {
032        @Override
033        public String getTestUrl() {
034            return ITUtil.PORTAL;
035        }
036        @Test
037        public void testUntitled() throws Exception {    
038            assertEquals("Kuali Portal Index", getTitle());
039            // click on the main menu eDoc Lite link
040            waitAndClickByLinkText("eDoc Lite");
041            waitForPageToLoad();
042            Thread.sleep(3000);
043            assertEquals("Kuali Portal Index", getTitle());
044            selectFrame("iframeportlet");
045            waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
046            waitForPageToLoad();
047            // click on the create new.
048            waitAndClickByLinkText("Create Document");
049            waitForPageToLoad();
050            Thread.sleep(3000);
051            String docId = getTextByXpath("//table/tbody/tr[4]/td[@class='datacell1']");
052            waitAndTypeByName("userName", "Viral Chauhan");
053            waitAndTypeByName("rqstDate", "12/03/2020");
054            checkByName("fundedBy");
055            waitAndTypeByName("addText","Note Added.");
056            waitAndClickByXpath("//td[@class='datacell']/div/img");
057            waitForPageToLoad();
058            waitAndClickByXpath("//input[@value='submit']");
059            assertEquals(Boolean.FALSE, isElementPresentByXpath("//input[@value='submit']"));
060            assertEquals(Boolean.FALSE, isElementPresentByXpath("//input[@value='save']"));
061            assertEquals(Boolean.FALSE, isElementPresentByXpath("//input[@value='cancel']"));
062            waitForPageToLoad();
063            selectTopFrame();
064            waitAndClickByXpath("//img[@alt='doc search']");
065            waitForPageToLoad();
066            selectFrame("iframeportlet");
067            waitAndClickByXpath("//input[@name='methodToCall.search' and @alt='search']");
068            waitForPageToLoad();
069            isElementPresent(By.linkText(docId));
070            
071        }
072    }