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