1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu;
17
18 import org.kuali.rice.testtools.selenium.ITUtil;
19 import org.kuali.rice.testtools.selenium.SmokeTestBase;
20 import org.kuali.rice.testtools.selenium.WebDriverUtil;
21 import org.junit.Test;
22
23 import static com.thoughtworks.selenium.SeleneseTestBase.assertTrue;
24
25
26
27
28 public class LoginInvalidUserSmokeTest extends SmokeTestBase {
29
30 @Override
31 protected String getBookmarkUrl() {
32 return ITUtil.PORTAL;
33 }
34
35 @Override
36 protected void navigate() throws Exception {
37
38 }
39
40 @Override
41 public void testSetUp() {
42 System.setProperty(ITUtil.REMOTE_AUTOLOGIN_PROPERTY, "false");
43 super.testSetUp();
44 }
45
46 @Test
47 public void testAdStarUserName() throws InterruptedException {
48 System.setProperty(ITUtil.REMOTE_AUTOLOGIN_PROPERTY, "true");
49 WebDriverUtil.loginKradOrKns(driver, "ad*", this);
50 waitForElementVisibleById("Rice-LoginButton", "ad* should not be a valid login");
51 passed();
52 }
53
54
55
56
57
58 @Test
59 public void testInvalidUserName() throws InterruptedException {
60 try {
61 System.setProperty(ITUtil.REMOTE_AUTOLOGIN_PROPERTY, "true");
62 WebDriverUtil.loginKradOrKns(driver, ITUtil.DTS_TWO, this);
63 fail("Expected Invalid Login exception with user " + ITUtil.DTS_TWO);
64 } catch (AssertionError e) {
65 assertTrue(e.getMessage().contains("Invalid"));
66 passed();
67 }
68 }
69 }