Skip to content

Commit 70ce17a

Browse files
authored
Merge branch 'trunk' into renovate/ws-8.x
2 parents 7326fd5 + 0d9ee19 commit 70ce17a

File tree

9 files changed

+115
-24
lines changed

9 files changed

+115
-24
lines changed

dotnet/src/webdriver/BiDi/Network/Cookie.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ public enum SameSite
3232
{
3333
Strict,
3434
Lax,
35-
None
35+
None,
36+
Default
3637
}

dotnet/src/webdriver/Chromium/ChromiumDriverService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ protected ChromiumDriverService(string? executablePath, string? executableFileNa
9595
/// </summary>
9696
public string? AllowedIPAddresses { get; set; }
9797

98+
/// <summary>
99+
/// Adds readable timestamps to log
100+
/// </summary>
101+
public bool ReadableTimestamp { get; set; }
102+
98103
/// <summary>
99104
/// Gets the command-line arguments for the driver service.
100105
/// </summary>
@@ -128,6 +133,11 @@ protected override string CommandLineArguments
128133
argsBuilder.Append(" --append-log");
129134
}
130135

136+
if (this.ReadableTimestamp)
137+
{
138+
argsBuilder.Append(" --readable-timestamp");
139+
}
140+
131141
if (!string.IsNullOrEmpty(this.LogPath))
132142
{
133143
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --log-path=\"{0}\"", this.LogPath);

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ protected override DriverOptions GetDefaultDriverOptions()
103103
/// </remarks>
104104
public string? LogPath { get; set; }
105105

106+
/// <summary>
107+
/// Disable truncation of long log lines in GeckoDriver.
108+
/// </summary>
109+
public bool LogNoTruncate { get; set; }
110+
111+
/// <summary>
112+
/// Directory in which GeckoDriver creates profiles.
113+
/// </summary>
114+
public string? ProfileRoot { get; set; }
115+
106116
/// <summary>
107117
/// Gets or sets the level at which log output is displayed.
108118
/// </summary>
@@ -189,6 +199,21 @@ protected override string CommandLineArguments
189199
argsBuilder.Append(" --jsdebugger");
190200
}
191201

202+
if (this.LogNoTruncate)
203+
{
204+
argsBuilder.Append(" --log-no-truncate");
205+
}
206+
207+
if (!string.IsNullOrEmpty(this.ProfileRoot))
208+
{
209+
if (!Directory.Exists(this.ProfileRoot))
210+
{
211+
throw new ArgumentException($"Profile root directory does not exist: {this.ProfileRoot}", nameof(ProfileRoot));
212+
}
213+
214+
argsBuilder.AppendFormat(CultureInfo.InvariantCulture, " --profile-root \"{0}\"", this.ProfileRoot);
215+
}
216+
192217
return argsBuilder.ToString().Trim();
193218
}
194219
}

