Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: components/test/data/password_manager/automated_tests/environment.py

Issue 1043453002: [Password Manager Automated tests] Fix enabling the password manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """The testing Environment class. 5 """The testing Environment class.
6 6
7 It holds the WebsiteTest instances, provides them with credentials, 7 It holds the WebsiteTest instances, provides them with credentials,
8 provides clean browser environment, runs the tests, and gathers the 8 provides clean browser environment, runs the tests, and gathers the
9 results. 9 results.
10 """ 10 """
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 # TODO(melandory): We should check why it's off in a first place. 161 # TODO(melandory): We should check why it's off in a first place.
162 # TODO(melandory): Investigate, maybe there is no need to enable it that 162 # TODO(melandory): Investigate, maybe there is no need to enable it that
163 # often. 163 # often.
164 self.driver.get("chrome://settings") 164 self.driver.get("chrome://settings")
165 self.driver.switch_to_frame("settings") 165 self.driver.switch_to_frame("settings")
166 script = "document.getElementById('advanced-settings-expander').click();" 166 script = "document.getElementById('advanced-settings-expander').click();"
167 self.driver.execute_script(script) 167 self.driver.execute_script(script)
168 # TODO(vabr): Wait until element is displayed instead. 168 # TODO(vabr): Wait until element is displayed instead.
169 time.sleep(2) 169 time.sleep(2)
170 script = ( 170 script = (
171 "document.querySelector('#password-manager-enabled').checked = true;") 171 "if (!document.querySelector('#password-manager-enabled').checked) {"
172 " document.querySelector('#password-manager-enabled').click();"
173 "}")
172 self.driver.execute_script(script) 174 self.driver.execute_script(script)
173 time.sleep(2) 175 time.sleep(2)
174 176
175 def _OpenNewTab(self): 177 def _OpenNewTab(self):
176 """Open a new tab, and loads the internals page in the old tab. 178 """Open a new tab, and loads the internals page in the old tab.
177 179
178 Returns: 180 Returns:
179 A handle to the new tab. 181 A handle to the new tab.
180 """ 182 """
181 183
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 except Exception as e: 286 except Exception as e:
285 successful = False 287 successful = False
286 error = e.message 288 error = e.message
287 self.tests_results.append( 289 self.tests_results.append(
288 (websitetest.name, test_type, successful, error)) 290 (websitetest.name, test_type, successful, error))
289 291
290 def Quit(self): 292 def Quit(self):
291 """Shuts down the driver.""" 293 """Shuts down the driver."""
292 294
293 self.driver.quit() 295 self.driver.quit()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698