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

Unified Diff: components/test/data/password_manager/automated_tests/environment.py

Issue 1084553003: [Password manager tests automation] Adds an ability to specify test_case which should be run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@save_only_errors
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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test/data/password_manager/automated_tests/environment.py
diff --git a/components/test/data/password_manager/automated_tests/environment.py b/components/test/data/password_manager/automated_tests/environment.py
index ecd1e73143301550e95c886943510d80527d466e..fd52754e3b6f496511dca781c3adb8fbb4a355aa 100644
--- a/components/test/data/password_manager/automated_tests/environment.py
+++ b/components/test/data/password_manager/automated_tests/environment.py
@@ -261,7 +261,7 @@ class Environment:
self._ClearDataForCheckbox("#delete-cookies-checkbox")
- def RunTestsOnSites(self, test_type):
+ def RunTestsOnSites(self, test_case_name):
"""Runs the specified test on the known websites.
Also saves the test results in the environment. Note that test types
@@ -271,7 +271,7 @@ class Environment:
on construction.
Args:
- test_type: A test identifier understood by WebsiteTest.run_test().
+ test_case_name: A test name which is a method of WebsiteTest.
"""
self.DeleteCookies()
@@ -282,12 +282,15 @@ class Environment:
successful = True
error = ""
try:
- websitetest.RunTest(test_type)
+ # TODO(melandory): Implement a decorator for WesiteTest methods
+ # which allows to mark them as test cases. And then add a check if
+ # test_case_name is a valid test case.
+ getattr(websitetest, test_case_name)()
except Exception as e:
successful = False
error = e.message
self.tests_results.append(
- (websitetest.name, test_type, successful, error))
+ (websitetest.name, test_case_name, successful, error))
def Quit(self):
"""Shuts down the driver."""
« 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