java/src/org/openqa/selenium/bidi/network/Cookie.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public class Cookie {
2525
public enum SameSite {
2626
STRICT("strict"),
2727
LAX("lax"),
28-
NONE("none");
28+
NONE("none"),
29+
DEFAULT("default");
2930

3031
private final String type;
3132

javascript/selenium-webdriver/bidi/networkTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const SameSite = {
2626
STRICT: 'strict',
2727
LAX: 'lax',
2828
NONE: 'none',
29+
DEFAULT: 'default',
2930

3031
findByName(name) {
3132
return (

py/BUILD.bazel

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ BIDI_TESTS = glob(["test/selenium/webdriver/common/**/*bidi*_tests.py"])
441441
"test/selenium/webdriver/common/**/*.py",
442442
"test/selenium/webdriver/support/**/*.py",
443443
],
444-
exclude = BIDI_TESTS + ["test/selenium/webdriver/common/print_pdf_tests.py"],
444+
exclude = BIDI_TESTS + ["test/selenium/webdriver/common/print_pdf_tests.py"] +
445+
(["test/selenium/webdriver/common/devtools_tests.py"] if browser == "chrome-beta" else []),
445446
),
446447
args = [
447448
"--instafail",
@@ -467,7 +468,8 @@ BIDI_TESTS = glob(["test/selenium/webdriver/common/**/*bidi*_tests.py"])
467468
"test/selenium/webdriver/common/**/*.py",
468469
"test/selenium/webdriver/support/**/*.py",
469470
],
470-
exclude = ["test/selenium/webdriver/common/print_pdf_tests.py"],
471+
exclude = ["test/selenium/webdriver/common/print_pdf_tests.py"] +
472+
(["test/selenium/webdriver/common/devtools_tests.py"] if browser == "chrome-beta" else []),
471473
),
472474
args = [
473475
"--instafail",
@@ -534,6 +536,29 @@ py_test_suite(
534536
] + TEST_DEPS,
535537
)
536538

539+
py_test_suite(
540+
name = "test-chrome-beta",
541+
size = "large",
542+
srcs = glob(
543+
[
544+
"test/selenium/webdriver/chrome/**/*.py",
545+
],
546+
),
547+
args = [
548+
"--instafail",
549+
] + BROWSERS["chrome-beta"]["args"],
550+
data = BROWSERS["chrome-beta"]["data"],
551+
env_inherit = ["DISPLAY"],
552+
tags = [
553+
"no-sandbox",
554+
] + BROWSERS["chrome-beta"]["tags"],
555+
deps = [
556+
":init-tree",
557+
":selenium",
558+
":webserver",
559+
] + TEST_DEPS,
560+
)
561+
537562
py_test_suite(
538563
name = "test-edge",
539564
size = "large",

py/docs/source/index.rst

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,32 @@ Several browsers are supported, as well as the Remote protocol:
4747
Installing
4848
==========
4949

50-
If you have `pip <https://pip.pypa.io/>`_ on your system, you can simply install or upgrade the Python bindings::
50+
Install or upgrade the Python bindings with `pip <https://pip.pypa.io/>`.
51+
52+
Latest official release::
5153

5254
pip install -U selenium
5355

54-
You may want to consider using a `virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments>`_
55-
to create isolated Python environments.
56+
Nightly development release::
57+
58+
pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ selenium
59+
60+
Note: you should consider using a
61+
`virtual environment <https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments>`_
62+
to create an isolated Python environment for installation.
5663

5764
Drivers
5865
=======
5966

6067
Selenium requires a driver to interface with the chosen browser (chromedriver, edgedriver, geckodriver, etc).
6168

62-
In older versions of Selenium, it was necessary to install and manage these drivers yourself. You had to make sure the driver
63-
executable was available on your system `PATH`, or specified explicitly in code. Modern versions of Selenium handle browser and
64-
driver installation for you with `Selenium Manager <https://www.selenium.dev/documentation/selenium_manager>`_. You generally
65-
don't have to worry about driver installation or configuration now that it's done for you when you instantiate a WebDriver.
66-
Selenium Manager works with most supported platforms and browsers. If it doesn't meet your needs, you can still install and
67-
specify browsers and drivers yourself.
69+
In older versions of Selenium, it was necessary to install and manage these drivers yourself. You had to make sure the
70+
driver executable was available on your system `PATH`, or specified explicitly in code. Modern versions of Selenium
71+
handle browser and driver installation for you with
72+
`Selenium Manager <https://www.selenium.dev/documentation/selenium_manager>`_. You generally don't have to worry about
73+
driver installation or configuration now that it's done for you when you instantiate a WebDriver. Selenium Manager works
74+
with most supported platforms and browsers. If it doesn't meet your needs, you can still install and specify browsers
75+
and drivers yourself.
6876

6977
Links to some of the more popular browser drivers:
7078

@@ -123,8 +131,8 @@ Example 1:
123131
Example 2:
124132
==========
125133

126-
Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's standard
127-
`unittest <http://docs.python.org/3/library/unittest.html>`_ library:
134+
Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's
135+
standard `unittest <http://docs.python.org/3/library/unittest.html>`_ library:
128136

129137
.. code-block:: python
130138
@@ -150,8 +158,8 @@ Selenium Grid (optional)
150158

151159
For local Selenium scripts, the Java server is not needed.
152160

153-
To use Selenium remotely, you need to also run the Selenium grid.
154-
For information on running Selenium Grid: https://www.selenium.dev/documentation/grid/getting_started/
161+
To use Selenium remotely, you need to also run a Selenium Grid. For information on running Selenium Grid:
162+
https://www.selenium.dev/documentation/grid/getting_started/
155163

156164
To use Remote WebDriver see: https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/?tab=python
157165

@@ -167,15 +175,14 @@ View source code online:
167175
Contributing
168176
=============
169177

170-
- Fork the selenium repo and clone it locally
178+
- Fork the selenium repo
179+
- Clone your fork locally
171180
- Create a branch for your work
172-
- Run: `git checkout -b my-cool-branch-name`
181+
- `git checkout -b my-cool-branch-name`
173182
- Create a virtual environment and install tox
174-
- Run: `python -m venv venv && source venv/bin/activate && pip install tox`
183+
- `python -m venv venv && source venv/bin/activate && pip install tox`
175184
- Make your changes
176-
- Run: `tox -e linting`
185+
- Run the linter/formatter
186+
- `tox -e linting`
177187
- If tox exits `0`, commit and push. Otherwise, fix the newly introduced style violations
178-
- `flake8` requires manual fixes
179-
- `black` will rewrite the violations automatically, however the files are unstaged and should be staged again
180-
- `isort` will rewrite the violations automatically, however the files are unstaged and should be staged again
181188
- Submit a Pull Request

py/private/browsers.bzl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load(
22
"//common:browsers.bzl",
33
"COMMON_TAGS",
4+
"chrome_beta_data",
45
"chrome_data",
56
"edge_data",
67
"firefox_data",
@@ -27,6 +28,20 @@ chrome_args = select({
2728
"//conditions:default": [],
2829
}) + headless_args
2930

31+
chrome_beta_args = select({
32+
"@selenium//common:use_pinned_linux_chrome": [
33+
"--driver-binary=$(location @linux_beta_chromedriver//:chromedriver)",
34+
"--browser-binary=$(location @linux_beta_chrome//:chrome-linux64/chrome)",
35+
"--browser-args=--disable-dev-shm-usage",
36+
"--browser-args=--no-sandbox",
37+
],
38+
"@selenium//common:use_pinned_macos_chrome": [
39+
"--driver-binary=$(location @mac_beta_chromedriver//:chromedriver)",
40+
"--browser-binary=$(location @mac_beta_chrome//:Chrome.app)/Contents/MacOS/Chrome",
41+
],
42+
"//conditions:default": [],
43+
}) + headless_args
44+
3045
edge_args = select({
3146
"@selenium//common:use_pinned_linux_edge": [
3247
"--driver-binary=$(location @linux_edgedriver//:msedgedriver)",
@@ -59,6 +74,11 @@ BROWSERS = {
5974
"data": chrome_data,
6075
"tags": COMMON_TAGS + ["chrome"],
6176
},
77+
"chrome-beta": {
78+
"args": ["--driver=chrome"] + chrome_beta_args,
79+
"data": chrome_beta_data,
80+
"tags": COMMON_TAGS + ["chrome"],
81+
},
6282
"edge": {
6383
"args": ["--driver=edge"] + edge_args,
6484
"data": edge_data,

py/selenium/webdriver/common/bidi/storage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class SameSite:
2626
STRICT = "strict"
2727
LAX = "lax"
2828
NONE = "none"
29+
DEFAULT = "default"
2930

3031

3132
class BytesValue:

0 commit comments

Comments
 (0)