Skip to content

feat(mstest,nunit): add LaunchOptionsAsync override#3321

Merged
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-3315
Jun 4, 2026
Merged

feat(mstest,nunit): add LaunchOptionsAsync override#3321
dgozman merged 1 commit into
microsoft:mainfrom
dgozman:fix-3315

Conversation

@dgozman
Copy link
Copy Markdown
Collaborator

@dgozman dgozman commented Jun 4, 2026

Summary

  • Adds a virtual LaunchOptionsAsync() to the MSTest and NUnit BrowserTest harnesses, letting tests override browser launch options from code (e.g. toggle headed/headless) instead of only via env vars / .runsettings.
  • The override is threaded through BrowserService and takes precedence over PlaywrightSettingsProvider.LaunchOptions when non-null.
  • Mirrors the xUnit.v3 implementation from feat(xunit.v3): add LaunchOptionsAsync override #3304; Playwright.MSTest.v4 picks this up automatically since it compiles the MSTest sources.

Fixes #3315

Allow overriding browser launch options from test code, mirroring the
xUnit.v3 harness. Adds a virtual LaunchOptionsAsync() to BrowserTest and
threads the result through BrowserService so it takes precedence over
PlaywrightSettingsProvider.LaunchOptions when set.

Fixes microsoft#3315
@dgozman dgozman merged commit b47ebb3 into microsoft:main Jun 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Expose CreateBrowser in inheritance to set the LaunchOptions in code

2 participants