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

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

Issue 891283002: [Password manager tests] Enable "Offer to save password" via webriver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | no next file » | 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 a8b5f9d03321a2d998dac41c2d1366da7c0c2fee..86685b30057499ffd314ea4d28b654d27cb0a4fa 100644
--- a/components/test/data/password_manager/automated_tests/environment.py
+++ b/components/test/data/password_manager/automated_tests/environment.py
@@ -189,6 +189,24 @@ class Environment:
script += "document.querySelector('#clear-browser-data-commit').click();"
self.driver.execute_script(script)
time.sleep(2)
+ # Every time we do something to the cache let's enable password saving.
+ # TODO(melandory): We should check why it's off in a first place.
+ # TODO(melandory): Investigate, maybe there is no need to enable it that
+ # often.
+ self.EnablePasswordsSaving()
+
+ def EnablePasswordsSaving(self):
+ logging.info("\nEnablePasswordSaving\n")
+ self.driver.get("chrome://settings")
+ self.driver.switch_to_frame("settings")
+ script = "document.getElementById('advanced-settings-expander').click();"
+ self.driver.execute_script(script)
+ time.sleep(2)
+ script = (
+ "if (!document.querySelector('#password-manager-enabled').checked)"
+ "{ document.querySelector('#password-manager-enabled').click();}")
+ self.driver.execute_script(script)
+ time.sleep(2)
def OpenTabAndGoToInternals(self, url):
"""If there is no |self.website_window|, opens a new tab and navigates to
@@ -375,8 +393,9 @@ class Environment:
self.ClearCache(True)
except Exception as e:
successful = False
+ error = e.message
self.tests_results.append(TestResult(websitetest.name, "normal",
- successful, e.message))
+ successful, error))
def PromptTestList(self, websitetests):
@@ -398,8 +417,9 @@ class Environment:
websitetest.PromptTest()
except Exception as e:
successful = False
+ error = e.message
self.tests_results.append(TestResult(websitetest.name, "prompt",
- successful, e.message))
+ successful, error))
def Quit(self):
"""Closes the tests."""
« 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