MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / headless

Function headless

py/conftest.py:649–656  ·  view source on GitHub ↗

Whether the browser under test was started headless. Without a window manager some behavior is not modelled at all - notably window focus, which headless Chromium reports as always held by the current window - so tests that assert on it need to know which mode they are running in.

(request)

Source from the content-addressed store, hash-verified

647
648@pytest.fixture
649def headless(request):
650 """Whether the browser under test was started headless.
651
652 Without a window manager some behavior is not modelled at all - notably window
653 focus, which headless Chromium reports as always held by the current window - so
654 tests that assert on it need to know which mode they are running in.
655 """
656 return bool(request.config.option.headless)
657
658
659@pytest.fixture(autouse=True, scope="session")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected