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
45 public void testAdStarUserNameBookmark() throws InterruptedException {
46 try {
47 System.setProperty(WebDriverUtils.REMOTE_AUTOLOGIN_PROPERTY, "true");
48 login(driver, "ad*", this);
49 fail("Expected Invalid Login exception with user " + AutomatedFunctionalTestUtils.DTS_TWO);
50 } catch (AssertionError e) {
51 waitForElementVisibleById("Rice-LoginButton", "ad* should not be a valid login");
52 passed();
53 }
54 }
55
56
57
58
59
60 @Test
61 public void testInvalidUserNameBookmark() throws InterruptedException {
62 try {
63 System.setProperty(WebDriverUtils.REMOTE_AUTOLOGIN_PROPERTY, "true");
64 login(driver, AutomatedFunctionalTestUtils.DTS_TWO, this);
65 fail("Expected Invalid Login exception with user " + AutomatedFunctionalTestUtils.DTS_TWO);
66 } catch (AssertionError e) {
67 assertTrue(e.getMessage().contains("Invalid"));
68 passed();
69 }
70 }
71 }