Skip to content

[BUG] Debugger fails with pytest #2031

Open
@ManiMozaffar

Description

@ManiMozaffar

System info

  • Playwright Version: [v1.35.0]
  • Operating System: [macOS]
  • Browser: [Firefox]
  • Other info:

Source code

Make a checkpoint in VSCode with pytest debugger, and when running the file, it runs file. but if you want to execute another function (like going to another url) inside the debugger terminal, it'll fail. the debugger will freeze.

import pytest
from playwright.sync_api import async_playwright, Page

@pytest.fixture(scope="function")
def browser():
    with async_playwright() as playwright:
        # Use Firefox as the browser
        browser = playwright.firefox.launch()
        yield browser
        browser.close()

@pytest.mark.asyncio
async def test_playwright_with_firefox(browser):
    page: Page = await browser.new_page()
    await page.goto("https://www.example.com")
    assert "Example Domain" in await page.title()
    await page.close()

Steps

  • Check point somewhere in test
  • Control the page to go to somewhere else manually from command line.

Expected

  • It gets to that URL

[Describe expected behavior]

Actual

[Describe actual behavior]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions