csf-dev / CSF.Screenplay

Implementation of the Screenplay pattern (aka Journey) in .NET
https://csf-dev.github.io/CSF.Screenplay/
MIT License
13 stars 1 forks source link

Refactor WebDriverIntegrationBuilderExtensions for SRP #231

Open craigfowler opened 2 weeks ago

craigfowler commented 2 weeks ago

Imported from Selenium issue #62

The file WebDriverIntegrationBuilderExtensions currently exposes a number of mechanisms by which a web driver may be registered to a Screenplay integration. This ticket is to split up some of that functionality so that it may be used piecemeal. The motivation for this change is so that it is easier to write custom scenarios in which parts of that common logic (currently in the file) are desired, but other parts are not.

One example which has been found recently is the desire to have custom requested capabilities injected into the web driver, chosen at runtime. This required copying the existing code into the consuming project, in order to achieve the requirement. Instead, it would have been better if the parts which we did want to reuse were reusable independently, and only a few changes needed to be made to the DI config.