Skip to content

Commit 5bf0aab

Browse files
authored
[py] Fix test args for --headless and --bidi (#15567)
* [py] Fix test args for --headless and --bidi * [py] Call headless correctly from bazel
1 parent 9ff7d7c commit 5bf0aab

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

py/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,6 @@ BIDI_TESTS = glob(["test/selenium/webdriver/common/**/*bidi*_tests.py"])
405405
),
406406
args = [
407407
"--instafail",
408-
"--bidi=false",
409408
] + BROWSERS[browser]["args"],
410409
data = BROWSERS[browser]["data"],
411410
env_inherit = ["DISPLAY"],
@@ -432,7 +431,7 @@ BIDI_TESTS = glob(["test/selenium/webdriver/common/**/*bidi*_tests.py"])
432431
),
433432
args = [
434433
"--instafail",
435-
"--bidi=true",
434+
"--bidi",
436435
] + BROWSERS[browser]["args"],
437436
data = BROWSERS[browser]["data"],
438437
env_inherit = ["DISPLAY"],
@@ -480,7 +479,7 @@ py_test_suite(
480479
),
481480
args = [
482481
"--instafail",
483-
"--headless=true",
482+
"--headless",
484483
] + BROWSERS["chrome"]["args"],
485484
data = BROWSERS["chrome"]["data"],
486485
env_inherit = ["DISPLAY"],

py/conftest.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,43 @@ def pytest_addoption(parser):
4747
choices=drivers,
4848
dest="drivers",
4949
metavar="DRIVER",
50-
help="driver to run tests against ({})".format(", ".join(drivers)),
50+
help="Driver to run tests against ({})".format(", ".join(drivers)),
5151
)
5252
parser.addoption(
5353
"--browser-binary",
5454
action="store",
5555
dest="binary",
56-
help="location of the browser binary",
56+
help="Location of the browser binary",
5757
)
5858
parser.addoption(
5959
"--driver-binary",
6060
action="store",
6161
dest="executable",
62-
help="location of the service executable binary",
62+
help="Location of the service executable binary",
6363
)
6464
parser.addoption(
6565
"--browser-args",
6666
action="store",
6767
dest="args",
68-
help="arguments to start the browser with",
68+
help="Arguments to start the browser with",
6969
)
7070
parser.addoption(
7171
"--headless",
72-
action="store",
72+
action="store_true",
7373
dest="headless",
74-
help="Allow tests to run in headless",
74+
help="Run tests in headless mode",
7575
)
7676
parser.addoption(
7777
"--use-lan-ip",
7878
action="store_true",
7979
dest="use_lan_ip",
80-
help="Whether to start test server with lan ip instead of localhost",
80+
help="Start test server with lan ip instead of localhost",
8181
)
8282
parser.addoption(
8383
"--bidi",
84-
action="store",
84+
action="store_true",
8585
dest="bidi",
86-
metavar="BIDI",
87-
help="Whether to enable BiDi support",
86+
help="Enable BiDi support",
8887
)
8988

9089

@@ -179,7 +178,7 @@ def fin():
179178
# and doesn't seems to be stable enough, causing the flakiness of the
180179
# subsequent tests.
181180
# Remove this when BiDi implementation and API is stable.
182-
if bool(request.config.option.bidi):
181+
if request.config.option.bidi:
183182

184183
def fin():
185184
global driver_instance
@@ -196,8 +195,8 @@ def fin():
196195
def get_options(driver_class, config):
197196
browser_path = config.option.binary
198197
browser_args = config.option.args
199-
headless = bool(config.option.headless)
200-
bidi = bool(config.option.bidi)
198+
headless = config.option.headless
199+
bidi = config.option.bidi
201200
options = None
202201

203202
if browser_path or browser_args:

0 commit comments

Comments
 (0)