File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed
selenium/webdriver/remote Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -1127,6 +1127,11 @@ def _get_cdp_details(self):
11271127 if _firefox :
11281128 # Mozilla Automation Team asked to only support 85
11291129 # until WebDriver Bidi is available.
1130+ warnings .warn (
1131+ "CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi." ,
1132+ DeprecationWarning ,
1133+ stacklevel = 2 ,
1134+ )
11301135 version = 85
11311136 else :
11321137 version = re .search (r".*/(\d+)\." , browser_version ).group (1 )
Original file line number Diff line number Diff line change 2121
2222@pytest .mark .xfail_safari
2323def test_check_console_messages (driver , pages ):
24- devtools , connection = driver .start_devtools ()
24+ with pytest .warns (None ) as record :
25+ devtools , connection = driver .start_devtools ()
2526 console_api_calls = []
2627
28+ if driver .capabilities ["browserName" ] == "firefox" :
29+ assert (
30+ record [0 ].message .args [0 ]
31+ == "CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi."
32+ )
33+ else :
34+ assert len (record ) == 0
35+
2736 connection .execute (devtools .runtime .enable ())
2837 connection .on (devtools .runtime .ConsoleAPICalled , console_api_calls .append )
2938 driver .execute_script ("console.log('I love cheese')" )
Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ def test_log_output_as_filename() -> None:
2727 log_file = "geckodriver.log"
2828 service = Service (log_output = log_file )
2929 try :
30- driver = Firefox (service = service )
30+ with pytest .warns (None ) as record :
31+ driver = Firefox (service = service )
32+ assert len (record ) == 0
3133 with open (log_file ) as fp :
3234 assert "geckodriver\t INFO\t Listening" in fp .readline ()
3335 finally :
Original file line number Diff line number Diff line change 2222
2323@pytest .fixture
2424def driver (options ):
25- driver = webdriver .Remote (options = options )
25+ with pytest .warns (None ) as record :
26+ driver = webdriver .Remote (options = options )
27+ assert len (record ) == 0
2628 yield driver
2729 driver .quit ()
2830
You can’t perform that action at this time.
0 commit comments