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

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: remove getter, use variable directly. Created 4 years, 1 month 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 | « chrome/test/chromedriver/session_commands.cc ('k') | chrome/test/chromedriver/test/test_expectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f560b5616d5ab12f3693ba9cc8b33ef209bbb72..af4cf9c1e5ea1bf104f9141de46701c56be68669 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -202,6 +202,7 @@ _ANDROID_NEGATIVE_FILTER['chromedriver_webview_shell'] = (
'testHistoryNavigationWithPageLoadTimeout',
# Webview shell doesn't support Alerts.
'ChromeDriverTest.testAlert',
+ 'ChromeDesiredCapabilityTest.testUnexpectedAlertBehaviour',
]
)
@@ -1657,6 +1658,7 @@ class ChromeDownloadDirTest(ChromeDriverBaseTest):
download = prefs['download']
self.assertEqual(download['default_directory'], download_dir)
+
class ChromeSwitchesCapabilityTest(ChromeDriverBaseTest):
"""Tests that chromedriver properly processes chromeOptions.args capabilities.
@@ -1675,6 +1677,21 @@ class ChromeSwitchesCapabilityTest(ChromeDriverBaseTest):
driver.ExecuteScript('return window.domAutomationController'))
+class ChromeDesiredCapabilityTest(ChromeDriverBaseTest):
+ """Tests that chromedriver properly processes desired capabilities."""
+
+ def testUnexpectedAlertBehaviour(self):
+ driver = self.CreateDriver(unexpected_alert_behaviour="accept")
+ self.assertEquals("accept",
+ driver.capabilities['unexpectedAlertBehaviour'])
+ driver.ExecuteScript('alert("HI");')
+ self.WaitForCondition(driver.IsAlertOpen)
+ self.assertRaisesRegexp(chromedriver.UnexpectedAlertOpen,
+ 'unexpected alert open: {Alert text : HI}',
+ driver.FindElement, 'tag name', 'div')
+ self.assertFalse(driver.IsAlertOpen())
+
+
class ChromeExtensionsCapabilityTest(ChromeDriverBaseTest):
"""Tests that chromedriver properly processes chromeOptions.extensions."""
@@ -2185,6 +2202,7 @@ class SessionHandlingTest(ChromeDriverBaseTest):
response = driver2.GetSessions()
self.assertEqual(2, len(response))
+
class RemoteBrowserTest(ChromeDriverBaseTest):
"""Tests for ChromeDriver remote browser capability."""
def setUp(self):
@@ -2220,6 +2238,7 @@ class RemoteBrowserTest(ChromeDriverBaseTest):
return port
raise RuntimeError('Cannot find open port')
+
class PerfTest(ChromeDriverBaseTest):
"""Tests for ChromeDriver perf."""
def setUp(self):
« no previous file with comments | « chrome/test/chromedriver/session_commands.cc ('k') | chrome/test/chromedriver/test/test_expectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698