Best Python code snippet using playwright-python
test_navigation.py
Source:test_navigation.py
...309 assert request1.getHeader("referer") == "http://google.com/"310 # Make sure subresources do not inherit referer.311 assert request2.getHeader("referer") == server.PREFIX + "/grid.html"312 assert page.url == server.PREFIX + "/grid.html"313async def test_goto_should_reject_referer_option_when_set_extra_http_headers_provides_referer(314 page, server315):316 await page.set_extra_http_headers({"referer": "http://microsoft.com/"})317 with pytest.raises(Error) as exc_info:318 await page.goto(server.PREFIX + "/grid.html", referer="http://google.com/")319 assert (320 '"referer" is already specified as extra HTTP header' in exc_info.value.message321 )322 assert server.PREFIX + "/grid.html" in exc_info.value.message323async def test_network_idle_should_navigate_to_empty_page_with_networkidle(324 page, server325):326 response = await page.goto(server.EMPTY_PAGE, wait_until="networkidle")327 assert response.status == 200...
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!!