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 MaintenanceDisclosuresIT extends UpgradedSeleniumITBase{
027        @Override
028        public String getTestUrl() {
029            return PORTAL;
030        }
031    
032        @Test
033        /**
034         * Verify disclosures are present and functional
035         */
036        public void testVerifyDisclosures() throws Exception {
037            selenium.click("link=KRAD");
038            selenium.waitForPageToLoad("50000");
039            selenium.click("link=Travel Account Maintenance (New)");
040            selenium.waitForPageToLoad("100000");
041            selenium.selectFrame("iframeportlet");
042    
043            assertTrue(selenium.isElementPresent("css=#u93_exp"));
044            assertTrue(selenium.isElementPresent("css=#u779_exp"));
045            assertTrue(selenium.isElementPresent("css=#u955_exp"));
046            assertTrue(selenium.isElementPresent("css=#u168_col"));
047            assertTrue(selenium.isElementPresent("css=#u416_col"));
048            assertTrue(selenium.isElementPresent("css=#u755_col"));
049            selenium.click("id=u93_exp");
050    
051            for (int second = 0;; second++) {
052                if (second >= 15) {
053                    fail("timeout");
054                }
055    
056                if (!selenium.isVisible("css=#u116_label")) {
057                    break;
058                }
059    
060                Thread.sleep(1000);
061            }
062    
063            selenium.click("id=u93_col");
064    
065            for (int second = 0;; second++) {
066                if (second >= 15) {
067                    fail("timeout");
068                }
069    
070                if (selenium.isVisible("css=#u116_label")) {
071                    break;
072                }
073    
074                Thread.sleep(1000);
075            }
076    
077            selenium.click("id=u779_exp");
078    
079            for (int second = 0;; second++) {
080                if (second >= 15) {
081                    fail("timeout");
082                }
083    
084                if (!selenium.isVisible("css=#u802_label")) {
085                    break;
086                }
087    
088                Thread.sleep(1000);
089            }
090    
091            selenium.click("id=u779_col");
092    
093            for (int second = 0;; second++) {
094                if (second >= 15) {
095                    fail("timeout");
096                }
097    
098                if (selenium.isVisible("css=#u802_label")) {
099                    break;
100                }
101    
102                Thread.sleep(1000);
103            }
104    
105            selenium.click("css=#u955_toggle > span.uif-headerText-span");
106    
107            for (int second = 0;; second++) {
108                if (second >= 15) {
109                    fail("timeout");
110                }
111    
112                if (!selenium.isVisible("css=h4.uif-headerText > span.uif-headerText-span")) {
113                    break;
114                }
115    
116                Thread.sleep(1000);
117            }
118    
119            selenium.click("css=#u955_toggle > span.uif-headerText-span");
120    
121            for (int second = 0;; second++) {
122                if (second >= 15) {
123                    fail("timeout");
124                }
125    
126                if (selenium.isVisible("css=h4.uif-headerText > span.uif-headerText-span")) {
127                    break;
128                }
129    
130                Thread.sleep(1000);
131            }
132    
133            selenium.click("css=#u168_toggle > span.uif-headerText-span");
134    
135            for (int second = 0;; second++) {
136                if (second >= 15) {
137                    fail("timeout");
138                }
139    
140                if (selenium.isVisible("css=#u221_add")) {
141                    break;
142                }
143    
144                Thread.sleep(1000);
145            }
146    
147            selenium.click("css=#u168_toggle > span.uif-headerText-span");
148    
149            for (int second = 0;; second++) {
150                if (second >= 15) {
151                    fail("timeout");
152                }
153    
154                if (!selenium.isVisible("css=#u221_add")) {
155                    break;
156                }
157    
158                Thread.sleep(1000);
159            }
160    
161            selenium.click("css=#u416_toggle > span.uif-headerText-span");
162    
163            for (int second = 0;; second++) {
164                if (second >= 15) {
165                    fail("timeout");
166                }
167    
168                if (selenium.isVisible("css=#u440 > h4.uif-headerText > span.uif-headerText-span")) {
169                    break;
170                }
171    
172                Thread.sleep(1000);
173            }
174    
175            selenium.click("css=#u416_toggle > span.uif-headerText-span");
176    
177            for (int second = 0;; second++) {
178                if (second >= 15) {
179                    fail("timeout");
180                }
181    
182                if (!selenium.isVisible("css=#u440 > h4.uif-headerText > span.uif-headerText-span")) {
183                    break;
184                }
185    
186                Thread.sleep(1000);
187            }
188    
189            selenium.click("css=#u755_toggle > span.uif-headerText-span");
190    
191            for (int second = 0;; second++) {
192                if (second >= 15) {
193                    fail("timeout");
194                }
195    
196                if (selenium.isVisible("id=routeLogIFrame")) {
197                    break;
198                }
199    
200                Thread.sleep(1000);
201            }
202    
203            selenium.click("css=#u755_toggle > span.uif-headerText-span");
204    
205            for (int second = 0;; second++) {
206                if (second >= 15) {
207                    fail("timeout");
208                }
209    
210                if (!selenium.isVisible("id=routeLogIFrame")) {
211                    break;
212                }
213    
214                Thread.sleep(1000);
215            }
216        }
217    }