Best Python code snippet using playwright-python
test_navigation.py
Source:test_navigation.py
...145):146 with pytest.raises(Error) as exc_info:147 await page.goto(https_server.EMPTY_PAGE)148 expect_ssl_error(exc_info.value.message, browser_name)149async def test_goto_should_fail_when_navigating_to_bad_ssl_after_redirects(150 page, server, https_server, browser_name151):152 server.set_redirect("/redirect/1.html", "/redirect/2.html")153 server.set_redirect("/redirect/2.html", "/empty.html")154 with pytest.raises(Error) as exc_info:155 await page.goto(https_server.PREFIX + "/redirect/1.html")156 expect_ssl_error(exc_info.value.message, browser_name)157async def test_goto_should_not_crash_when_navigating_to_bad_ssl_after_a_cross_origin_navigation(158 page, server, https_server, browser_name159):160 await page.goto(server.CROSS_PROCESS_PREFIX + "/empty.html")161 with pytest.raises(Error):162 await page.goto(https_server.EMPTY_PAGE)163async def test_goto_should_throw_if_networkidle2_is_passed_as_an_option(page, server):...
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!