Skip to content

Commit

Permalink
[py] Generate Bazel test targets for BiDi
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Jun 8, 2024
1 parent 5a7cbee commit 851a2a6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
46 changes: 39 additions & 7 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ py_package(
"py.selenium.webdriver.chrome",
"py.selenium.webdriver.chromium",
"py.selenium.webdriver.common",
"py.selenium.webdriver.common.bidi",
"py.selenium.webdriver.common.devtools",
"py.selenium.webdriver.edge",
"py.selenium.webdriver.firefox",
Expand Down Expand Up @@ -358,10 +359,39 @@ py_library(
deps = [],
)

BIDI_TESTS = glob(["test/selenium/webdriver/common/**/*bidi*_tests.py"])

[
py_test_suite(
name = "common-%s" % browser,
size = "large",
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/support/**/*.py",
],
exclude = BIDI_TESTS + ["test/selenium/webdriver/common/print_pdf_tests.py"],
),
args = [
"--instafail",
"--bidi=false",
] + BROWSERS[browser]["args"],
data = BROWSERS[browser]["data"],
env_inherit = ["DISPLAY"],
tags = ["no-sandbox"] + BROWSERS[browser]["tags"],
deps = [
":init-tree",
":selenium",
":webserver",
] + TEST_DEPS,
)
for browser in BROWSERS.keys()
]

[
py_test_suite(
name = "common-%s-bidi" % browser,
size = "large",
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
Expand All @@ -371,12 +401,11 @@ py_library(
),
args = [
"--instafail",
"--bidi=true",
] + BROWSERS[browser]["args"],
data = BROWSERS[browser]["data"],
env_inherit = ["DISPLAY"],
tags = [
"no-sandbox",
] + BROWSERS[browser]["tags"],
tags = ["no-sandbox"] + BROWSERS[browser]["tags"],
deps = [
":init-tree",
":selenium",
Expand Down Expand Up @@ -482,10 +511,13 @@ py_test_suite(
py_test_suite(
name = "test-remote",
size = "large",
srcs = glob([
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/support/**/*.py",
]),
srcs = glob(
[
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/support/**/*.py",
],
exclude = BIDI_TESTS,
),
args = [
"--instafail",
"--driver=remote",
Expand Down
1 change: 0 additions & 1 deletion py/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def pytest_addoption(parser):
action="store",
dest="bidi",
metavar="BIDI",
default=True,
help="Whether to enable BiDi support",
)

Expand Down

0 comments on commit 851a2a6

Please sign in to comment.