MinkSelenium2Driver icon indicating copy to clipboard operation
MinkSelenium2Driver copied to clipboard

Unify `browserName` given through different sources

Open aik099 opened this issue 1 year ago • 1 comments

The browser name can be specified through these places:

  • the $browserName driver constructor argument;
  • the $desiredCapabilities['browserName'] key of the desired capabilities (either given upon driver construction or later on).

Both browser names have no relation to each other which can lead to inconsistent driver configuration, e.g. $this->browserName set to the chrome, but in $this->desiredCapabilties['browserName'] set to the firefox.

P.S. Nobody was noticing any bugs, because the \WebDriver\WebDriver::session method (a dependency of this project) has a polyfill code, that does the same thing as this PR.

The above-mentioned polyfill code is removed in 2.x releases of the WebDriver, which allowed us to spot this problem.

aik099 avatar Mar 19 '24 09:03 aik099

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.21%. Comparing base (a3a5370) to head (a6cfcfa).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #390      +/-   ##
============================================
+ Coverage     90.19%   90.21%   +0.02%     
  Complexity      168      168              
============================================
  Files             1        1              
  Lines           469      470       +1     
============================================
+ Hits            423      424       +1     
  Misses           46       46              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 19 '24 10:03 codecov[bot]

Thank you, @stof .

aik099 avatar Jun 28 '24 09:06 aik099