001 /*
002 * Copyright 2006-2012 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.krad.travelview;
017
018 import edu.samplu.common.UpgradedSeleniumITBase;
019 import org.junit.Test;
020
021 import static org.junit.Assert.*;
022
023 /**
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026 public class MaintenanceAddDeleteNoteIT extends UpgradedSeleniumITBase {
027
028 @Override
029 public String getTestUrl() {
030 return PORTAL;
031 }
032
033 @Test
034 /**
035 * Verify we can add and delete a note
036 */
037 public void testVerifyAddDeleteNote() throws Exception {
038 selenium.click("link=KRAD");
039 selenium.waitForPageToLoad("50000");
040 selenium.click("link=Travel Account Maintenance (New)");
041 selenium.waitForPageToLoad("100000");
042 selenium.selectFrame("iframeportlet");
043 selenium.click("css=#u168_col");
044
045 for (int second = 0;; second++) {
046 if (second >= 15) {
047 fail("timeout");
048 }
049
050 if (selenium.isElementPresent("css=#u221_add")) {
051 break;
052 }
053
054 Thread.sleep(1000);
055 }
056
057 selenium.click("id=u334_add_control");
058 selenium.type("id=u334_add_control", "Test note");
059 selenium.click("id=u282_add");
060
061 for (int second = 0;; second++) {
062 if (second >= 15) {
063 fail("timeout");
064 }
065
066 if (selenium.isElementPresent("name=document.notes[0].noteText")) {
067 break;
068 }
069
070 Thread.sleep(1000);
071 }
072
073 assertEquals("Test note", selenium.getText("name=document.notes[0].noteText"));
074 selenium.click("id=u280_line0");
075
076 for (int second = 0;; second++) {
077 if (second >= 15) {
078 fail("timeout");
079 }
080
081 if (!selenium.isElementPresent("name=document.notes[0].noteText")) {
082 break;
083 }
084
085 Thread.sleep(1000);
086 }
087 }
088 }