Standard pattern for calling browser-specific functions on webdriver?
dhalperi opened this issue · comments
Hi,
We make great use of the chrome_options
and firefox_options
fixtures - they're great.
However, some functionality is only exposed on a specific instance of Webdriver
, e.g., ChromiumDriver#set_network_conditions
Is there a standard place/way to call these functions only when the right type of browser is in use? Obviously we can inspect the current webdriver, pytestconfig, test environment, etc., to determine whether it's a ChromiumDriver
, but since the options are handled so nicely I thought maybe this would be too.
Could you exemplify what you're looking for?
Maybe even in a PR? ;)
There is a standard in flux that deals with the extra capabilities that Chrome provides via the remote DevTools Protocol. When "Webdriver Bidrectional Interface" standard is formalized, there will be a way to test this. 4.0 is in beta and I am waiting until the final release is out to understand how Firefox and Chrome report their CDP capabilities.