Skip to content

[dotnet] [test] Entry point to mutate driver options per fixture - #18141

Merged
nvborisenko merged 2 commits into
SeleniumHQ:trunkfrom
nvborisenko:dotnet-configure-options-per-fixture
Oct 8, 2026
Merged

nvborisenko merged 2 commits into
SeleniumHQ:trunkfrom
nvborisenko:dotnet-configure-options-per-fixture

Conversation

@nvborisenko

@nvborisenko nvborisenko commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Avoid global driver options. Now any test fixture is able to customize it.

🔗 Related Issues

Improve internal testing.

💥 What does this PR do?

This pull request refactors how driver options are configured and passed throughout the test framework, replacing event-based customization with explicit configuration via delegates. It removes the DriverStartingEventArgs class and related event, and introduces a new ConfigureDriverOptions virtual method pattern for greater flexibility and clarity. Several test fixtures are updated to use this new pattern, simplifying driver setup and making option customization more consistent.

Driver customization refactor:

  • Removed the DriverStartingEventArgs class and the DriverStarting event from DriverFactory, eliminating the event-based driver customization mechanism. [1] [2]
  • Updated DriverFactory.CreateDriver to accept a configureOptions delegate, which is invoked to customize DriverOptions before driver creation. [1] [2]
  • Refactored test fixtures (e.g., DriverTestFixture, BiDiTestFixture, DownloadsTests, ProxySettingTests) to override or use the new ConfigureDriverOptions method for driver option customization, replacing previous event handler or custom options class patterns. [1] [2] [3] [4]

Test code simplification and cleanup:

  • Removed custom driver options classes (BiDiEnabledDriverOptions, DownloadableFilesOptions) and replaced them with direct configuration via the new delegate pattern. [1] [2]
  • Simplified logging configuration in tests by passing a delegate to CreateDriverInstance instead of instantiating specific options classes.

Test-specific driver configuration improvements:

  • Centralized and clarified browser-specific option settings (e.g., Chromium arguments, download enabling, IE session cleanup) in the relevant test fixtures by overriding ConfigureDriverOptions. [1] [2] [3]

These changes improve maintainability and extensibility by making driver option customization more explicit and less reliant on events or custom types.

🤖 AI assistance

  • No substantial AI assistance used
  • AI assisted (complete below)
    • Tool(s):
    • What was generated:
    • I reviewed all AI output and can explain the change

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@selenium-ci selenium-ci added the C-dotnet .NET Bindings label Oct 8, 2026
@nvborisenko
nvborisenko merged commit 5b02cef into SeleniumHQ:trunk Oct 8, 2026
27 checks passed
@nvborisenko
nvborisenko deleted the dotnet-configure-options-per-fixture branch October 8, 2026 19:03
This was referenced Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-dotnet .NET Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants