Best Python code snippet using playwright-python
test_popup.py
Source:test_popup.py
...285 # Chromium reports 'about:blank#blocked' here.286 assert popup.url.split("#")[0] == "about:blank"287 assert await page.evaluate("!!window.opener") is False288 assert await popup.evaluate("!!window.opener") is False289async def test_should_work_with_noopener_and_about_blank(context):290 page = await context.new_page()291 async with page.expect_popup() as popup_info:292 await page.evaluate(293 '() => window.__popup = window.open("about:blank", null, "noopener")'294 )295 popup = await popup_info.value296 assert await page.evaluate("!!window.opener") is False297 assert await popup.evaluate("!!window.opener") is False298async def test_should_work_with_noopener_and_url(context, server):299 page = await context.new_page()300 await page.goto(server.EMPTY_PAGE)301 async with page.expect_popup() as popup_info:302 await page.evaluate(303 'url => window.__popup = window.open(url, null, "noopener")',...
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!!