Index: trunk/extensions/ArticleFeedbackv5/tests/Selenium/FeedbackPage/000_prerequisite_login_hider.testcase |
— | — | @@ -32,18 +32,24 @@ |
33 | 33 | <td></td> |
34 | 34 | </tr> |
35 | 35 | <tr> |
| 36 | + <td>waitForPageToLoad</td> |
| 37 | + <td>5000</td> |
| 38 | + <td></td> |
| 39 | +</tr> |
| 40 | +<tr> |
36 | 41 | <td>deleteAllVisibleCookies</td> |
37 | 42 | <td></td> |
38 | 43 | <td></td> |
39 | 44 | </tr> |
| 45 | +<!--Attempt log out--> |
40 | 46 | <tr> |
41 | 47 | <td>storeEval</td> |
42 | | - <td>null != window.document.getElementById('pt-logout')</td> |
43 | | - <td>canLogOut</td> |
| 48 | + <td>window.document.getElementById('pt-logout')</td> |
| 49 | + <td>logout</td> |
44 | 50 | </tr> |
45 | 51 | <tr> |
46 | 52 | <td>if</td> |
47 | | - <td>"false" != "${canLogOut}"</td> |
| 53 | + <td>logout != "null"</td> |
48 | 54 | <td></td> |
49 | 55 | </tr> |
50 | 56 | <tr> |
— | — | @@ -56,12 +62,70 @@ |
57 | 63 | <td></td> |
58 | 64 | <td></td> |
59 | 65 | </tr> |
| 66 | +<!--Attempt login via anonlogin--> |
60 | 67 | <tr> |
| 68 | + <td>storeEval</td> |
| 69 | + <td>window.document.getElementById('pt-anonlogin')</td> |
| 70 | + <td>login</td> |
| 71 | +</tr> |
| 72 | +<tr> |
| 73 | + <td>if</td> |
| 74 | + <td>login != null</td> |
| 75 | + <td></td> |
| 76 | +</tr> |
| 77 | +<tr> |
61 | 78 | <td>clickAndWait</td> |
62 | 79 | <td>xpath=//*[@id='pt-anonlogin']/a</td> |
63 | 80 | <td></td> |
64 | 81 | </tr> |
65 | 82 | <tr> |
| 83 | + <td>else</td> |
| 84 | + <td></td> |
| 85 | + <td></td> |
| 86 | +</tr> |
| 87 | +<!--Attempt login via normal login--> |
| 88 | +<tr> |
| 89 | + <td>storeEval</td> |
| 90 | + <td>window.document.getElementById('pt-login')</td> |
| 91 | + <td>login</td> |
| 92 | +</tr> |
| 93 | +<tr> |
| 94 | + <td>if</td> |
| 95 | + <td>login != null</td> |
| 96 | + <td></td> |
| 97 | +</tr> |
| 98 | +<tr> |
| 99 | + <td>clickAndWait</td> |
| 100 | + <td>xpath=//*[@id='pt-login']/a</td> |
| 101 | + <td></td> |
| 102 | +</tr> |
| 103 | +<tr> |
| 104 | + <td>else</td> |
| 105 | + <td></td> |
| 106 | + <td></td> |
| 107 | +</tr> |
| 108 | +<tr> |
| 109 | + <td>getEval</td> |
| 110 | + <td>LOG.warn('Cannot locate login element')</td> |
| 111 | + <td></td> |
| 112 | +</tr> |
| 113 | +<!--FATAL - cannot login--> |
| 114 | +<tr> |
| 115 | + <td>assertEval</td> |
| 116 | + <td>1</td> |
| 117 | + <td>0</td> |
| 118 | +</tr> |
| 119 | +<tr> |
| 120 | + <td>endIf</td> |
| 121 | + <td></td> |
| 122 | + <td></td> |
| 123 | +</tr> |
| 124 | +<tr> |
| 125 | + <td>endIf</td> |
| 126 | + <td></td> |
| 127 | + <td></td> |
| 128 | +</tr> |
| 129 | +<tr> |
66 | 130 | <td>type</td> |
67 | 131 | <td>xpath=//input[@name='wpName']</td> |
68 | 132 | <td>${hiderUserName}</td> |
— | — | @@ -76,6 +140,17 @@ |
77 | 141 | <td>id=wpLoginAttempt</td> |
78 | 142 | <td></td> |
79 | 143 | </tr> |
| 144 | +<!--Assert logged in correctly--> |
| 145 | +<tr> |
| 146 | + <td>assertElementPresent</td> |
| 147 | + <td>id=pt-userpage</td> |
| 148 | + <td></td> |
| 149 | +</tr> |
| 150 | +<tr> |
| 151 | + <td>assertText</td> |
| 152 | + <td>xpath=//*[@id='pt-userpage']/a</td> |
| 153 | + <td>${hiderUserName}</td> |
| 154 | +</tr> |
80 | 155 | </tbody></table> |
81 | 156 | </body> |
82 | 157 | </html> |