Skip to content

Playwright starts browser in headed mode when called from VS Code Debugger - even on headless server #122

@pearzt

Description

@pearzt

The current implementation starts the browser in headed mode automatically, if pytest is invoked from VS Code's debugger.

elif VSCODE_PYTHON_EXTENSION_ID in sys.argv[0] and _is_debugger_attached():
# When the VSCode debugger is attached, then launch the browser headed by default
launch_options["headless"] = False

While I get the idea behind this, it does not take remote development on a headless server into account. If $DISPLAY is not set, the test run naturally fails and leaves the user wondering why this happens because he did not provide --headed (e.g. in VS Code's python.testing.pytestArgs configuration). IMHO, the implementation should be changed to check for $DISPLAY at least.

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