Skip to content

Commit a320f32

Browse files
authored
Merge branch 'trunk' into decrement-connection-counter
2 parents bd49c63 + f697509 commit a320f32

File tree

99 files changed

+1239
-1265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1239
-1265
lines changed

Rakefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ namespace :py do
585585
nightly = ".#{Time.now.strftime('%Y%m%d%H%M')}"
586586
new_version = updated_version(old_version, arguments[:version], nightly)
587587

588-
['py/setup.py',
589-
'py/pyproject.toml',
588+
['py/pyproject.toml',
590589
'py/BUILD.bazel',
591590
'py/selenium/__init__.py',
592591
'py/selenium/webdriver/__init__.py',
@@ -1048,7 +1047,6 @@ namespace :all do
10481047
'py/selenium/webdriver/__init__.py',
10491048
'py/selenium/__init__.py',
10501049
'py/BUILD.bazel',
1051-
'py/setup.py',
10521050
'rb/lib/selenium/webdriver/version.rb',
10531051
'rb/Gemfile.lock'])
10541052

@@ -1110,7 +1108,6 @@ namespace :all do
11101108
'py/selenium/webdriver/__init__.py',
11111109
'py/BUILD.bazel',
11121110
'py/CHANGES',
1113-
'py/setup.py',
11141111
'rb/lib/selenium/webdriver/version.rb',
11151112
'rb/CHANGES',
11161113
'rb/Gemfile.lock',

common/repositories.bzl

+25-25
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def pin_browsers():
1111

