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

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

Issue 1089383002: [Password manager tests automation] Refactor test_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@base
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 | components/test/data/password_manager/automated_tests/run_tests.py » ('j') | 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 for websitetest in self.websitetests: 281 for websitetest in self.websitetests:
282 successful = True 282 successful = True
283 error = "" 283 error = ""
284 try: 284 try:
285 # TODO(melandory): Implement a decorator for WesiteTest methods 285 # TODO(melandory): Implement a decorator for WesiteTest methods
286 # which allows to mark them as test cases. And then add a check if 286 # which allows to mark them as test cases. And then add a check if
287 # test_case_name is a valid test case. 287 # test_case_name is a valid test case.
288 getattr(websitetest, test_case_name)() 288 getattr(websitetest, test_case_name)()
289 except Exception as e: 289 except Exception as e:
290 successful = False 290 successful = False
291 error = e.message 291 # httplib.CannotSendRequest doesn't define a message,
292 # so type(e).__name__ will at least log exception name as a reason.
293 # TODO(melandory): logging.exception(e) produces meaningful result
294 # for httplib.CannotSendRequest, so we can try to propagate information
295 # that reason is an exception to the logging phase.
296 error = "Exception %s %s" % (type(e).__name__, e)
292 self.tests_results.append( 297 self.tests_results.append(
293 (websitetest.name, test_case_name, successful, error)) 298 (websitetest.name, test_case_name, successful, error))
294 299
295 def Quit(self): 300 def Quit(self):
296 """Shuts down the driver.""" 301 """Shuts down the driver."""
297 302
298 self.driver.quit() 303 self.driver.quit()
OLDNEW
« no previous file with comments | « no previous file | components/test/data/password_manager/automated_tests/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698