Commit 26817cbe authored by Tatiana Buldina's avatar Tatiana Buldina Committed by Commit Bot

[ChromeDriver] Fix flaky test testCanClickOOPIF

Bug: chromedriver:2198
Change-Id: I8e13ec3b88dd7018cb4650fc0ce52d4feb4aed07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1793944Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Commit-Queue: Tatiana Buldina <buldina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695210}
parent e3024b5c
...@@ -2959,11 +2959,19 @@ class ChromeDriverSiteIsolation(ChromeDriverBaseTestWithWebServer): ...@@ -2959,11 +2959,19 @@ class ChromeDriverSiteIsolation(ChromeDriverBaseTestWithWebServer):
self._driver.SetTimeouts({'implicit': 2000}) self._driver.SetTimeouts({'implicit': 2000})
self._driver.Load(self.GetHttpUrlForFile( self._driver.Load(self.GetHttpUrlForFile(
'/chromedriver/cross_domain_iframe.html')) '/chromedriver/cross_domain_iframe.html'))
frame = self._driver.FindElement('tag name', 'iframe')
self._driver.SwitchToFrame(frame)
self.assertTrue(self.WaitForCondition(
lambda: 'outer.html' in
self._driver.ExecuteScript('return window.location.href')))
self.assertTrue(self.WaitForCondition(
lambda: 'complete' ==
self._driver.ExecuteScript('return document.readyState')))
self._driver.SwitchToMainFrame()
a_outer = self._driver.FindElement('tag name', 'a') a_outer = self._driver.FindElement('tag name', 'a')
a_outer.Click() a_outer.Click()
frame_url = self._driver.ExecuteScript('return window.location.href') frame_url = self._driver.ExecuteScript('return window.location.href')
self.assertTrue(frame_url.endswith('#one')) self.assertTrue(frame_url.endswith('#one'))
frame = self._driver.FindElement('tag name', 'iframe')
self._driver.SwitchToFrame(frame) self._driver.SwitchToFrame(frame)
a_inner = self._driver.FindElement('tag name', 'a') a_inner = self._driver.FindElement('tag name', 'a')
a_inner.Click() a_inner.Click()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment