OLD | NEW |
1 This file contains high-level info about how to use password manager tests and | 1 This file contains high-level info about how to use password manager tests and |
2 how to create new ones. | 2 how to create new ones. |
3 | 3 |
4 The password manager tests purpose is to allow automatic password manager | 4 The password manager tests purpose is to allow automatic password manager |
5 checking and avoiding to do so manually. | 5 checking and avoiding to do so manually. |
6 The tests are written in python using selenium Webdriver library. | 6 The tests are written in python using selenium Webdriver library. |
7 | 7 |
8 | 8 |
9 =====Getting started===== | 9 =====Getting started===== |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 class NewWebsiteTest(WebsiteTest): | 69 class NewWebsiteTest(WebsiteTest): |
70 | 70 |
71 def Login(self): | 71 def Login(self): |
72 # Add login steps for the website, for example: | 72 # Add login steps for the website, for example: |
73 self.GoTo("http://url") | 73 self.GoTo("http://url") |
74 self.FillUsernameInto("Username CSS selector") | 74 self.FillUsernameInto("Username CSS selector") |
75 self.FillPasswordInto("Password CSS selector") | 75 self.FillPasswordInto("Password CSS selector") |
76 self.Submit("Password CSS selector") | 76 self.Submit("Password CSS selector") |
77 | 77 |
78 def Logout(self): | |
79 # Add logout steps for the website, for example: | |
80 self.Click("Logout button CSS selector") | |
81 | |
82 Then, to create the new test, you need just to add: | 78 Then, to create the new test, you need just to add: |
83 | 79 |
84 environment.AddWebsiteTest(NewWebsiteTest("website name")) | 80 environment.AddWebsiteTest(NewWebsiteTest("website name")) |
85 | 81 |
86 * For security reasons, passwords and usernames need to be supplied in a | 82 * For security reasons, passwords and usernames need to be supplied in a |
87 separate XML file and never checked in to the repository. The XML file should | 83 separate XML file and never checked in to the repository. The XML file should |
88 contain data structured like this: | 84 contain data structured like this: |
89 | 85 |
90 <website name = "website name"> | 86 <website name = "website name"> |
91 <username>username</username> | 87 <username>username</username> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 1) working tests: tests that are supposed to work. If you have a problem with | 138 1) working tests: tests that are supposed to work. If you have a problem with |
143 one of them, rerun it again. Or try using the Known Issues section to fix it. | 139 one of them, rerun it again. Or try using the Known Issues section to fix it. |
144 2) tests that can cause a crash (the cause of the crash is not related to the | 140 2) tests that can cause a crash (the cause of the crash is not related to the |
145 password manager): This means that this set is expected to become a working | 141 password manager): This means that this set is expected to become a working |
146 test or failing test when the issue that causes the crash now is solved. | 142 test or failing test when the issue that causes the crash now is solved. |
147 3) failing tests: tests that fail for known bug related to the password | 143 3) failing tests: tests that fail for known bug related to the password |
148 manager. When this bug is solved, all the tests that were failing because of | 144 manager. When this bug is solved, all the tests that were failing because of |
149 it are going to be moved to working tests. | 145 it are going to be moved to working tests. |
150 | 146 |
151 Other files: | 147 Other files: |
152 * websites.xml : a private file where you can find all the passwords. You can | 148 * websites.xml: a private file where you can find all the passwords. You can |
153 ask someone to give it to you or just create your own with your personal | 149 ask someone to give it to you or just create your own with your personal |
154 accounts. | 150 accounts. |
155 <websites> | 151 <websites> |
156 <website name = "website name"> | 152 <website name = "website name"> |
157 <username>username</username> | 153 <username>username</username> |
158 <password>password</password> | 154 <password>password</password> |
159 </website> | 155 </website> |
160 </websites> | 156 </websites> |
161 | 157 |
162 | 158 |
163 =====Known Issues===== | 159 =====Known Issues===== |
164 | 160 |
165 The tests are very fragile. Here are some suggestions for solving most of the | 161 The tests are very fragile. Here are some suggestions for solving most of the |
166 problems: | 162 problems: |
167 * Restart the tests. | 163 * Restart the tests. |
168 * Remove the profile if the tests fail at the beginning for unknown reason. | 164 * Remove the profile if the tests fail at the beginning for unknown reason. |
169 * If tests fail, isolate the one that causes problem, read debugging messages | 165 * If tests fail, isolate the one that causes problem, read debugging messages |
170 and keep your eyes on the browser window to understand its causes: | 166 and keep your eyes on the browser window to understand its causes: |
171 a) In the tests, we often need to wait for a menu to appear ... If the | 167 a) In the tests, we often need to wait for a menu to appear ... If the |
172 menu takes more time to appear than expected, the tests are going to fail. | 168 menu takes more time to appear than expected, the tests are going to fail. |
173 b) The websites change very often. And even if they are not changed, they some | 169 b) The websites change very often. And even if they are not changed, they some |
174 time show a popup that broke the tests. In the case you need to login manually | 170 time show a popup that broke the tests. In the case you need to login manually |
175 to the website, close all popup and logout. | 171 to the website, close all popup and logout. |
176 * If you are logged in when the tests crashes, don't forget to log out before | 172 * If you are logged in when the tests crashes, don't forget to log out before |
177 running the tests a second time. | 173 running the tests a second time. |
OLD | NEW |