Skip to content

feat(junit): replace OptionsFactory with @PlaywrightOptions annotation - #2011

Open
Yury Semikhatsky (yury-s) wants to merge 3 commits into
microsoft:mainfrom
yury-s:fix-1881-annotation
Open

Yury Semikhatsky (yury-s) wants to merge 3 commits into
microsoft:mainfrom
yury-s:fix-1881-annotation

Conversation

@yury-s

@yury-s Yury Semikhatsky (yury-s) commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fixture options are now provided by fields or methods of the test class annotated with @PlaywrightOptions, the way Spring, Micronaut and Testcontainers configure tests. A non-static member is read per test instance, so options can depend on injected fields such as an embedded server's URL.
  • A member can be of type Options, or of type BrowserType.LaunchOptions, Browser.NewContextOptions or APIRequest.NewContextOptions to override just that layer; a @Nested class can override options for its tests.
  • OptionsFactory and UsePlaywright.value() are removed; the API is experimental.
  • Supersedes feat(junit): allow OptionsFactory to access test instance fields #2008.

Fixes #1881

@yury-s

Copy link
Copy Markdown
Member Author

cc uchagani (@uchagani)

This branch has not been deployed

No deployments
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]: OptionsFactory that has access to test instance fields

2 participants