From ba572a43f07505967a023a1afd7339b887442fd9 Mon Sep 17 00:00:00 2001 From: Navin Chandra Date: Mon, 25 Aug 2025 10:59:56 +0530 Subject: [PATCH] use bidi method to navigate and switch to `postman-echo` --- .../webdriver/common/bidi_network_tests.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/py/test/selenium/webdriver/common/bidi_network_tests.py b/py/test/selenium/webdriver/common/bidi_network_tests.py index 5fc168a36503a..d1a58c507e340 100644 --- a/py/test/selenium/webdriver/common/bidi_network_tests.py +++ b/py/test/selenium/webdriver/common/bidi_network_tests.py @@ -15,8 +15,8 @@ # specific language governing permissions and limitations # under the License. -import pytest +from selenium.webdriver.common.bidi.browsing_context import ReadinessState from selenium.webdriver.common.bidi.network import Request from selenium.webdriver.common.by import By @@ -68,29 +68,26 @@ def callback(request: Request): assert driver.find_element(By.NAME, "login").is_displayed(), "Request not continued" -@pytest.mark.xfail_chrome -@pytest.mark.xfail_edge def test_continue_request(driver, pages): def callback(request: Request): request.continue_request() callback_id = driver.network.add_request_handler("before_request", callback) assert callback_id is not None, "Request handler not added" - pages.load("formPage.html") + url = pages.url("formPage.html") + driver.browsing_context.navigate(context=driver.current_window_handle, url=url, wait=ReadinessState.COMPLETE) assert driver.find_element(By.NAME, "login").is_displayed(), "Request not continued" -@pytest.mark.xfail_chrome -@pytest.mark.xfail_edge def test_continue_with_auth(driver): - callback_id = driver.network.add_auth_handler("user", "passwd") + callback_id = driver.network.add_auth_handler("postman", "password") assert callback_id is not None, "Request handler not added" - driver.get("https://httpbin.org/basic-auth/user/passwd") + driver.browsing_context.navigate( + context=driver.current_window_handle, url="https://postman-echo.com/basic-auth", wait=ReadinessState.COMPLETE + ) assert "authenticated" in driver.page_source, "Authorization failed" -@pytest.mark.xfail_chrome -@pytest.mark.xfail_edge def test_remove_auth_handler(driver): callback_id = driver.network.add_auth_handler("user", "passwd") assert callback_id is not None, "Request handler not added"