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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |