Skip to content

Commit 34adf3e

Browse files
committed
[py] use Selenium Manager in tests with bazel when pinned browsers not set
This can be overridden by specifying --driver-binary in addopts in pytest.ini
1 parent d77b568 commit 34adf3e

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

py/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def pytest_ignore_collect(path, config):
9898
def driver(request):
9999
kwargs = {}
100100

101-
# browser can be changed with `--driver=firefox` as an argument or in pytest.ini
102-
driver_class = request.param.capitalize() if request.param else "Chrome"
101+
# browser can be changed with `--driver=firefox` as an argument or to addopts in pytest.ini
102+
driver_class = getattr(request, 'param', 'Chrome').capitalize()
103103

104104
# skip tests if not available on the platform
105105
_platform = platform.system()

py/private/browsers.bzl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ chrome_args = select({
2424
"--driver-binary=$(location @mac_chromedriver//:chromedriver)",
2525
"--browser-binary=$(location @mac_chrome//:Chrome.app)/Contents/MacOS/Chrome",
2626
],
27-
"@selenium//common:use_local_chromedriver": [
28-
"--driver-binary=$(location @selenium//common:chromedriver)",
29-
],
3027
"//conditions:default": [],
3128
}) + headless_args
3229

@@ -35,9 +32,6 @@ edge_args = select({
3532
"--driver-binary=$(location @mac_edgedriver//:msedgedriver)",
3633
"--browser-binary='$(location @mac_edge//:Edge.app)/Contents/MacOS/Microsoft Edge'",
3734
],
38-
"@selenium//common:use_local_msedgedriver": [
39-
"--driver-binary=$(location @selenium//common:msedgedriver)",
40-
],
4135
"//conditions:default": [],
4236
}) + headless_args
4337

@@ -50,9 +44,6 @@ firefox_args = select({
5044
"--driver-binary=$(location @mac_geckodriver//:geckodriver)",
5145
"--browser-binary=$(location @mac_firefox//:Firefox.app)/Contents/MacOS/firefox",
5246
],
53-
"@selenium//common:use_local_geckodriver": [
54-
"--driver-binary=$(location @selenium//common:geckodriver)",
55-
],
5647
"//conditions:default": [],
5748
}) + headless_args
5849

0 commit comments

Comments
 (0)