You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUnit.Playwright: support a run-level headed switch (HEADED / BROWSER env or CLI option) #7285
TUnit.Playwright has no run-level switch for headed browsers. BrowserFixture.GetLaunchOptions() and BrowserTest use TUnitPlaywrightSettings.Default.DefaultBrowserTypeLaunchOptions ?? new BrowserTypeLaunchOptions() (BrowserFixture.cs:21-22, BrowserTest.cs:8), and nothing in the package reads an environment variable or command-line option for headed mode or browser choice.
So switching between headless CI and a visible local debug session means a code change, or a hand-written policy in every suite. Teams usually end up with something like Headless = !Debugger.IsAttached in a global settings hook. That silently ignores any documented environment switch and launches headless when a developer runs from a terminal.
The Microsoft Playwright .NET test adapters (NUnit and MSTest) honor HEADED=1 and BROWSER=<name> for this reason, so the same dotnet test invocation can run headed locally and headless in CI. Playwright itself also honors PWDEBUG=1, but only when the launch options leave Headless unset.
Proposed change
Read HEADED (and optionally BROWSER) as the default when the user has not set Headless or overridden BrowserName, matching the Microsoft adapters.
Alternatively, or in addition, add a TUnit command-line option such as --playwright-headed.
Document the precedence: explicit BrowserTypeLaunchOptions.Headless wins, then the switch, then Playwright's default.
Document that setting Headless explicitly overrides PWDEBUG=1.
Expected behaviour
HEADED=1 dotnet run --project Tests opens visible browsers for every BrowserTest, PageTest, BrowserFixture and PageFixture consumer with no code change. CI without the variable stays headless.
Activity
fix(playwright): test HEADED/BROWSER launch wiring and correct PWDEBU…
feat(playwright): honor HEADED and BROWSER environment variables (#7285)
fix(playwright): test HEADED/BROWSER launch wiring and correct PWDEBU…
feat(playwright): honor HEADED and BROWSER environment variables (#7395)