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

Unified Diff: components/test/data/password_manager/websitetest.py

Issue 538403003: Automatically wait for elements to be displayed in the password manager python tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « components/test/data/password_manager/tests.py ('k') | 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/websitetest.py
diff --git a/components/test/data/password_manager/websitetest.py b/components/test/data/password_manager/websitetest.py
index cd1e244d1c5ceb010b7fd5abc089b38e4bf6e629..bee10ddba9da8d727b124f6861ac2de21a19c720 100644
--- a/components/test/data/password_manager/websitetest.py
+++ b/components/test/data/password_manager/websitetest.py
@@ -83,6 +83,7 @@ class WebsiteTest:
selector: The element CSS selector.
"""
logging.info("action: Click %s" % selector)
+ self.WaitUntilDisplayed(selector)
element = self.driver.find_element_by_css_selector(selector)
element.click()
@@ -101,6 +102,7 @@ class WebsiteTest:
False otherwise.
"""
logging.info("action: ClickIfVisible %s" % selector)
+ self.WaitUntilDisplayed(selector)
try:
element = self.driver.find_element_by_css_selector(selector)
element.click()
@@ -128,6 +130,7 @@ class WebsiteTest:
selector: The element CSS selector.
"""
logging.info("action: Hover %s" % selector)
+ self.WaitUntilDisplayed(selector)
element = self.driver.find_element_by_css_selector(selector)
hover = ActionChains(self.driver).move_to_element(element)
hover.perform()
@@ -207,7 +210,7 @@ class WebsiteTest:
different than the one we expected.
"""
logging.info("action: FillPasswordInto %s" % selector)
-
+ self.WaitUntilDisplayed(selector)
password_element = self.driver.find_element_by_css_selector(selector)
# Chrome protects the password inputs and doesn't fill them until
# the user interacts with the page. To be sure that such thing has
@@ -245,6 +248,7 @@ class WebsiteTest:
different that the one we expected.
"""
logging.info("action: FillUsernameInto %s" % selector)
+ self.WaitUntilDisplayed(selector)
username_element = self.driver.find_element_by_css_selector(selector)
if (self.mode == self.Mode.AUTOFILLED and not self.username_not_auto):
@@ -263,6 +267,7 @@ class WebsiteTest:
selector: The input CSS selector.
"""
logging.info("action: Submit %s" % selector)
+ self.WaitUntilDisplayed(selector)
element = self.driver.find_element_by_css_selector(selector)
element.submit()
« no previous file with comments | « components/test/data/password_manager/tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698