|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <title>Test for Login Manager</title> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
6 <script type="text/javascript" src="pwmgr_common.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
8 </head> |
|
9 <body> |
|
10 Login Manager test: 391514 |
|
11 <p id="display"></p> |
|
12 <div id="content" style="display: none"> |
|
13 <!-- normal form. --> |
|
14 <form id="form1" action="formtest.js"> |
|
15 <input type="text" name="uname"> |
|
16 <input type="password" name="pword"> |
|
17 |
|
18 <button type="submit">Submit</button> |
|
19 <button type="reset"> Reset </button> |
|
20 </form> |
|
21 |
|
22 <!-- limited username --> |
|
23 <form id="form2" action="formtest.js"> |
|
24 <input type="text" name="uname" maxlength="4"> |
|
25 <input type="password" name="pword"> |
|
26 </form> |
|
27 |
|
28 <!-- limited password --> |
|
29 <form id="form3" action="formtest.js"> |
|
30 <input type="text" name="uname"> |
|
31 <input type="password" name="pword" maxlength="4"> |
|
32 </form> |
|
33 |
|
34 <!-- limited username and password --> |
|
35 <form id="form4" action="formtest.js"> |
|
36 <input type="text" name="uname" maxlength="4"> |
|
37 <input type="password" name="pword" maxlength="4"> |
|
38 </form> |
|
39 |
|
40 |
|
41 <!-- limited username --> |
|
42 <form id="form5" action="formtest.js"> |
|
43 <input type="text" name="uname" maxlength="0"> |
|
44 <input type="password" name="pword"> |
|
45 </form> |
|
46 |
|
47 <!-- limited password --> |
|
48 <form id="form6" action="formtest.js"> |
|
49 <input type="text" name="uname"> |
|
50 <input type="password" name="pword" maxlength="0"> |
|
51 </form> |
|
52 |
|
53 <!-- limited username and password --> |
|
54 <form id="form7" action="formtest.js"> |
|
55 <input type="text" name="uname" maxlength="0"> |
|
56 <input type="password" name="pword" maxlength="0"> |
|
57 </form> |
|
58 |
|
59 |
|
60 <!-- limited, but ok, username --> |
|
61 <form id="form8" action="formtest.js"> |
|
62 <input type="text" name="uname" maxlength="999"> |
|
63 <input type="password" name="pword"> |
|
64 </form> |
|
65 |
|
66 <!-- limited, but ok, password --> |
|
67 <form id="form9" action="formtest.js"> |
|
68 <input type="text" name="uname"> |
|
69 <input type="password" name="pword" maxlength="999"> |
|
70 </form> |
|
71 |
|
72 <!-- limited, but ok, username and password --> |
|
73 <form id="form10" action="formtest.js"> |
|
74 <input type="text" name="uname" maxlength="999"> |
|
75 <input type="password" name="pword" maxlength="999"> |
|
76 </form> |
|
77 |
|
78 |
|
79 <!-- limited, but ok, username --> |
|
80 <!-- (note that filled values are exactly 8 characters) --> |
|
81 <form id="form11" action="formtest.js"> |
|
82 <input type="text" name="uname" maxlength="8"> |
|
83 <input type="password" name="pword"> |
|
84 </form> |
|
85 |
|
86 <!-- limited, but ok, password --> |
|
87 <!-- (note that filled values are exactly 8 characters) --> |
|
88 <form id="form12" action="formtest.js"> |
|
89 <input type="text" name="uname"> |
|
90 <input type="password" name="pword" maxlength="8"> |
|
91 </form> |
|
92 |
|
93 <!-- limited, but ok, username and password --> |
|
94 <!-- (note that filled values are exactly 8 characters) --> |
|
95 <form id="form13" action="formtest.js"> |
|
96 <input type="text" name="uname" maxlength="8"> |
|
97 <input type="password" name="pword" maxlength="8"> |
|
98 </form> |
|
99 |
|
100 </div> |
|
101 <pre id="test"> |
|
102 <script class="testbody" type="text/javascript"> |
|
103 |
|
104 /* Test for Login Manager: 391514 (Login Manager gets confused with |
|
105 * password/PIN on usaa.com) |
|
106 */ |
|
107 |
|
108 commonInit(); |
|
109 |
|
110 function startTest() { |
|
111 var i; |
|
112 |
|
113 is($_(1, "uname").value, "testuser", "Checking for filled username 1"); |
|
114 is($_(1, "pword").value, "testpass", "Checking for filled password 1"); |
|
115 |
|
116 for (i = 2; i < 8; i++) { |
|
117 is($_(i, "uname").value, "", "Checking for unfilled username " + i); |
|
118 is($_(i, "pword").value, "", "Checking for unfilled password " + i); |
|
119 } |
|
120 |
|
121 for (i = 8; i < 14; i++) { |
|
122 is($_(i, "uname").value, "testuser", "Checking for filled username " + i); |
|
123 is($_(i, "pword").value, "testpass", "Checking for filled password " + i); |
|
124 } |
|
125 |
|
126 // Note that tests 11-13 are limited to exactly the expected value. |
|
127 // Assert this lest someone change the login we're testing with. |
|
128 is($_(11, "uname").value.length, 8, "asserting test assumption is valid."); |
|
129 |
|
130 SimpleTest.finish(); |
|
131 } |
|
132 |
|
133 window.onload = startTest; |
|
134 |
|
135 SimpleTest.waitForExplicitFinish(); |
|
136 |
|
137 </script> |
|
138 </pre> |
|
139 </body> |
|
140 </html> |