-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable setting of selenium runner capabilities #118
Comments
Thanks for opening the issue, @joemarshall! I agree that we need some way to provide custom options for browsers.
This is actually not a recommended official usage by any means, and is only used to change flags in Pyodide hackily. We need a more robust and better way to handle this. Currently, the What I can think of is:
For example, In pytest-pyodide: @contextlib.contextmanager
def build_selenium_fixture(runner):
runner.clean_logs(...)
runner.set_script_timeout(...)
try:
yield runner
finally:
runner.quit() Then users can do something like: from pytest_pyodide.runner import SeleniumChromeRunner
class MyChromeRunner(SeleniumChromeRunner):
def get_driver(): # override
return Chrome(options=my_custom_options)
@pytest.fixture
def selnium_my_custom_chrome():
from pytest_pyodide import build_selenium_fixture
chrome_runner = MyChromeRunner(...)
selenium = build_selenium_fixture(chrome_runner)
try:
yield selenium
finally:
selenium.close() |
@ryanking13 Nice idea. In addition to this - I'd like to have the ability to use the node runner with extra packages required (I need to require('xmlhttprequest') in the test runner for urllib3, so I want to subclass that also. |
Selenium runners take a desired capabilities option, which allows you to do things like turn off https verification of certificates.
I can see we have access to Options, so I can do e.g.
pytest_pyodide.runner.CHROME_FLAGS.append("ignore-certificate-errors")
for chrome, but if I want to do it for all browsers, I need a capability, which is set like below. Could we have a capability setter in there also, similar to CHROME_FLAGS etc.https://stackoverflow.com/questions/24507078/how-to-deal-with-certificates-using-selenium
The text was updated successfully, but these errors were encountered: