001    package edu.samplu.mainmenu.test;
002    
003    import edu.samplu.common.ITUtil;
004    import edu.samplu.common.UpgradedSeleniumITBase;
005    import org.junit.Test;
006    
007    import static junit.framework.Assert.assertTrue;
008    import static org.junit.Assert.assertTrue;
009    
010    /**
011     * test that after doc search, navigating to people flow maintenance view does not cause Javascript errors
012     * and therefore interfere with JS functionality like validation
013     *
014     * @author Kuali Rice Team (rice.collab@kuali.org)
015     */
016    public class DocSearchToAnotherViewIT extends UpgradedSeleniumITBase {
017        @Override
018        public String getTestUrl() {
019            return ITUtil.PORTAL;
020        }
021    
022            @Test
023        /**
024         * test that after doc search, navigating to people flow maintenance view does not cause Javascript errors
025         * and therefore interfere with JS functionality like validation
026         */
027            public void testDocSearchToAnotherView() throws Exception {
028                    waitAndClick("css=img[alt=\"doc search\"]");
029                    waitForPageToLoad();
030                    selectFrame("iframeportlet");
031                    waitAndClick("css=td.infoline > input[name=\"methodToCall.search\"]");
032                    waitForPageToLoad();
033                    selectFrame("relative=top");
034                    waitAndClick("link=Main Menu");
035            setSpeed("2000");
036                    waitAndClick("link=People Flow");
037                    waitForPageToLoad();
038                    selectFrame("iframeportlet");
039                    waitAndClick("link=Create New");
040                    waitForPageToLoad();
041                    focusAndType("name=document.documentHeader.documentDescription", "sample description");
042                    focusAndType("name=document.documentHeader.explanation", "sample explanation");         
043            focus("link=Cancel");
044                    waitAndClick("link=Cancel");
045            //assertTrue(getConfirmation().matches("^Form has unsaved data\\. Do you want to leave anyway[\\s\\S]$")); //Removed Confirmation Panel From the page itself
046            }
047    }