Unify `browserName` given through different sources
The browser name can be specified through these places:
- the
$browserNamedriver 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.
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.
Thank you, @stof .