Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .bazelrc.remote
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ test:rbe --test_env=HOME=/home/dev
# Make sure we sniff credentials properly
build:rbe --credential_helper=gypsum.cluster.engflow.com=%workspace%/scripts/credential-helper.sh

# Use pinned browsers when running remotely
build:rbe --//common:pin_browsers

# The remote build machines are pretty small, and 50 threads may leave them
# thrashing, but our dev machines are a lot larger. Scale the workload so we
# make reasonable usage of everything, everywhere, all at once.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
os: windows
run: |
fsutil 8dot3name set 0
bazel test //dotnet/test/common:ElementFindingTest-firefox //dotnet/test/common:ElementFindingTest-chrome --pin_browsers=true
bazel test //dotnet/test/common:ElementFindingTest-firefox //dotnet/test/common:ElementFindingTest-chrome
6 changes: 3 additions & 3 deletions .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
java-version: 17
run: |
fsutil 8dot3name set 0
bazel test --flaky_test_attempts 3 --pin_browsers=true //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest `
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest `
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest `
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest `
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest `
Expand All @@ -48,7 +48,7 @@ jobs:
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 --pin_browsers=true //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote \
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote \
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest \
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest \
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest \
Expand All @@ -72,4 +72,4 @@ jobs:
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 --pin_browsers=true //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
6 changes: 3 additions & 3 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
os: ${{ matrix.os }}
cache-key: py-browser-${{ matrix.browser }}
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 --pin_browsers=true //py:common-${{ matrix.browser }}-bidi //py:test-${{ matrix.browser }}
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:common-${{ matrix.browser }}-bidi //py:test-${{ matrix.browser }}
browser-tests-windows:
name: Browser Tests
Expand All @@ -135,7 +135,7 @@ jobs:
cache-key: py-browser-${{ matrix.browser }}
run: |
fsutil 8dot3name set 0
bazel test --local_test_jobs 1 --flaky_test_attempts 3 --pin_browsers=true //py:common-${{ matrix.browser }}-bidi //py:test-${{ matrix.browser }}
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:common-${{ matrix.browser }}-bidi //py:test-${{ matrix.browser }}
browser-tests-macos:
name: Browser Tests
Expand All @@ -153,4 +153,4 @@ jobs:
os: ${{ matrix.os }}
cache-key: py-browser-${{ matrix.browser }}
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 --pin_browsers=true //py:common-${{ matrix.browser }} //py:test-${{ matrix.browser }}
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:common-${{ matrix.browser }} //py:test-${{ matrix.browser }}
2 changes: 0 additions & 2 deletions .github/workflows/ci-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
--local_test_jobs 1
--test_size_filters large
--test_tag_filters ${{ matrix.browser }}
--pin_browsers
//rb/spec/...
integration-tests-remote:
Expand All @@ -111,5 +110,4 @@ jobs:
--local_test_jobs 1
--test_size_filters large
--test_tag_filters ${{ matrix.browser }}-remote
--pin_browsers
//rb/spec/...
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ There are a number of bazel configurations specific for testing.
### Common Options Examples

Here are examples of arguments we make use of in testing the Selenium code:
* `--pin_browsers` - run specific browser versions defined in the build (versions are updated regularly)
* `--pin_browsers=false` - use Selenium Manager to locate browsers/drivers
* `--headless` - run browsers in headless mode (supported be Chrome, Edge and Firefox)
* `--flaky_test_attempts 3` - re-run failed tests up to 3 times
* `--local_test_jobs 1` - control parallelism of tests
Expand Down Expand Up @@ -491,19 +491,19 @@ echo '<X.Y.Z>' > rb/.ruby-version
Run all tests with:

```shell
bazel test //dotnet/test/common:AllTests --pin_browsers=true
bazel test //dotnet/test/common:AllTests
```

You can run specific tests by specifying the class name:

```shell
bazel test //dotnet/test/common:ElementFindingTest --pin_browsers=true
bazel test //dotnet/test/common:ElementFindingTest
```

If the module supports multiple browsers:

```shell
bazel test //dotnet/test/common:ElementFindingTest-edge --pin_browsers=true
bazel test //dotnet/test/common:ElementFindingTest-edge
```

</details>
Expand Down
16 changes: 8 additions & 8 deletions common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ package(default_visibility = ["//visibility:public"])

bool_flag(
name = "pin_browsers",
build_setting_default = False,
)

config_setting(
name = "use_pinned_browser",
flag_values = {
":pin_browsers": "true",
},
build_setting_default = True,
)

bool_flag(
Expand Down Expand Up @@ -47,6 +40,13 @@ config_setting(
values = {"stamp": "true"},
)

config_setting(
name = "use_pinned_browser",
flag_values = {
":pin_browsers": "true",
},
)

alias(
name = "chromedriver",
actual = "@local_drivers//:chromedriver",
Expand Down