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

Unified Diff: chrome/test/chromedriver/test/run_py_tests.py

Issue 1827003004: [Chromedriver] Chromedriver should handle unexpected alert automatically. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: chrome/test/chromedriver/test/run_py_tests.py
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py
index b29ef73880296f9fcd954b74623d4ccfea73ca38..db05eb1c16081de3e4e5d20db69b42d1e6043f28 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -714,6 +714,15 @@ class ChromeDriverTest(ChromeDriverBaseTest):
self.assertEquals(False,
self._driver.ExecuteScript('return window.confirmed'))
+ def testShouldAcceptUnhandledAlertAutomatically(self):
+ url = self.GetHttpUrlForFile('/chromedriver/empty.html')
+ self._driver.Load(url)
+ self._driver.ExecuteScript('window.alert("Hi");')
+ self.assertTrue(self._driver.IsAlertOpen())
+ self.assertRaises(chromedriver.UnexpectedAlertOpen,
+ self._driver.GetCurrentUrl)
+ self.assertEquals(url, self._driver.GetCurrentUrl())
+
def testShouldHandleNewWindowLoadingProperly(self):
"""Tests that ChromeDriver determines loading correctly for new windows."""
self._http_server.SetDataForPath(
« no previous file with comments | « no previous file | chrome/test/chromedriver/window_commands.cc » ('j') | chrome/test/chromedriver/window_commands.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698