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
39 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
4111587
check libxcb existence
mollyibot Apr 16, 2025
f581898
install libxcb1
mollyibot Apr 16, 2025
9a4842c
Add more deps
mollyibot Apr 19, 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
160 changes: 135 additions & 25 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,136 @@
---
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:
- "sudo apt -y update && sudo apt -y install libasound2"
- "sudo apt -y update && sudo apt -y install libatk-bridge2.0-0"
- "sudo apt -y update && sudo apt -y install libatk1.0-0"
- "sudo apt -y update && sudo apt -y install libc6"
- "sudo apt -y update && sudo apt -y install libcairo2"
- "sudo apt -y update && sudo apt -y install libcups2"
- "sudo apt -y update && sudo apt -y install libdbus-1-3"
- "sudo apt -y update && sudo apt -y install libexpat1"
- "sudo apt -y update && sudo apt -y install libfontconfig1"
- "sudo apt -y update && sudo apt -y install libgbm1"
- "sudo apt -y update && sudo apt -y install libgcc1"
- "sudo apt -y update && sudo apt -y install libglib2.0-0"
- "sudo apt -y update && sudo apt -y install libgtk-3-0"
- "sudo apt -y update && sudo apt -y install libnspr4"
- "sudo apt -y update && sudo apt -y install libnss3"
- "sudo apt -y update && sudo apt -y install libpango-1.0-0"
- "sudo apt -y update && sudo apt -y install libpangocairo-1.0-0"
- "sudo apt -y update && sudo apt -y install libstdc++6"
- "sudo apt -y update && sudo apt -y install libx11-6"
- "sudo apt -y update && sudo apt -y install libx11-xcb1"
- "sudo apt -y update && sudo apt -y install libxcb1"
- "sudo apt -y update && sudo apt -y install libxcomposite1"
- "sudo apt -y update && sudo apt -y install libxcursor1"
- "sudo apt -y update && sudo apt -y install libxdamage1"
- "sudo apt -y update && sudo apt -y install libxext6"
- "sudo apt -y update && sudo apt -y install libxfixes3"
- "sudo apt -y update && sudo apt -y install libxi6"
- "sudo apt -y update && sudo apt -y install libxrandr2"
- "sudo apt -y update && sudo apt -y install libxrender1"
- "sudo apt -y update && sudo apt -y install libxss1"
- "sudo apt -y update && sudo apt -y install libxtst6"
test_flags:
- "--test_tag_filters=-noci,-sauce"
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"
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"
build_targets: [ "..." ]
test_targets: [ "..." ]
working_directory: web_testing_go
web_testing_scala_ubuntu2004:
name: "rules_web_testing_scala in ubuntu"
platform: ubuntu2004
shell_commands:
- "sudo apt -y update && sudo apt -y install libxcb1"
test_flags:
- "--test_tag_filters=-noci,-sauce"
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"
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"
build_targets: [ "..." ]
test_targets: [ "..." ]
working_directory: web_testing_scala
web_testing_java_ubuntu2004:
name: "rules_web_testing_java in ubuntu"
platform: ubuntu2004
shell_commands:
- "sudo apt -y update && sudo apt -y install libxcb1"
test_flags:
- "--test_tag_filters=-noci,-sauce"
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"
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"
build_targets: [ "..." ]
test_targets: [ "..." ]
working_directory: web_testing_java
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,-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"
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"
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
Loading