1212
http_archive(
1313
name = "linux_firefox",
14-
url = "https://ftp.mozilla.org/pub/firefox/releases/132.0.2/linux-x86_64/en-US/firefox-132.0.2.tar.bz2",
15-
sha256 = "777d47f8b8710ab450582dc0dc0cdf8f43c2291249b3eaf740ee28ee34cda139",
14+
url = "https://ftp.mozilla.org/pub/firefox/releases/133.0/linux-x86_64/en-US/firefox-133.0.tar.bz2",
15+
sha256 = "63cb097174d429043ad128341358d14cdb5d4c9d05d035d9e3094634ceaf22c2",
1616
build_file_content = """
1717
load("@aspect_rules_js//js:defs.bzl", "js_library")
1818
package(default_visibility = ["//visibility:public"])
@@ -33,8 +33,8 @@ js_library(
3333

3434
dmg_archive(
3535
name = "mac_firefox",
36-
url = "https://ftp.mozilla.org/pub/firefox/releases/132.0.2/mac/en-US/Firefox%20132.0.2.dmg",
37-
sha256 = "233251c46eb4964868d815a9233cab855ac6160736310771a67af93a9b78224d",
36+
url = "https://ftp.mozilla.org/pub/firefox/releases/133.0/mac/en-US/Firefox%20133.0.dmg",
37+
sha256 = "02c76e21d64f21d4e45b1205717ccd0736a75f2a50b01c74b25b17e374447a76",
3838
build_file_content = """
3939
load("@aspect_rules_js//js:defs.bzl", "js_library")
4040
package(default_visibility = ["//visibility:public"])
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/133.0b9/linux-x86_64/en-US/firefox-133.0b9.tar.bz2",
54-
sha256 = "5c9f79912bfbf892d2b676973a26ffc078ee9b8fd9b791bfa856db030e657750",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/134.0b5/linux-x86_64/en-US/firefox-134.0b5.tar.bz2",
54+
sha256 = "9688f50d2bba71c7781e7f46100e97223d469d37197cf99511a2b2e27efd50a2",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/133.0b9/mac/en-US/Firefox%20133.0b9.dmg",
76-
sha256 = "0eb0fabe9216dc80c2ca403dd2eba935d71f2bdc1dea1d1cc37f03666ef094d1",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/134.0b5/mac/en-US/Firefox%20134.0b5.dmg",
76+
sha256 = "5c6d02d149637e963c55c741ebed98a8dacfa93c90e99065981bbdd9d511a0f1",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/08b226c9-fbe8-43c0-94fe-ed9c3eeb8f59/MicrosoftEdge-131.0.2903.51.pkg",
127-
sha256 = "5bc1eab86bb315aa9f2cd2b7d9afe072df35280f6e6d1a9ca9c108d95bda8acd",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/a310bc51-4dc2-4780-9677-41f3ecf37e31/MicrosoftEdge-131.0.2903.86.pkg",
127+
sha256 = "77dc0bf6d465815d3414a1b52d506323619c9debb12f9feb85ec4ad2c7e58585",
128128
move = {
129-
"MicrosoftEdge-131.0.2903.51.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-131.0.2903.86.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_131.0.2903.51-1_amd64.deb",
147-
sha256 = "8aad12c97bcae417ff9cc4251b75211eeda7f1513312dc57b2f744e824e028c0",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_131.0.2903.86-1_amd64.deb",
147+
sha256 = "4c7844e51ffefbf5a595f3d93e633481c6081f0fd954d15cc08066ea23ddacf3",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.azureedge.net/131.0.2903.52/edgedriver_linux64.zip",
169-
sha256 = "ddbeda7cec5ed16b96c3cf0f6759de30e4f3726da9da31bfba1371ccd8fcfd14",
168+
url = "https://msedgedriver.azureedge.net/131.0.2903.84/edgedriver_linux64.zip",
169+
sha256 = "13b8024056a2ae72dfc45907213212756ffaf52567fa2b367acadd20badfb4bb",
170170
build_file_content = """
171171
load("@aspect_rules_js//js:defs.bzl", "js_library")
172172
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
182182

183183
http_archive(
184184
name = "mac_edgedriver",
185-
url = "https://msedgedriver.azureedge.net/131.0.2903.56/edgedriver_mac64.zip",
186-
sha256 = "4f4d1d5b45849677f8d8e706f7b5ca9ebb99f40ed3b4ee203c2535a3429e0d5b",
185+
url = "https://msedgedriver.azureedge.net/131.0.2903.84/edgedriver_mac64.zip",
186+
sha256 = "288c7b38d24a0650ca60e9e2a231c0c71976adc37be9e11e777e0596c40b3878",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/linux64/chrome-linux64.zip",
203-
sha256 = "3a6d928b0002ec012a53b6bb65dcaf95add008adc223c961d566d824982a767e",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.87/linux64/chrome-linux64.zip",
203+
sha256 = "5ed0d25537b964cdf826224165a80d125ae67bbb980065c2f1e665dae6686904",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -221,8 +221,8 @@ js_library(
221221

222222
http_archive(
223223
name = "mac_chrome",
224-
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/mac-x64/chrome-mac-x64.zip",
225-
sha256 = "e26a606e2a3da403c6e1e93617a7b51ee010706614eb88de5b16470276e0896b",
224+
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.87/mac-x64/chrome-mac-x64.zip",
225+
sha256 = "a9ab895b3ab102973f224f35bef6f0336b690f03cc5fbb73110bf448fe30ce70",
226226
strip_prefix = "chrome-mac-x64",
227227
patch_cmds = [
228228
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -243,8 +243,8 @@ js_library(
243243

244244
http_archive(
245245
name = "linux_chromedriver",
246-
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/linux64/chromedriver-linux64.zip",
247-
sha256 = "33910b16568feabd2b50a26a2c4456d154c760d6e28347427f99c025661a4f3e",
246+
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.87/linux64/chromedriver-linux64.zip",
247+
sha256 = "bb0c5ee6594453258b328b838adc194ed0df000f2a6e5ead306b637a995e387b",
248248
strip_prefix = "chromedriver-linux64",
249249
build_file_content = """
250250
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -261,8 +261,8 @@ js_library(
261261

262262
http_archive(
263263
name = "mac_chromedriver",
264-
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.85/mac-x64/chromedriver-mac-x64.zip",
265-
sha256 = "ee194eba1d52dea61dfbf08b05a2ce139660e9c7d20d15024c3a0757ac4a5fcb",
264+
url = "https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.87/mac-x64/chromedriver-mac-x64.zip",
265+
sha256 = "9fa91a7b7e969cbd6edb089e14b8db2189353519640dcc84c067369918bfb04f",
266266
strip_prefix = "chromedriver-mac-x64",
267267
build_file_content = """
268268
load("@aspect_rules_js//js:defs.bzl", "js_library")

dotnet/src/webdriver/ILogs.cs

+4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using System;
2021
using System.Collections.ObjectModel;
2122

23+
#nullable enable
24+
2225
namespace OpenQA.Selenium
2326
{
2427
/// <summary>
@@ -37,6 +40,7 @@ public interface ILogs
3740
/// <param name="logKind">The log for which to retrieve the log entries.
3841
/// Log types can be found in the <see cref="LogType"/> class.</param>
3942
/// <returns>The list of <see cref="LogEntry"/> objects for the specified log.</returns>
43+
/// <exception cref="ArgumentNullException">If <paramref name="logKind"/> is <see langword="null"/>.</exception>
4044
ReadOnlyCollection<LogEntry> GetLog(string logKind);
4145
}
4246
}

dotnet/src/webdriver/Interactions/ActionSequence.cs

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public int Count
7272
/// Gets the input device for this Action sequence.
7373
/// </summary>
7474
[Obsolete("This property has been renamed to InputDevice and will be removed in a future version")]
75+
[CLSCompliant(false)]
7576
public InputDevice inputDevice => InputDevice;
7677

7778
/// <summary>

dotnet/src/webdriver/Interactions/Actions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private InputDevice FindDeviceById(string name)
138138

139139
if (id == name)
140140
{
141-
return sequence.inputDevice;
141+
return sequence.InputDevice;
142142
}
143143
}
144144

dotnet/src/webdriver/LogEntry.cs

+19-28
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@
2121
using System.Collections.Generic;
2222
using System.Globalization;
2323

24+
#nullable enable
25+
2426
namespace OpenQA.Selenium
2527
{
2628
/// <summary>
2729
/// Represents an entry in a log from a driver instance.
2830
/// </summary>
2931
public class LogEntry
3032
{
31-
private LogLevel level = LogLevel.All;
32-
private DateTime timestamp = DateTime.MinValue;
33-
private string message = string.Empty;
3433

3534
/// <summary>
3635
/// Initializes a new instance of the <see cref="LogEntry"/> class.
@@ -42,34 +41,27 @@ private LogEntry()
4241
/// <summary>
4342
/// Gets the timestamp value of the log entry.
4443
/// </summary>
45-
public DateTime Timestamp
46-
{
47-
get { return this.timestamp; }
48-
}
44+
public DateTime Timestamp { get; private set; } = DateTime.MinValue;
4945

5046
/// <summary>
5147
/// Gets the logging level of the log entry.
5248
/// </summary>
53-
public LogLevel Level
54-
{
55-
get { return this.level; }
56-
}
49+
public LogLevel Level { get; private set; } = LogLevel.All;
5750

5851
/// <summary>
5952
/// Gets the message of the log entry.
6053
/// </summary>
61-
public string Message
62-
{
63-
get { return this.message; }
64-
}
54+
public string Message { get; private set; } = string.Empty;
55+
56+
private static readonly DateTime UnixEpoch = new(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
6557

6658
/// <summary>
6759
/// Returns a string that represents the current <see cref="LogEntry"/>.
6860
/// </summary>
6961
/// <returns>A string that represents the current <see cref="LogEntry"/>.</returns>
7062
public override string ToString()
7163
{
72-
return string.Format(CultureInfo.InvariantCulture, "[{0:yyyy-MM-ddTHH:mm:ssZ}] [{1}] {2}", this.timestamp, this.level, this.message);
64+
return string.Format(CultureInfo.InvariantCulture, "[{0:yyyy-MM-ddTHH:mm:ssZ}] [{1}] {2}", this.Timestamp, this.Level, this.Message);
7365
}
7466

7567
/// <summary>
@@ -78,32 +70,31 @@ public override string ToString()
7870
/// <param name="entryDictionary">The <see cref="Dictionary{TKey, TValue}"/> from
7971
/// which to create the <see cref="LogEntry"/>.</param>
8072
/// <returns>A <see cref="LogEntry"/> with the values in the dictionary.</returns>
81-
internal static LogEntry FromDictionary(Dictionary<string, object> entryDictionary)
73+
internal static LogEntry FromDictionary(Dictionary<string, object?> entryDictionary)
8274
{
8375
LogEntry entry = new LogEntry();
84-
if (entryDictionary.ContainsKey("message"))
76+
if (entryDictionary.TryGetValue("message", out object? message))
8577
{
86-
entry.message = entryDictionary["message"].ToString();
78+
entry.Message = message?.ToString() ?? string.Empty;
8779
}
8880

89-
if (entryDictionary.ContainsKey("timestamp"))
81+
if (entryDictionary.TryGetValue("timestamp", out object? timestamp))
9082
{
91-
DateTime zeroDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
92-
double timestampValue = Convert.ToDouble(entryDictionary["timestamp"], CultureInfo.InvariantCulture);
93-
entry.timestamp = zeroDate.AddMilliseconds(timestampValue);
83+
double timestampValue = Convert.ToDouble(timestamp, CultureInfo.InvariantCulture);
84+
entry.Timestamp = UnixEpoch.AddMilliseconds(timestampValue);
9485
}
9586

96-
if (entryDictionary.ContainsKey("level"))
87+
if (entryDictionary.TryGetValue("level", out object? level))
9788
{
98-
string levelValue = entryDictionary["level"].ToString();
99-
try
89+
if (Enum.TryParse(level?.ToString(), ignoreCase: true, out LogLevel result))
10090
{
101-
entry.level = (LogLevel)Enum.Parse(typeof(LogLevel), levelValue, true);
91+
entry.Level = result;
10292
}
103-
catch (ArgumentException)
93+
else
10494
{
10595
// If the requested log level string is not a valid log level,
10696
// ignore it and use LogLevel.All.
97+
entry.Level = LogLevel.All;
10798
}
10899
}
109100

dotnet/src/webdriver/LogLevel.cs

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
// under the License.
1818
// </copyright>
1919

20+
#nullable enable
21+
2022
namespace OpenQA.Selenium
2123
{
2224
/// <summary>

dotnet/src/webdriver/Logs.cs

+16-10
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,25 @@
2121
using System.Collections.Generic;
2222
using System.Collections.ObjectModel;
2323

24+
#nullable enable
25+
2426
namespace OpenQA.Selenium
2527
{
2628
/// <summary>
2729
/// Provides a mechanism for examining logs for the driver during the test.
2830
/// </summary>
2931
public class Logs : ILogs
3032
{
31-
private WebDriver driver;
33+
private readonly WebDriver driver;
3234

3335
/// <summary>
3436
/// Initializes a new instance of the <see cref="Logs"/> class.
3537
/// </summary>
3638
/// <param name="driver">Instance of the driver currently in use</param>
39+
/// <exception cref="ArgumentNullException">If <paramref name="driver"/> is <see langword="null"/>.</exception>
3740
public Logs(WebDriver driver)
3841
{
39-
this.driver = driver;
42+
this.driver = driver ?? throw new ArgumentNullException(nameof(driver));
4043
}
4144

4245
/// <summary>
@@ -50,12 +53,11 @@ public ReadOnlyCollection<string> AvailableLogTypes
5053
try
5154
{
5255
Response commandResponse = this.driver.InternalExecute(DriverCommand.GetAvailableLogTypes, null);
53-
object[] responseValue = commandResponse.Value as object[];
54-
if (responseValue != null)
56+
if (commandResponse.Value is object[] responseValue)
5557
{
5658
foreach (object logKind in responseValue)
5759
{
58-
availableLogTypes.Add(logKind.ToString());
60+
availableLogTypes.Add(logKind.ToString()!);
5961
}
6062
}
6163
}
@@ -74,21 +76,25 @@ public ReadOnlyCollection<string> AvailableLogTypes
7476
/// <param name="logKind">The log for which to retrieve the log entries.
7577
/// Log types can be found in the <see cref="LogType"/> class.</param>
7678
/// <returns>The list of <see cref="LogEntry"/> objects for the specified log.</returns>
79+
/// <exception cref="ArgumentNullException">If <paramref name="logKind"/> is <see langword="null"/>.</exception>
7780
public ReadOnlyCollection<LogEntry> GetLog(string logKind)
7881
{
82+
if (logKind is null)
83+
{
84+
throw new ArgumentNullException(nameof(logKind));
85+
}
86+
7987
List<LogEntry> entries = new List<LogEntry>();
8088

8189
Dictionary<string, object> parameters = new Dictionary<string, object>();
8290
parameters.Add("type", logKind);
8391
Response commandResponse = this.driver.InternalExecute(DriverCommand.GetLog, parameters);
8492

85-
object[] responseValue = commandResponse.Value as object[];
86-
if (responseValue != null)
93+
if (commandResponse.Value is object?[] responseValue)
8794
{
88-
foreach (object rawEntry in responseValue)
95+
foreach (object? rawEntry in responseValue)
8996
{
90-
Dictionary<string, object> entryDictionary = rawEntry as Dictionary<string, object>;
91-
if (entryDictionary != null)
97+
if (rawEntry is Dictionary<string, object?> entryDictionary)
9298
{
9399
entries.Add(LogEntry.FromDictionary(entryDictionary));
94100
}

0 commit comments

Comments
 (0)