File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
py/test/selenium/webdriver/common Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,17 @@ def test_remove_auth_handler(driver):
100100@pytest .mark .xfail_edge (reason = "Data URLs in Network requests are not implemented in Edge yet" )
101101@pytest .mark .xfail_firefox (reason = "Data URLs in Network requests are not implemented in Firefox yet" )
102102def test_handler_with_data_url_request (driver , pages ):
103+ data_requests = []
103104 def callback (request : Request ):
105+ if request .url .startswith ("data:" ):
106+ data_requests .append (request )
104107 request .continue_request ()
105108
106109 driver .network .add_request_handler ("before_request" , callback )
107110 url = pages .url ("data_url.html" )
108111 driver .browsing_context .navigate (context = driver .current_window_handle , url = url , wait = ReadinessState .COMPLETE )
109- driver .find_element (By .ID , "data-url-image" ).is_displayed (), "Request with Data URL failed"
112+
113+ # Assert that the BiDi event was captured.
114+ assert len (data_requests ) > 0
115+ # Assert that the image is displayed.
116+ assert driver .find_element (By .ID , "data-url-image" ).is_displayed ()
You can’t perform that action at this time.
0 commit comments