Chromium Code Reviews| Index: components/test/data/password_manager/automated_tests/tests.py |
| diff --git a/components/test/data/password_manager/automated_tests/tests.py b/components/test/data/password_manager/automated_tests/tests.py |
| index e8b937d944ea83180524b1d0aca157eb67a186f3..adc550773adb3f6b8d71b7b17887a07f2338e556 100644 |
| --- a/components/test/data/password_manager/automated_tests/tests.py |
| +++ b/components/test/data/password_manager/automated_tests/tests.py |
| @@ -509,7 +509,7 @@ def SaveResults(environment_tests_results, environment_save_path, |
| save_file.write(xml) |
| def RunTest(chrome_path, chromedriver_path, profile_path, |
| - environment_passwords_path, website_test_name, test_type): |
| + environment_passwords_path, website_test_name, test_case_name): |
| """Runs the test for the specified website. |
| Args: |
| @@ -528,8 +528,7 @@ def RunTest(chrome_path, chromedriver_path, profile_path, |
| fails, or if the website name is not known. |
| """ |
| - enable_automatic_password_saving = ( |
| - test_type == WebsiteTest.TEST_TYPE_SAVE_AND_AUTOFILL) |
| + enable_automatic_password_saving = (test_case_name == "SaveAndAutofillTest") |
| environment = Environment(chrome_path, chromedriver_path, profile_path, |
| environment_passwords_path, |
| enable_automatic_password_saving) |
| @@ -539,7 +538,7 @@ def RunTest(chrome_path, chromedriver_path, profile_path, |
| else: |
| raise Exception("Test name {} is unknown.".format(website_test_name)) |
| - environment.RunTestsOnSites(test_type) |
| + environment.RunTestsOnSites(test_case_name) |
| environment.Quit() |
| return environment.tests_results |
| @@ -565,29 +564,31 @@ def main(): |
| help="Set the usernames/passwords path (required).", required=True) |
| parser.add_argument("--save-path", action="store", dest="save_path", |
| help="Write the results in a file.") |
| - parser.add_argument("test", help="Test to be run.") |
| parser.add_argument("--save-only-failures", |
| help="Only save logs for failing tests.", |
| dest="save_only_failures", action="store_true", |
| - default=False) |
| - |
| + parser.add_argument("website", help="Website test name on which" |
| + "tests should be run.") |
| + # TODO(melandory): Think about supporting test case specifying on website |
|
vabr (Chromium)
2015/04/13 15:26:20
I'm not sure I understand what you want to think a
melandory
2015/04/14 07:22:36
Hm, actually this todo doesn't belong here. And pr
|
| + # basis. |
| + parser.add_argument("--test-cases-to-run", help="Names of test cases which" |
| + "should be run. Currently supported test cases are:" |
| + "PromptFailTest, PromptSuccessTest, SaveAndAutofillTest", |
| + dest="test_cases_to_run", action="store", nargs="*") |
| args = parser.parse_args() |
| save_path = None |
| if args.save_path: |
| save_path = args.save_path |
| - tests_results = RunTest( |
| - args.chrome_path, args.chromedriver_path, args.profile_path, |
| - args.passwords_path, args.test, WebsiteTest.TEST_TYPE_PROMPT_FAIL) |
| + test_cases_to_run = args.test_cases_to_run or\ |
| + ("PromptFailTest", "PromptSuccessTest", "SaveAndAutofillTest") |
| - tests_results += RunTest( |
| - args.chrome_path, args.chromedriver_path, args.profile_path, |
| - args.passwords_path, args.test, WebsiteTest.TEST_TYPE_PROMPT_SUCCESS) |
| + for test_case in test_cases_to_run: |
| + tests_results = RunTest( |
| + args.chrome_path, args.chromedriver_path, args.profile_path, |
| + args.passwords_path, args.website, test_case) |
| - tests_results += RunTest( |
| - args.chrome_path, args.chromedriver_path, args.profile_path, |
| - args.passwords_path, args.test, WebsiteTest.TEST_TYPE_SAVE_AND_AUTOFILL) |
| SaveResults(tests_results, save_path, |
| save_only_failures=args.save_only_failures) |