diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 0d2235f2..b7b6ce80 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,26 +1,118 @@ --- -platforms: - ubuntu2204: - build_targets: - - "//..." - test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" - test_targets: - - "//..." - macos: - build_targets: - - "//..." - test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" - test_targets: - - "//..." - windows: - build_flags: - - "--enable_runfiles" - build_targets: - - "//..." - test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" - - "--enable_runfiles" - test_targets: - - "//..." +tasks: + web_testing_go_ubuntu2004: + name: "rules_web_testing_go in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: ["..."] + test_targets: ["..."] + working_directory: web_testing_go + web_testing_go_macos: + name: "rules_web_testing_go in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: ["..." ] + test_targets: [ "..." ] + working_directory: web_testing_go + web_testing_go_windows: + name: "rules_web_testing_go in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_go + web_testing_scala_ubuntu2004: + name: "rules_web_testing_scala in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: ["..."] + test_targets: ["..."] + working_directory: web_testing_scala + web_testing_scala_macos: + name: "rules_web_testing_scala in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_scala + web_testing_scala_windows: + name: "rules_web_testing_scala in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_scala + web_testing_java_ubuntu2004: + name: "rules_web_testing_java in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_java + web_testing_java_macos: + name: "rules_web_testing_java in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_java + web_testing_java_windows: + name: "rules_web_testing_java in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_java + web_testing_python_ubuntu2004: + name: "rules_web_testing_python in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_python + web_testing_python_macos: + name: "rules_web_testing_python in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_python + web_testing_python_windows: + name: "rules_web_testing_python in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] + working_directory: web_testing_python \ No newline at end of file diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 00000000..9dad43df --- /dev/null +++ b/.bazelignore @@ -0,0 +1,4 @@ +web_testing_go +web_testing_java +web_testing_python +web_testing_scala diff --git a/BUILD.bazel b/BUILD.bazel index af1d9d52..ab52bbb1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -15,7 +15,6 @@ ################################################################################ # load("@bazel_gazelle//:def.bzl", "gazelle") -load("@python_versions//3.11:defs.bzl", "compile_pip_requirements") licenses(["notice"]) # Apache 2.0 @@ -25,11 +24,3 @@ gazelle( name = "gazelle", prefix = "github.com/bazelbuild/rules_webtesting", ) - -compile_pip_requirements( - name = "requirements", - requirements_in = "requirements.in", - requirements_txt = "requirements_lock.txt", - requirements_windows = "requirements_lock_windows.txt", -) - diff --git a/MODULE.bazel b/MODULE.bazel index 17754659..ac865778 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -4,80 +4,26 @@ module( ) bazel_dep(name = "bazel_skylib", version = "1.7.1") + bazel_dep(name = "platforms", version = "0.0.10") ##### Go dependencies ##### bazel_dep(name = "rules_go", version = "0.51.0-rc1", repo_name = "io_bazel_rules_go") + bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") + go_deps.from_file(go_mod = "//:go.mod") # All *direct* Go dependencies of the module have to be listed explicitly. -use_repo( - go_deps, - "com_github_gorilla_mux", - "com_github_tebeka_selenium", -) - -##### Java dependencies ##### -bazel_dep(name = "rules_jvm_external", version = "6.6") - -maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") -maven.install( - artifacts = [ - "com.google.guava:guava:33.2.1-jre", - "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", - "org.seleniumhq.selenium:selenium-api:4.27.0", - "junit:junit:4.13.2", - ], -) -use_repo(maven, "maven") - -##### Python dependencies ##### -bazel_dep(name = "rules_python", version = "1.0.0") - -python = use_extension("@rules_python//python/extensions:python.bzl", "python") -python.toolchain( - is_default = True, - python_version = "3.11", -) -use_repo(python, "python_3_11", "python_versions") - -pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") -pip.parse( - hub_name = "rules_webtesting_py_deps", - python_version = "3.11", - requirements_lock = "//:requirements_lock.txt", - requirements_windows = "requirements_lock_windows.txt", -) -use_repo(pip, "rules_webtesting_py_deps") - -##### Scala dependencies ##### -bazel_dep(name = "rules_scala", repo_name = "io_bazel_rules_scala") - -# TODO: Switch to a release version once it's available in BCR. -# Otherwise, the root module has to declare the same override. -git_override( - module_name = "rules_scala", - commit = "219e63983e8e483e66ebf70372969ba227382001", - remote = "https://github.com/mbland/rules_scala", -) - -scala_deps = use_extension( - "@io_bazel_rules_scala//scala/extensions:deps.bzl", - "scala_deps", -) -scala_deps.settings( - fetch_sources = True, -) -scala_deps.toolchains( - scalatest = True, -) +use_repo(go_deps, "com_github_gorilla_mux", "com_github_tebeka_selenium") ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") + browser_repositories.install(version = "0.3.4") + use_repo( browser_repositories, "com_saucelabs_sauce_connect_linux_x64", diff --git a/README.md b/README.md index adf6569c..c0e84d03 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,14 @@ WebDriver. ## Configure your Bazel project -For all languages, you need to add the following to your MODULE.bazel file: +For each language , you need to add the following to your MODULE.bazel file: ```bzl -bazel_dep(name = "rules_webtesting", version = "0.4.0") +bazel_dep(name = "rules_webtesting_${language}", version = "0.4.0") +``` +For example for Java: +```bzl +bazel_dep(name = "rules_webtesting_java", version = "0.4.0") ``` ## Write your tests @@ -77,7 +81,7 @@ import ( "testing" "github.com/tebeka/selenium" - "github.com/bazelbuild/rules_webtesting/go/webtest" + "github.com/bazelbuild/rules_web_testing_go/webtest" ) func TestWebApp(t *testing.T) { @@ -100,7 +104,7 @@ In your BUILD files, load the correct language specific build rule and create a test target using it: ```bzl -load("@rules_webtesting//web:py.bzl", "py_web_test_suite") +load("@rules_web_testing_python//web:py.bzl", "py_web_test_suite") py_web_test_suite( name = "browser_test", diff --git a/browsers/BUILD.bazel b/browsers/BUILD.bazel index f8d5a280..ada9253b 100644 --- a/browsers/BUILD.bazel +++ b/browsers/BUILD.bazel @@ -50,9 +50,6 @@ browser( browser( name = "chromium-local", metadata = "chromium-local.json", - required_tags = [ - "native", - ], deps = [ "//go/wsl", "//third_party/chromedriver", diff --git a/browsers/chromium-local.json b/browsers/chromium-local.json index 7d4e666f..f63148d4 100644 --- a/browsers/chromium-local.json +++ b/browsers/chromium-local.json @@ -7,13 +7,15 @@ "args" : [ "--headless", "--no-sandbox", - "--use-gl=swiftshader-webgl" + "--use-gl=swiftshader-webgl", + "--enable-logging=stderr", + "--v=1" ] }, "google:wslConfig": { "binary": "%FILE:CHROMEDRIVER%", "port":"%WSLPORT:WSL%", - "args": ["--port=%WSLPORT:WSL%"], + "args": ["--port=%WSLPORT:WSL%","--verbose"], "status": true, "shutdown": true } diff --git a/browsers/firefox-local.json b/browsers/firefox-local.json index 849aa1c4..93ad2664 100644 --- a/browsers/firefox-local.json +++ b/browsers/firefox-local.json @@ -12,8 +12,12 @@ "args": [ "--port=%WSLPORT:WSL%", "--host=%WSL:HOST_IP%", - "--marionette-port=%WSLPORT:MARIONETTE%" + "--marionette-port=%WSLPORT:MARIONETTE%", + "-vv" ], + "env": { + "HOME": "%ENV:TEST_TMPDIR%" + }, "status": true, "shutdown": false } diff --git a/go/bazel/BUILD.bazel b/go/bazel/BUILD.bazel index 2df1344b..df42180d 100644 --- a/go/bazel/BUILD.bazel +++ b/go/bazel/BUILD.bazel @@ -22,6 +22,6 @@ go_library( name = "go_default_library", srcs = ["bazel.go"], importpath = "github.com/bazelbuild/rules_webtesting/go/bazel", - visibility = ["//go:__subpackages__"], + visibility = ["//visibility:public"], deps = ["//go/cmdhelper:go_default_library"], ) diff --git a/go/metadata/BUILD.bazel b/go/metadata/BUILD.bazel index 99a5d16b..181da00e 100644 --- a/go/metadata/BUILD.bazel +++ b/go/metadata/BUILD.bazel @@ -25,7 +25,7 @@ go_library( "web_test_files.go", ], importpath = "github.com/bazelbuild/rules_webtesting/go/metadata", - visibility = ["//go:__subpackages__"], + visibility = ["//visibility:public"], deps = [ "//go/bazel:go_default_library", "//go/httphelper:go_default_library", @@ -39,7 +39,7 @@ go_test( "extension_test.go", "metadata_test.go", ], - data = ["//testdata"], + data = ["@rules_webtesting//testdata"], embed = [":go_default_library"], - deps = ["//go/bazel:go_default_library"], + deps = ["@rules_webtesting//go/bazel:go_default_library"], ) diff --git a/go/web/BUILD.bazel b/go/web/BUILD.bazel new file mode 100644 index 00000000..10e32208 --- /dev/null +++ b/go/web/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//go:__subpackages__"], +) + +bzl_library( + name = "go", + srcs = ["go.bzl"], + deps = [ + "@rules_webtesting//web/internal:wrap_web_test_suite", + # should depend on @io_bazel_rules_go//go:def.bzl + ], +) diff --git a/web/go.bzl b/go/web/go.bzl similarity index 87% rename from web/go.bzl rename to go/web/go.bzl index 1168176e..183226b8 100644 --- a/web/go.bzl +++ b/go/web/go.bzl @@ -13,9 +13,9 @@ # limitations under the License. """Web Test rules for Go.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_test") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): """Defines a test_suite of web_test targets that wrap a go_test target. diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index 14c71c9e..ce446db1 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index 7a268cf7..b4b5d474 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index bdea0d24..d6d36f54 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index 66ca5f26..e1e1b0a9 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index dfb2e78e..6908eebe 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/requirements.in b/requirements.in deleted file mode 100644 index 72e055f5..00000000 --- a/requirements.in +++ /dev/null @@ -1 +0,0 @@ -selenium==4.27.1 diff --git a/requirements_lock.txt b/requirements_lock.txt deleted file mode 100644 index 423b3ab0..00000000 --- a/requirements_lock.txt +++ /dev/null @@ -1,71 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# bazel run //:requirements.update -# -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 - # via - # outcome - # trio -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via selenium -h11==0.14.0 \ - --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ - --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 - # via wsproto -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via trio -outcome==1.3.0.post0 \ - --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ - --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b - # via trio -pysocks==1.7.1 \ - --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ - --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ - --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 - # via urllib3 -selenium==4.27.1 \ - --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ - --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 - # via -r requirements.in -sniffio==1.3.1 \ - --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ - --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc - # via trio -sortedcontainers==2.4.0 \ - --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ - --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 - # via trio -trio==0.27.0 \ - --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ - --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 - # via - # selenium - # trio-websocket -trio-websocket==0.11.1 \ - --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ - --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 - # via selenium -typing-extensions==4.12.2 \ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ - --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 - # via selenium -urllib3[socks]==2.2.3 \ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ - --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 - # via selenium -websocket-client==1.8.0 \ - --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ - --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da - # via selenium -wsproto==1.2.0 \ - --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ - --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 - # via trio-websocket diff --git a/requirements_lock_windows.txt b/requirements_lock_windows.txt deleted file mode 100644 index d94eee74..00000000 --- a/requirements_lock_windows.txt +++ /dev/null @@ -1,144 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# bazel run //:requirements.update -# -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 - # via - # outcome - # trio -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via selenium -cffi==1.17.1 \ - --hash=sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8 \ - --hash=sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2 \ - --hash=sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1 \ - --hash=sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15 \ - --hash=sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36 \ - --hash=sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824 \ - --hash=sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8 \ - --hash=sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36 \ - --hash=sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17 \ - --hash=sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf \ - --hash=sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc \ - --hash=sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3 \ - --hash=sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed \ - --hash=sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702 \ - --hash=sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1 \ - --hash=sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8 \ - --hash=sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903 \ - --hash=sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6 \ - --hash=sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d \ - --hash=sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b \ - --hash=sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e \ - --hash=sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be \ - --hash=sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c \ - --hash=sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683 \ - --hash=sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9 \ - --hash=sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c \ - --hash=sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8 \ - --hash=sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1 \ - --hash=sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4 \ - --hash=sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655 \ - --hash=sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67 \ - --hash=sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595 \ - --hash=sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0 \ - --hash=sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65 \ - --hash=sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41 \ - --hash=sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6 \ - --hash=sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401 \ - --hash=sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6 \ - --hash=sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3 \ - --hash=sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16 \ - --hash=sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93 \ - --hash=sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e \ - --hash=sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4 \ - --hash=sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964 \ - --hash=sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c \ - --hash=sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576 \ - --hash=sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0 \ - --hash=sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3 \ - --hash=sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662 \ - --hash=sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3 \ - --hash=sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff \ - --hash=sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5 \ - --hash=sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd \ - --hash=sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f \ - --hash=sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5 \ - --hash=sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14 \ - --hash=sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d \ - --hash=sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9 \ - --hash=sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7 \ - --hash=sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382 \ - --hash=sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a \ - --hash=sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e \ - --hash=sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a \ - --hash=sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4 \ - --hash=sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99 \ - --hash=sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87 \ - --hash=sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b - # via trio -h11==0.14.0 \ - --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ - --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 - # via wsproto -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via trio -outcome==1.3.0.post0 \ - --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ - --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b - # via trio -pycparser==2.22 \ - --hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \ - --hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc - # via cffi -pysocks==1.7.1 \ - --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ - --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ - --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 - # via urllib3 -selenium==4.27.1 \ - --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ - --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 - # via -r requirements.in -sniffio==1.3.1 \ - --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ - --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc - # via trio -sortedcontainers==2.4.0 \ - --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ - --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 - # via trio -trio==0.27.0 \ - --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ - --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 - # via - # selenium - # trio-websocket -trio-websocket==0.11.1 \ - --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ - --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 - # via selenium -typing-extensions==4.12.2 \ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ - --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 - # via selenium -urllib3[socks]==2.2.3 \ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ - --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 - # via selenium -websocket-client==1.8.0 \ - --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ - --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da - # via selenium -wsproto==1.2.0 \ - --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ - --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 - # via trio-websocket diff --git a/setup.sh b/setup.sh new file mode 100755 index 00000000..ec17453b --- /dev/null +++ b/setup.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2025 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Script that can be used by CI server for testing j2cl builds. +set -ex +sudo apt -y update && sudo apt -y install libasound2 +sudo apt -y install libdbus-glib-1-2 +sudo apt -y install libatk-bridge2.0-0 +sudo apt -y install libatk1.0-0 +sudo apt -y install libc6 +sudo apt -y install libcairo2 +sudo apt -y install libcups2 +sudo apt -y install libdbus-1-3 +sudo apt -y install libexpat1 +sudo apt -y install libfontconfig1 +sudo apt -y install libgbm1 +sudo apt -y install libgcc1 +sudo apt -y install libglib2.0-0 +sudo apt -y install libgtk-3-0 +sudo apt -y install libnspr4 +sudo apt -y install libnss3 +sudo apt -y install libpango-1.0-0 +sudo apt -y install libpangocairo-1.0-0 +sudo apt -y install libstdc++6 +sudo apt -y install libx11-6 +sudo apt -y install libx11-xcb1 +sudo apt -y install libxcb1 +sudo apt -y install libxcomposite1 +sudo apt -y install libxcursor1 +sudo apt -y install libxdamage1 +sudo apt -y install libxext6 +sudo apt -y install libxfixes3 +sudo apt -y install libxi6 +sudo apt -y install libxrandr2 +sudo apt -y install libxrender1 +sudo apt -y install libxss1 +sudo apt -y install libxtst6 +sudo apt install libgtk-3-0 \ No newline at end of file diff --git a/testdata/BUILD.bazel b/testdata/BUILD.bazel index cdaac083..4b8a3994 100644 --- a/testdata/BUILD.bazel +++ b/testdata/BUILD.bazel @@ -23,7 +23,7 @@ licenses(["notice"]) # Apache 2.0 filegroup( name = "testdata", srcs = glob(["*"]), - visibility = ["//:__subpackages__"], + visibility = ["//visibility:public"], ) web_test_files( diff --git a/web/BUILD.bazel b/web/BUILD.bazel index 6b5e9ae1..3c2c08ec 100644 --- a/web/BUILD.bazel +++ b/web/BUILD.bazel @@ -29,45 +29,15 @@ web_test_config( visibility = ["//visibility:public"], ) -bzl_library( - name = "go", - srcs = ["go.bzl"], - deps = [ - "//web/internal:wrap_web_test_suite", - # should depend on @io_bazel_rules_go//go:def.bzl - ], -) - -bzl_library( - name = "java", - srcs = ["java.bzl"], - deps = ["//web/internal:wrap_web_test_suite"], -) - -bzl_library( - name = "py", - srcs = ["py.bzl"], - deps = ["//web/internal:wrap_web_test_suite"], -) - -bzl_library( - name = "scala", - srcs = ["scala.bzl"], - deps = [ - "//web/internal:wrap_web_test_suite", - # should depend on @io_bazel_rules_scala//scala:scala.bzl - ], -) - bzl_library( name = "web", srcs = ["web.bzl"], deps = [ "//web/internal:browser", "//web/internal:constants", - "//web/internal:platform_metadata", - "//web/internal:platform_archive", "//web/internal:custom_browser", + "//web/internal:platform_archive", + "//web/internal:platform_metadata", "//web/internal:web_test", "//web/internal:web_test_config", "//web/internal:web_test_files", diff --git a/web/internal/BUILD.bazel b/web/internal/BUILD.bazel index d92ea949..582fef40 100644 --- a/web/internal/BUILD.bazel +++ b/web/internal/BUILD.bazel @@ -18,7 +18,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_testonly = True, - default_visibility = ["//web:__subpackages__"], + default_visibility = ["//visibility:public"], ) licenses(["notice"]) # Apache 2.0 diff --git a/web/versioned/browsers-0.3.4.bzl b/web/versioned/browsers-0.3.4.bzl index 27d2ebc3..28606cf4 100644 --- a/web/versioned/browsers-0.3.4.bzl +++ b/web/versioned/browsers-0.3.4.bzl @@ -174,11 +174,10 @@ def org_mozilla_firefox(): platform_archive( name = "org_mozilla_firefox_linux_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "3d0f74790fe6ff5e38324222ab0c47e10edb31970ed67c6dd7a1c84e7017d1a5", + sha256 = "878a042f49ee34314bde9ca70a0f93c0941c247c72f17b87d904024bef2b27ad", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/97.0/linux-x86_64/en-US/firefox-97.0.tar.bz2", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/linux_x64/browser-bin.tar.bz2", + "https://ftp.mozilla.org/pub/firefox/releases/129.0/linux-x86_64/en-US/firefox-129.0.tar.bz2", ], named_files = { "FIREFOX": "firefox/firefox", @@ -188,11 +187,10 @@ def org_mozilla_firefox(): platform_archive( name = "org_mozilla_firefox_macos_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "c06c4e58179acaf55d05c3be41d0d4cdd68f811a75322a39557d91121aa2ef74", + sha256 = "4b86e9de2b26339b30342a1ef3be1e3914d70921f81fd67bc9c63595823051f1", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/97.0/mac/en-US/Firefox%2097.0.dmg", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/browser-bin.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/129.0/mac/en-US/Firefox%20129.0.dmg", ], named_files = { "FIREFOX": "Firefox.app/Contents/MacOS/firefox", @@ -205,11 +203,10 @@ def org_mozilla_firefox(): # repositories to allow for dedicated ARM/x64 binaries if needed in the future. name = "org_mozilla_firefox_macos_arm64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "c06c4e58179acaf55d05c3be41d0d4cdd68f811a75322a39557d91121aa2ef74", + sha256 = "4b86e9de2b26339b30342a1ef3be1e3914d70921f81fd67bc9c63595823051f1", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/97.0/mac/en-US/Firefox%2097.0.dmg", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/browser-bin.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/129.0/mac/en-US/Firefox%20129.0.dmg", ], named_files = { "FIREFOX": "Firefox.app/Contents/MacOS/firefox", @@ -220,12 +217,9 @@ def org_mozilla_geckodriver(): platform_archive( name = "org_mozilla_geckodriver_linux_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "12c37f41d11ed982b7be43d02411ff2c75fb7a484e46966d000b47d1665baa88", - # Geckodriver v0.30.0 - urls = [ - "https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/linux_x64/driver-bin.tar.gz", - ], + sha256 = "7fdd8007d22a6f44caa6929a3d74bbd6a00984d88be50255153671bd201e5493", + # Geckodriver v0.31.0 + urls = ["https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz"], named_files = { "GECKODRIVER": "geckodriver", }, @@ -234,12 +228,9 @@ def org_mozilla_geckodriver(): platform_archive( name = "org_mozilla_geckodriver_macos_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "560ba192666c1fe8796404153cfdf2d12551515601c4b3937aabcba6ee300f8c", - # Geckodriver v0.30.0 - urls = [ - "https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-macos.tar.gz", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/driver-bin.tar.gz", - ], + sha256 = "4da5c6effe987e0c9049c69c7018e70a9d79f3c6119657def2cc0c3419f885e6", + # Geckodriver v0.31.0 + urls = ["https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-macos.tar.gz"], named_files = { "GECKODRIVER": "geckodriver", }, @@ -248,12 +239,9 @@ def org_mozilla_geckodriver(): platform_archive( name = "org_mozilla_geckodriver_macos_arm64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "895bc2146edaea434d57a3b5d9a141be5cb3c5f8e8804916bd4869978ddfd4db", - # Geckodriver v0.30.0 - urls = [ - "https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-macos-aarch64.tar.gz", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_arm64/driver-bin.tar.gz", - ], + sha256 = "bfd3974b313be378087f4e7bc4c90128e67dc042647181b4c4ac302b1b88de7f", + # Geckodriver v0.31.0 + urls = ["https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-macos-aarch64.tar.gz"], named_files = { "GECKODRIVER": "geckodriver", }, diff --git a/web_testing_go/BUILD.bazel b/web_testing_go/BUILD.bazel new file mode 100644 index 00000000..ab52bbb1 --- /dev/null +++ b/web_testing_go/BUILD.bazel @@ -0,0 +1,26 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_gazelle//:def.bzl", "gazelle") + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +gazelle( + name = "gazelle", + prefix = "github.com/bazelbuild/rules_webtesting", +) diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel new file mode 100644 index 00000000..ef80b9bf --- /dev/null +++ b/web_testing_go/MODULE.bazel @@ -0,0 +1,33 @@ +module( + name = "rules_web_testing_go", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "..", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_go", + version = "0.51.0-rc1", + repo_name = "io_bazel_rules_go", +) + +bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle") + +go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") + +go_deps.from_file(go_mod = "@rules_webtesting//:go.mod") + +# All *direct* Go dependencies of the module have to be listed explicitly. +use_repo(go_deps, "com_github_gorilla_mux", "com_github_tebeka_selenium") \ No newline at end of file diff --git a/web_testing_go/testdata/BUILD b/web_testing_go/testdata/BUILD new file mode 100644 index 00000000..28431762 --- /dev/null +++ b/web_testing_go/testdata/BUILD @@ -0,0 +1,26 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# + +package(default_testonly = True) + +licenses(["notice"]) # Apache 2.0 + +filegroup( + name = "testdata", + srcs = glob(["*"]), + visibility = ["//visibility:public"], +) \ No newline at end of file diff --git a/web_testing_go/testdata/all-fields.json b/web_testing_go/testdata/all-fields.json new file mode 120000 index 00000000..1dd3b8eb --- /dev/null +++ b/web_testing_go/testdata/all-fields.json @@ -0,0 +1 @@ +../../testdata/all-fields.json \ No newline at end of file diff --git a/web_testing_go/web/BUILD.bazel b/web_testing_go/web/BUILD.bazel new file mode 120000 index 00000000..f6298d4c --- /dev/null +++ b/web_testing_go/web/BUILD.bazel @@ -0,0 +1 @@ +../../go/web/BUILD.bazel \ No newline at end of file diff --git a/web_testing_go/web/go.bzl b/web_testing_go/web/go.bzl new file mode 120000 index 00000000..821f7f6d --- /dev/null +++ b/web_testing_go/web/go.bzl @@ -0,0 +1 @@ +../../go/web/go.bzl \ No newline at end of file diff --git a/web_testing_go/webtest/BUILD.bazel b/web_testing_go/webtest/BUILD.bazel new file mode 100644 index 00000000..ce882d9c --- /dev/null +++ b/web_testing_go/webtest/BUILD.bazel @@ -0,0 +1,49 @@ +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +licenses(["notice"]) # Apache 2.0 + +go_library( + name = "go_default_library", + srcs = ["webtest.go"], + importpath = "github.com/bazelbuild/rules_webtesting/web_testing_go/webtest", + visibility = ["//visibility:public"], + deps = [ + "@rules_webtesting//go/bazel:go_default_library", + "@rules_webtesting//go/metadata:go_default_library", + "@com_github_tebeka_selenium//:go_default_library", + ], +) + +go_web_test_suite( + name = "go_default_test", + srcs = [ + "browserinfo_test.go", + "webtest_test.go", + ], + browsers = [ + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", + ], + data = ["//testdata"], + embed = [":go_default_library"], + deps = ["@com_github_tebeka_selenium//:go_default_library"], +) diff --git a/web_testing_go/webtest/browserinfo_test.go b/web_testing_go/webtest/browserinfo_test.go new file mode 120000 index 00000000..22fad2ea --- /dev/null +++ b/web_testing_go/webtest/browserinfo_test.go @@ -0,0 +1 @@ +../../go/webtest/browserinfo_test.go \ No newline at end of file diff --git a/web_testing_go/webtest/webtest.go b/web_testing_go/webtest/webtest.go new file mode 120000 index 00000000..080357e1 --- /dev/null +++ b/web_testing_go/webtest/webtest.go @@ -0,0 +1 @@ +../../go/webtest/webtest.go \ No newline at end of file diff --git a/web_testing_go/webtest/webtest_test.go b/web_testing_go/webtest/webtest_test.go new file mode 120000 index 00000000..acabea0e --- /dev/null +++ b/web_testing_go/webtest/webtest_test.go @@ -0,0 +1 @@ +../../go/webtest/webtest_test.go \ No newline at end of file diff --git a/web_testing_java/BUILD.bazel b/web_testing_java/BUILD.bazel new file mode 100644 index 00000000..e69de29b diff --git a/web_testing_java/MODULE.bazel b/web_testing_java/MODULE.bazel new file mode 100644 index 00000000..8e7f6b39 --- /dev/null +++ b/web_testing_java/MODULE.bazel @@ -0,0 +1,36 @@ +module( + name = "rules_web_testing_java", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "..", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + +maven.install( + artifacts = [ + "com.google.guava:guava:33.2.1-jre", + "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", + "org.seleniumhq.selenium:selenium-api:4.27.0", + "junit:junit:4.13.2", + ], +) + +use_repo(maven, "maven") diff --git a/java/com/google/testing/bazel/BUILD.bazel b/web_testing_java/java/com/google/testing/bazel/BUILD.bazel similarity index 100% rename from java/com/google/testing/bazel/BUILD.bazel rename to web_testing_java/java/com/google/testing/bazel/BUILD.bazel diff --git a/java/com/google/testing/bazel/Bazel.java b/web_testing_java/java/com/google/testing/bazel/Bazel.java similarity index 100% rename from java/com/google/testing/bazel/Bazel.java rename to web_testing_java/java/com/google/testing/bazel/Bazel.java diff --git a/java/com/google/testing/web/BUILD.bazel b/web_testing_java/java/com/google/testing/web/BUILD.bazel similarity index 100% rename from java/com/google/testing/web/BUILD.bazel rename to web_testing_java/java/com/google/testing/web/BUILD.bazel diff --git a/java/com/google/testing/web/WebTest.java b/web_testing_java/java/com/google/testing/web/WebTest.java similarity index 100% rename from java/com/google/testing/web/WebTest.java rename to web_testing_java/java/com/google/testing/web/WebTest.java diff --git a/javatests/com/google/testing/web/BUILD.bazel b/web_testing_java/javatests/com/google/testing/web/BUILD.bazel similarity index 81% rename from javatests/com/google/testing/web/BUILD.bazel rename to web_testing_java/javatests/com/google/testing/web/BUILD.bazel index 7499d4c4..3cddeb79 100644 --- a/javatests/com/google/testing/web/BUILD.bazel +++ b/web_testing_java/javatests/com/google/testing/web/BUILD.bazel @@ -22,10 +22,10 @@ java_web_test_suite( name = "WebTestTest", srcs = ["WebTestTest.java"], browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], deps = [ "//java/com/google/testing/web", diff --git a/javatests/com/google/testing/web/WebTestTest.java b/web_testing_java/javatests/com/google/testing/web/WebTestTest.java similarity index 100% rename from javatests/com/google/testing/web/WebTestTest.java rename to web_testing_java/javatests/com/google/testing/web/WebTestTest.java diff --git a/web_testing_java/web/BUILD.bazel b/web_testing_java/web/BUILD.bazel new file mode 100644 index 00000000..bee0207f --- /dev/null +++ b/web_testing_java/web/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "java", + srcs = ["java.bzl"], + deps = ["@rules_webtesting//web/internal:wrap_web_test_suite"], +) diff --git a/web/java.bzl b/web_testing_java/web/java.bzl similarity index 89% rename from web/java.bzl rename to web_testing_java/web/java.bzl index 359425ad..ecb84912 100644 --- a/web/java.bzl +++ b/web_testing_java/web/java.bzl @@ -13,8 +13,8 @@ # limitations under the License. """Web Test rules for Java.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_class = None, **kwargs): """Defines a test_suite of web_test targets that wrap a java_test target. diff --git a/web_testing_python/BUILD.bazel b/web_testing_python/BUILD.bazel new file mode 100644 index 00000000..b5ad4b8c --- /dev/null +++ b/web_testing_python/BUILD.bazel @@ -0,0 +1,28 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@python_versions//3.11:defs.bzl", "compile_pip_requirements") + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +compile_pip_requirements( + name = "requirements", + requirements_in = "requirements.in", + requirements_txt = "requirements_lock.txt", + requirements_windows = "requirements_lock_windows.txt", +) diff --git a/web_testing_python/MODULE.bazel b/web_testing_python/MODULE.bazel new file mode 100644 index 00000000..28f33dad --- /dev/null +++ b/web_testing_python/MODULE.bazel @@ -0,0 +1,43 @@ +module( + name = "rules_web_testing_python", + version = "0.4.0", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "..", +) + +bazel_dep( + name = "rules_python", + version = "1.0.0", +) + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") + +python.toolchain( + is_default = True, + python_version = "3.11", +) + +use_repo(python, "python_3_11", "python_versions") + +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") + +pip.parse( + hub_name = "rules_webtesting_py_deps", + python_version = "3.11", + requirements_lock = "//:requirements_lock.txt", + requirements_windows = "requirements_lock_windows.txt", +) + +use_repo(pip, "rules_webtesting_py_deps") diff --git a/web_testing_python/requirements.in b/web_testing_python/requirements.in new file mode 100644 index 00000000..600b6ebb --- /dev/null +++ b/web_testing_python/requirements.in @@ -0,0 +1 @@ +selenium==3.141.0 diff --git a/web_testing_python/requirements_lock.txt b/web_testing_python/requirements_lock.txt new file mode 100644 index 00000000..9585b334 --- /dev/null +++ b/web_testing_python/requirements_lock.txt @@ -0,0 +1,14 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# bazel run //:requirements.update +# +selenium==3.141.0 \ + --hash=sha256:2d7131d7bc5a5b99a2d9b04aaf2612c411b03b8ca1b1ee8d3de5845a9be2cb3c \ + --hash=sha256:deaf32b60ad91a4611b98d8002757f29e6f2c2d5fcaf202e1c9ad06d6772300d + # via -r requirements.in +urllib3==2.2.3 \ + --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ + --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 + # via selenium diff --git a/web_testing_python/requirements_lock_windows.txt b/web_testing_python/requirements_lock_windows.txt new file mode 100644 index 00000000..9585b334 --- /dev/null +++ b/web_testing_python/requirements_lock_windows.txt @@ -0,0 +1,14 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# bazel run //:requirements.update +# +selenium==3.141.0 \ + --hash=sha256:2d7131d7bc5a5b99a2d9b04aaf2612c411b03b8ca1b1ee8d3de5845a9be2cb3c \ + --hash=sha256:deaf32b60ad91a4611b98d8002757f29e6f2c2d5fcaf202e1c9ad06d6772300d + # via -r requirements.in +urllib3==2.2.3 \ + --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ + --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 + # via selenium diff --git a/testing/web/BUILD.bazel b/web_testing_python/testing/web/BUILD.bazel similarity index 84% rename from testing/web/BUILD.bazel rename to web_testing_python/testing/web/BUILD.bazel index 6c563197..d14447e8 100644 --- a/testing/web/BUILD.bazel +++ b/web_testing_python/testing/web/BUILD.bazel @@ -35,14 +35,16 @@ py_web_test_suite( name = "webtest_test", srcs = ["webtest_test.py"], browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], tags = { "chromium-local": [ "native", + "sauce", + "notravis", ], "chrome-win10": [ "exclusive", diff --git a/testing/web/debugger/BUILD.bazel b/web_testing_python/testing/web/debugger/BUILD similarity index 100% rename from testing/web/debugger/BUILD.bazel rename to web_testing_python/testing/web/debugger/BUILD diff --git a/testing/web/debugger/debugger.py b/web_testing_python/testing/web/debugger/debugger.py similarity index 100% rename from testing/web/debugger/debugger.py rename to web_testing_python/testing/web/debugger/debugger.py diff --git a/testing/web/webtest.py b/web_testing_python/testing/web/webtest.py similarity index 99% rename from testing/web/webtest.py rename to web_testing_python/testing/web/webtest.py index 5e3fd490..0c1af23a 100644 --- a/testing/web/webtest.py +++ b/web_testing_python/testing/web/webtest.py @@ -1,3 +1,4 @@ + # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/testing/web/webtest_test.py b/web_testing_python/testing/web/webtest_test.py similarity index 100% rename from testing/web/webtest_test.py rename to web_testing_python/testing/web/webtest_test.py diff --git a/web_testing_python/web/BUILD.bazel b/web_testing_python/web/BUILD.bazel new file mode 100644 index 00000000..f17000e8 --- /dev/null +++ b/web_testing_python/web/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "py", + srcs = ["py.bzl"], + deps = ["@rules_webtesting//web/internal:wrap_web_test_suite"], +) diff --git a/web/py.bzl b/web_testing_python/web/py.bzl similarity index 87% rename from web/py.bzl rename to web_testing_python/web/py.bzl index 104e7c41..3a641736 100644 --- a/web/py.bzl +++ b/web_testing_python/web/py.bzl @@ -13,8 +13,8 @@ # limitations under the License. """Web Test rules for Python.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def py_web_test_suite(name, py_test_tags = DEFAULT_WRAPPED_TEST_TAGS, main = None, **kwargs): """Defines a test_suite of web_test targets that wrap a py_test target. diff --git a/web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel new file mode 100644 index 00000000..e9f16d34 --- /dev/null +++ b/web_testing_scala/MODULE.bazel @@ -0,0 +1,74 @@ +module( + name = "rules_web_testing_scala", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "..", +) + +bazel_dep( + name = "rules_web_testing_java", +) + + +local_path_override( + module_name = "rules_web_testing_java", + path = "../web_testing_java", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +##### Scala dependencies ##### +bazel_dep( + name = "rules_scala", + repo_name = "io_bazel_rules_scala", +) + +# TODO: Switch to a release version once it's available in BCR. +# Otherwise, the root module has to declare the same override. +git_override( + module_name = "rules_scala", + commit = "219e63983e8e483e66ebf70372969ba227382001", + remote = "https://github.com/mbland/rules_scala", +) + +scala_deps = use_extension( + "@io_bazel_rules_scala//scala/extensions:deps.bzl", + "scala_deps", +) + +scala_deps.settings( + fetch_sources = True, +) + +scala_deps.toolchains( + scalatest = True, +) + +##### Java dependencies ##### +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + +maven.install( + artifacts = [ + "com.google.guava:guava:33.2.1-jre", + "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", + "org.seleniumhq.selenium:selenium-api:4.27.0", + "junit:junit:4.13.2", + ], +) + +use_repo(maven, "maven") diff --git a/scalatests/com/google/testing/web/BUILD.bazel b/web_testing_scala/scalatests/BUILD.bazel similarity index 76% rename from scalatests/com/google/testing/web/BUILD.bazel rename to web_testing_scala/scalatests/BUILD.bazel index a7b7c5c0..b4cee0d7 100644 --- a/scalatests/com/google/testing/web/BUILD.bazel +++ b/web_testing_scala/scalatests/BUILD.bazel @@ -22,14 +22,14 @@ scala_web_test_suite( name = "WebTestTest", srcs = ["WebTestTest.scala"], browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], deps = [ - "//java/com/google/testing/web", "@maven//:junit_junit", "@maven//:org_seleniumhq_selenium_selenium_api", + "@rules_web_testing_java//java/com/google/testing/web", ], ) diff --git a/scalatests/com/google/testing/web/WebTestTest.scala b/web_testing_scala/scalatests/WebTestTest.scala similarity index 100% rename from scalatests/com/google/testing/web/WebTestTest.scala rename to web_testing_scala/scalatests/WebTestTest.scala diff --git a/web_testing_scala/web/BUILD.bazel b/web_testing_scala/web/BUILD.bazel new file mode 100644 index 00000000..ad48c48b --- /dev/null +++ b/web_testing_scala/web/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2025 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "scala", + srcs = ["scala.bzl"], + deps = [ + "@rules_webtesting//web/internal:wrap_web_test_suite", + # should depend on @io_bazel_rules_scala//scala:scala.bzl + ], +) diff --git a/web/scala.bzl b/web_testing_scala/web/scala.bzl similarity index 87% rename from web/scala.bzl rename to web_testing_scala/web/scala.bzl index 19e2ea27..b78ec7e7 100644 --- a/web/scala.bzl +++ b/web_testing_scala/web/scala.bzl @@ -13,9 +13,9 @@ # limitations under the License. """Web Test rules for Java.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") load("@io_bazel_rules_scala//scala:scala.bzl", "scala_test") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def scala_web_test_suite(name, scala_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): """Defines a test_suite of web_test targets that wrap a java_test target.