1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu;
17
18 import edu.samplu.common.ITUtil;
19 import edu.samplu.common.WebDriverLegacyITBase;
20 import org.junit.Test;
21
22 import static com.thoughtworks.selenium.SeleneseTestCase.assertEquals;
23
24
25
26
27 public class InvalidUserNameIT extends WebDriverLegacyITBase {
28 @Override
29 public String getTestUrl() {
30 return ITUtil.PORTAL;
31 }
32 @Override
33 public void setUp() throws Exception {
34 System.setProperty(ITUtil.REMOTE_AUTOLOGIN_PROPERTY, "notnull");
35 super.setUp();
36 }
37
38
39
40
41
42 @Test
43 public void testInvalidUserName() throws InterruptedException {
44 try {
45 ITUtil.login(driver, ITUtil.DTS_TWO);
46 } catch (Exception e) {
47 assertEquals(ITUtil.DTS_TWO, "Invalid username " + ITUtil.DTS_TWO, e.getMessage());
48 passed();
49 }
50 }
51 }