Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
df8b7f3
test remove scala
mollyibot Mar 7, 2025
44f9756
test submodule
mollyibot Mar 7, 2025
f9bc681
test for submodule
mollyibot Mar 8, 2025
cd977d2
Refactor web submodules
mollyibot Mar 15, 2025
e3dbc07
Refactor more
mollyibot Mar 17, 2025
921f528
More polish
mollyibot Mar 17, 2025
1c4c8b6
Fix presubmit
mollyibot Mar 17, 2025
ac5737d
Add web modules build script
mollyibot Mar 17, 2025
e20cb79
Modify bazel CI
mollyibot Mar 17, 2025
1d290c0
More polish to bazel ci
mollyibot Mar 17, 2025
4e64e91
Revert auto formatting
mollyibot Mar 17, 2025
de27d52
More polish
mollyibot Mar 18, 2025
583083d
More polish
mollyibot Mar 18, 2025
b0497da
More polish
mollyibot Mar 18, 2025
74ffa27
More polish
mollyibot Mar 18, 2025
cc04d19
Modularize rules_webtesting
mollyibot Mar 18, 2025
3fd3f78
More polish
mollyibot Mar 18, 2025
7097ef4
More polish
mollyibot Mar 18, 2025
5acecd8
More polish
mollyibot Mar 19, 2025
007f966
Revert formatting
mollyibot Mar 19, 2025
62bbe07
Revert auto formatting
mollyibot Mar 19, 2025
2e6173b
Revert formatting
mollyibot Mar 19, 2025
d5543b3
Create symbol link
mollyibot Mar 19, 2025
f367409
change to relative path
mollyibot Mar 19, 2025
423602e
More polish
mollyibot Mar 19, 2025
db3bfdf
More polish
mollyibot Mar 20, 2025
6aa748f
Change sym link
mollyibot Mar 20, 2025
8a3b252
Modify readme
mollyibot Mar 20, 2025
a2c2afc
Modify ReadMe
mollyibot Mar 21, 2025
24f50e0
test pipeline
mollyibot Mar 22, 2025
afec4d7
Modify
mollyibot Mar 22, 2025
e40d5b5
modify2
mollyibot Mar 22, 2025
e41bad4
remove native tag
mollyibot Mar 29, 2025
2a5af80
enable native tests
mollyibot Mar 29, 2025
3699511
modify tests
mollyibot Mar 31, 2025
94e62f3
disable python chrome test as it is timeout
mollyibot Mar 31, 2025
946581e
test original test without external flag
mollyibot Apr 3, 2025
85907df
Update presubmit yml
mollyibot Apr 3, 2025
1312df5
Remove external and native
mollyibot Apr 3, 2025
ede487a
Update gazelle version
mollyibot Apr 3, 2025
90d393f
update the bazel ci to search for the libco
mollyibot Apr 16, 2025
1ad4a0e
install libxcb1
mollyibot Apr 16, 2025
0b03011
install more dynamic deps
mollyibot Apr 18, 2025
fcb2000
check packages
mollyibot Apr 18, 2025
700ccae
update install script
mollyibot Apr 18, 2025
d724934
intall more packages
mollyibot Apr 18, 2025
832eff7
Update config in macos
mollyibot Apr 22, 2025
70977d5
remove c
mollyibot Apr 22, 2025
82d1ba9
add libdbus-glib-1-2 for firefox
mollyibot Apr 23, 2025
3c566e9
update macos system libs
mollyibot Apr 24, 2025
d8f87a7
degrade python version
mollyibot Apr 24, 2025
688a6a7
Upgrade the webtest apiss
mollyibot Apr 26, 2025
aea2a49
specify version of py
mollyibot Apr 28, 2025
0c597e6
Use firefox browswer
mollyibot Apr 28, 2025
455c4e6
revert yml file
mollyibot Apr 28, 2025
f5f57b5
Test python
mollyibot Apr 28, 2025
400a8c4
Test python
mollyibot Apr 28, 2025
8bff115
Modify presubmit
mollyibot Apr 28, 2025
662a033
Modify requirements_lock_windows.txt
mollyibot Apr 28, 2025
5bd3c1b
Clean up requirements
mollyibot Apr 28, 2025
74acee5
Clean up requirements
mollyibot Apr 28, 2025
9aec5e0
Clean up requirement
mollyibot Apr 29, 2025
8fcab05
Update requirements
mollyibot Apr 29, 2025
15736de
Update requirements
mollyibot Apr 29, 2025
3978c3e
Update requirements
mollyibot Apr 29, 2025
28339d6
clean up requirements
mollyibot Apr 29, 2025
31e9b92
clean up requirements
mollyibot Apr 29, 2025
b82b510
clean up
mollyibot Apr 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
---
platforms:
ubuntu2204:
build_targets:
- "//..."
tasks:
web_testing_python_ubuntu2004:
name: "rules_web_testing_python in ubuntu"
platform: ubuntu2004
shell_commands:
- "sudo apt -y update && sudo apt -y install libxcb1"
test_flags:
- "--test_tag_filters=-noci,-external,-native,-sauce"
test_targets:
- "//..."
macos:
build_targets:
- "//..."
- "--test_tag_filters=-noci,-sauce"
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,-external,-native"
test_targets:
- "//..."
windows:
build_flags:
- "--enable_runfiles"
build_targets:
- "//..."
- "--test_tag_filters=-noci,-sauce"
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,-external,-native"
- "--enable_runfiles"
test_targets:
- "//..."
- "--test_tag_filters=-noci,-sauce"
build_targets: [ "..." ]
test_targets: [ "..." ]
working_directory: web_testing_python
4 changes: 4 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
web_testing_go
web_testing_java
web_testing_python
web_testing_scala
9 changes: 0 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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",
)

66 changes: 6 additions & 60 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions browsers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ browser(
browser(
name = "chromium-local",
metadata = "chromium-local.json",
required_tags = [
"native",
],
deps = [
"//go/wsl",
"//third_party/chromedriver",
Expand Down
2 changes: 1 addition & 1 deletion go/bazel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
6 changes: 3 additions & 3 deletions go/metadata/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"],
)
32 changes: 32 additions & 0 deletions go/web/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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
],
)
4 changes: 2 additions & 2 deletions web/go.bzl → go/web/go.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion go/webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/webtest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/wtl/proxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/wtl/proxy/driverhub/quithandler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion requirements.in

This file was deleted.

2 changes: 1 addition & 1 deletion testdata/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ licenses(["notice"]) # Apache 2.0
filegroup(
name = "testdata",
srcs = glob(["*"]),
visibility = ["//:__subpackages__"],
visibility = ["//visibility:public"],
)

web_test_files(
Expand Down
34 changes: 2 additions & 32 deletions web/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion web/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading