1 package edu.samplu.krad.labs;
2
3 import org.junit.Test;
4 import org.kuali.rice.testtools.selenium.SmokeTestBase;
5 import org.openqa.selenium.By;
6
7
8
9
10
11 public class DemoPerformanceMediumSmokeTest extends SmokeTestBase {
12
13
14
15
16 public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-PerformanceMedium";
17
18
19
20
21 public static final String BOOKMARK_URL_2 = "/kr-krad/labs?viewId=Lab-PerformanceMedium&pageId=Lab-Performance-Page1#Lab-Performance-Page2&methodToCall=start";
22
23 @Override
24 protected String getBookmarkUrl() {
25 return BOOKMARK_URL;
26 }
27
28 @Override
29 protected void navigate() throws Exception {
30 waitAndClickByLinkText("Performance Medium");
31 }
32
33 @Test
34 public void testPerformanceMediumBookmark() throws Exception {
35 testPerformanceMedium();
36 navigateToSecondPage();
37
38 passed();
39 }
40
41 @Test
42 public void testPerformanceMediumNav() throws Exception {
43 testPerformanceMedium();
44 navigateToSecondPage();
45 passed();
46 }
47
48 private void navigateToSecondPage() throws InterruptedException {
49 waitAndClickByLinkText("Page 2");
50 jiraAwareWaitFor(By.xpath("//div[@class='blockUI blockMsg blockPage']"),11,"Timeout 11s - Page is taking too long to load.");
51 waitForBottomButton();
52 }
53
54 private void waitForBottomButton() throws InterruptedException {
55 jiraAwareWaitFor(By.xpath("//button[contains(text(), 'Refresh - Non-Ajax')]"),11,"Timeout 11s - Button Not Present");
56 }
57
58 protected void testPerformanceMedium()throws Exception {
59 waitForBottomButton();
60 }
61 }