1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20
21
22
23
24 public class LabsKSAdminRegistrationAft extends WebDriverLegacyITBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/ksworkshop?viewId=KS-AdminRegistration";
30
31 @Override
32 protected String getBookmarkUrl() {
33 return BOOKMARK_URL;
34 }
35
36 @Override
37 protected void navigate() throws Exception {
38 waitAndClickByLinkText("KS Admin Registration");
39 }
40
41 protected void testKSAdminRegistration() throws InterruptedException {
42
43 waitAndTypeByName("studentId","1");
44 waitAndClickById("KS-AdminRegistration-StudentInfoGo");
45 waitForTextPresent("Allison Glass (Allison Glass)");
46
47
48 String textToAssert =getTextByXpath("//section[@id='KS-AdminRegistration-Registered']/table/tbody/tr/td/div/div");
49 waitAndClickByXpath("//button[@title='Drop Course']");
50 waitAndClickByXpath("//div[@class='modal-footer' and @data-parent='KS-AdminRegistration-DropRegisteredDialog']/button");
51 waitForTextNotPresent(textToAssert);
52 waitForTextPresent("You have deleted an item from Registered Courses");
53
54
55 textToAssert =getTextByXpath("//section[@id='KS-AdminRegistration-Registered']/table/tbody/tr/td[3]/div/span");
56 waitAndClickByXpath("//button[@title='Edit Course']");
57 waitForElementPresentByName("registeredCourses[0].credits");
58 selectByName("registeredCourses[0].credits","1.0");
59 selectByName("registeredCourses[0].regOptions","Audit");
60 waitAndClickByXpath("//button[@title='Cancel']");
61 waitForTextPresent(textToAssert);
62
63
64 textToAssert =getTextByXpath("//section[@id='KS-AdminRegistration-Registered']/table/tbody/tr/td[3]/div/span");
65 waitAndClickByXpath("//button[@title='Edit Course']");
66 waitForElementPresentByName("registeredCourses[0].credits");
67 selectByName("registeredCourses[0].credits","1.0");
68 selectByName("registeredCourses[0].regOptions","Audit");
69 waitAndClickByXpath("//button[@title='Save']");
70 waitForTextPresent("Audit");
71 waitForTextPresent("1.0");
72
73
74 waitAndClickById("KS-AdminRegistration-RegFor_add");
75 waitAndTypeByName("pendingCourses[1].code","1");
76 waitAndTypeByName("pendingCourses[1].section","1");
77 waitAndClickByXpath("//button[contains(text(),'Register')]");
78 waitForElementPresentByXpath("//select[@name='pendingCourses[0].credits']");
79 selectByName("pendingCourses[0].credits","2.0");
80 waitAndClickByXpath("//div[@data-parent='KS-AdminRegistration-RegisterDialogResponse']/button[contains(text(),'Cancel')]");
81
82
83 waitAndClickById("KS-AdminRegistration-RegFor_add");
84 waitAndTypeByName("pendingCourses[1].code","1");
85 waitAndTypeByName("pendingCourses[1].section","1");
86 waitAndClickByXpath("//button[contains(text(),'Register')]");
87 waitForElementPresentByXpath("//select[@name='pendingCourses[0].credits']");
88 selectByName("pendingCourses[0].credits","2.0");
89 waitAndClickByXpath("//button[contains(text(),'Confirm Registration')]");
90 waitForTextPresent("2.0");
91 }
92
93 @Test
94 public void testKSAdminRegistrationBookmark() throws Exception {
95 testKSAdminRegistration();
96 passed();
97 }
98
99 @Test
100 public void testKSAdminRegistrationNav() throws Exception {
101 testKSAdminRegistration();
102 passed();
103 }
104 }