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
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ on Github.

This document will guide you through the contribution process.

### Step 1: Fork
### Step 1: Fork & Clone

Fork the project [on Github](https://github.com/seleniumhq/selenium)
and check out your copy locally. Use `--depth 1` for a quick check out.
The repository is ~2GB and checking the whole history takes a while.
and clone the repository locally. Use `--depth 1` for a quick clone.
The repository is over 2GB and cloning the whole history takes a while.

```shell
% git clone git@github.com:username/selenium.git --depth 1
Expand All @@ -76,7 +76,7 @@ The repository is ~2GB and checking the whole history takes a while.

#### Dependencies

We bundle dependencies in the _third-party/_ directory that is not
We bundle dependencies in the _third-party/_ directory that are not
part of the proper project. Any changes to files in this directory or
its subdirectories should be sent upstream to the respective projects.
Please don't send your patch to us as we cannot accept it.
Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -963,9 +963,9 @@ namespace :java do
ENV['MAVEN_USER'] ||= ENV.fetch('SEL_M2_USER', nil)
ENV['MAVEN_PASSWORD'] ||= ENV.fetch('SEL_M2_PASS', nil)
read_m2_user_pass unless ENV['MAVEN_PASSWORD'] && ENV['MAVEN_USER']

repo = nightly ? 'content/repositories/snapshots' : 'service/local/staging/deploy/maven2'
ENV['MAVEN_REPO'] = "https://central.sonatype.org/#{repo}"
repo_domain = 'central.sonatype.com'
repo = nightly ? "#{repo_domain}/repository/maven-snapshots" : "ossrh-staging-api.#{repo_domain}/service/local/"
ENV['MAVEN_REPO'] = "https://#{repo}"
ENV['GPG_SIGN'] = (!nightly).to_s

if nightly
Expand Down
8 changes: 4 additions & 4 deletions common/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ js_library(

http_archive(
name = "linux_edgedriver",
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_linux64.zip",
sha256 = "141cd4cd42b7642dec1f215e0b1a0c1dae05f573218cb8ef18b876efa14f152a",
url = "https://msedgedriver.azureedge.net/137.0.3296.93/edgedriver_linux64.zip",
sha256 = "417bdfafbe8358e2b040b86b0e255344e0d200bd7087a9d85171abc9fc0c29c3",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand All @@ -182,8 +182,8 @@ js_library(

http_archive(
name = "mac_edgedriver",
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_mac64.zip",
sha256 = "e361cfea041e649944a60a41ec40076be35fda8608e9011fad638ec0491a1f79",
url = "https://msedgedriver.azureedge.net/137.0.3296.93/edgedriver_mac64.zip",
sha256 = "d55e0f377ba45c1d754625b88f16493bded924b41bd624210241493b77e4fdb9",
build_file_content = """
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/ClientWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

public record ClientWindow
public sealed record ClientWindow
{
internal ClientWindow(string id)
{
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

public record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);
public sealed record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);

public enum ClientWindowState
{
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/BiDi/Browser/CloseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class CloseCommand()
internal sealed class CloseCommand()
: Command<CommandParameters, EmptyResult>(CommandParameters.Empty, "browser.close");

public record CloseOptions : CommandOptions;
public sealed class CloseOptions : CommandOptions;
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/CreateUserContextCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class CreateUserContextCommand(CreateUserContextCommandParameters @params)
internal sealed class CreateUserContextCommand(CreateUserContextCommandParameters @params)
: Command<CreateUserContextCommandParameters, UserContextInfo>(@params, "browser.createUserContext");

internal record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;
internal sealed record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;

public record CreateUserContextOptions : CommandOptions
public sealed class CreateUserContextOptions : CommandOptions
{
public bool? AcceptInsecureCerts { get; set; }

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/GetClientWindowsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class GetClientWindowsCommand()
internal sealed class GetClientWindowsCommand()
: Command<CommandParameters, GetClientWindowsResult>(CommandParameters.Empty, "browser.getClientWindows");

public record GetClientWindowsOptions : CommandOptions;
public sealed class GetClientWindowsOptions : CommandOptions;

public record GetClientWindowsResult : EmptyResult, IReadOnlyList<ClientWindowInfo>
public sealed record GetClientWindowsResult : EmptyResult, IReadOnlyList<ClientWindowInfo>
{
private readonly IReadOnlyList<ClientWindowInfo> _clientWindows;

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/GetUserContextsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class GetUserContextsCommand()
internal sealed class GetUserContextsCommand()
: Command<CommandParameters, GetUserContextsResult>(CommandParameters.Empty, "browser.getUserContexts");

public record GetUserContextsOptions : CommandOptions;
public class GetUserContextsOptions : CommandOptions;

public record GetUserContextsResult : EmptyResult, IReadOnlyList<UserContextInfo>
public sealed record GetUserContextsResult : EmptyResult, IReadOnlyList<UserContextInfo>
{
private readonly IReadOnlyList<UserContextInfo> _userContexts;

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/RemoveUserContextCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
internal sealed class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
: Command<RemoveUserContextCommandParameters, EmptyResult>(@params, "browser.removeUserContext");

internal record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;
internal sealed record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;

public record RemoveUserContextOptions : CommandOptions;
public sealed class RemoveUserContextOptions : CommandOptions;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐛 Correctness Issue

Breaking API change: record to class conversion.

Changing RemoveUserContextOptions from a record to a class removes value equality and immutability, breaking existing code that depends on record semantics.

Current Code (Diff):

- public sealed class RemoveUserContextOptions : CommandOptions;
+ public sealed record RemoveUserContextOptions : CommandOptions;
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
public sealed class RemoveUserContextOptions : CommandOptions;
public sealed record RemoveUserContextOptions : CommandOptions;

2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/UserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

public class UserContext : IAsyncDisposable
public sealed class UserContext : IAsyncDisposable
{
private readonly BiDi _bidi;

Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/UserContextInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

namespace OpenQA.Selenium.BiDi.Browser;

public record UserContextInfo(UserContext UserContext) : EmptyResult;
public sealed record UserContextInfo(UserContext UserContext) : EmptyResult;
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/BrowsingContext/ActivateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class ActivateCommand(ActivateCommandParameters @params)
internal sealed class ActivateCommand(ActivateCommandParameters @params)
: Command<ActivateCommandParameters, EmptyResult>(@params, "browsingContext.activate");

internal record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;
internal sealed record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;

public record ActivateOptions : CommandOptions;
public sealed class ActivateOptions : CommandOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContext
public sealed class BrowsingContext
{
internal BrowsingContext(BiDi bidi, string id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public record BrowsingContextInfo(BiDi BiDi, IReadOnlyList<BrowsingContextInfo>? Children, Browser.ClientWindow ClientWindow, BrowsingContext Context, BrowsingContext? OriginalOpener, string Url, Browser.UserContext UserContext)
public sealed record BrowsingContextInfo(BiDi BiDi, IReadOnlyList<BrowsingContextInfo>? Children, Browser.ClientWindow ClientWindow, BrowsingContext Context, BrowsingContext? OriginalOpener, string Url, Browser.UserContext UserContext)
: BrowsingContextEventArgs(BiDi, Context)
{
[JsonInclude]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextInputModule(BrowsingContext context, InputModule inputModule)
public sealed class BrowsingContextInputModule(BrowsingContext context, InputModule inputModule)
{
public Task PerformActionsAsync(IEnumerable<SourceActions> actions, PerformActionsOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextLogModule(BrowsingContext context, LogModule logModule)
public sealed class BrowsingContextLogModule(BrowsingContext context, LogModule logModule)
{
public Task<Subscription> OnEntryAddedAsync(Func<Log.LogEntry, Task> handler, SubscriptionOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextModule(Broker broker) : Module(broker)
public sealed class BrowsingContextModule(Broker broker) : Module(broker)
{
public async Task<BrowsingContext> CreateAsync(ContextType type, CreateOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextNetworkModule(BrowsingContext context, NetworkModule networkModule)
public sealed class BrowsingContextNetworkModule(BrowsingContext context, NetworkModule networkModule)
{
public async Task<Intercept> InterceptRequestAsync(Func<InterceptedRequest, Task> handler, InterceptRequestOptions? options = null)
{
Expand Down Expand Up @@ -134,8 +134,8 @@ public Task<Subscription> OnAuthRequiredAsync(Action<AuthRequiredEventArgs> hand
}
}

public record InterceptRequestOptions : BrowsingContextAddInterceptOptions;
public sealed record InterceptRequestOptions : BrowsingContextAddInterceptOptions;

public record InterceptResponseOptions : BrowsingContextAddInterceptOptions;
public sealed record InterceptResponseOptions : BrowsingContextAddInterceptOptions;

public record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
public sealed record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
public sealed class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
{
public async Task<PreloadScript> AddPreloadScriptAsync(string functionDeclaration, BrowsingContextAddPreloadScriptOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextStorageModule(BrowsingContext context, StorageModule storageModule)
public sealed class BrowsingContextStorageModule(BrowsingContext context, StorageModule storageModule)
{
public Task<GetCookiesResult> GetCookiesAsync(GetCookiesOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
internal sealed class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
: Command<CaptureScreenshotCommandParameters, CaptureScreenshotResult>(@params, "browsingContext.captureScreenshot");

internal record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
internal sealed record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;

public record CaptureScreenshotOptions : CommandOptions
public sealed class CaptureScreenshotOptions : CommandOptions
{
public ScreenshotOrigin? Origin { get; set; }

Expand All @@ -52,11 +52,11 @@ public record struct ImageFormat(string Type)
[JsonDerivedType(typeof(ElementClipRectangle), "element")]
public abstract record ClipRectangle;

public record BoxClipRectangle(double X, double Y, double Width, double Height) : ClipRectangle;
public sealed record BoxClipRectangle(double X, double Y, double Width, double Height) : ClipRectangle;

public record ElementClipRectangle(Script.ISharedReference Element) : ClipRectangle;
public sealed record ElementClipRectangle(Script.ISharedReference Element) : ClipRectangle;

public record CaptureScreenshotResult(string Data) : EmptyResult
public sealed record CaptureScreenshotResult(string Data) : EmptyResult
{
public static implicit operator byte[](CaptureScreenshotResult captureScreenshotResult) => captureScreenshotResult.ToByteArray();

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/BrowsingContext/CloseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class CloseCommand(CloseCommandParameters @params)
internal sealed class CloseCommand(CloseCommandParameters @params)
: Command<CloseCommandParameters, EmptyResult>(@params, "browsingContext.close");

internal record CloseCommandParameters(BrowsingContext Context, bool? PromptUnload) : CommandParameters;
internal sealed record CloseCommandParameters(BrowsingContext Context, bool? PromptUnload) : CommandParameters;

public record CloseOptions : CommandOptions
public sealed class CloseOptions : CommandOptions
{
public bool? PromptUnload { get; set; }
}
8 changes: 4 additions & 4 deletions dotnet/src/webdriver/BiDi/BrowsingContext/CreateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class CreateCommand(CreateCommandParameters @params)
internal sealed class CreateCommand(CreateCommandParameters @params)
: Command<CreateCommandParameters, CreateResult>(@params, "browsingContext.create");

internal record CreateCommandParameters(ContextType Type, BrowsingContext? ReferenceContext, bool? Background, Browser.UserContext? UserContext) : CommandParameters;
internal sealed record CreateCommandParameters(ContextType Type, BrowsingContext? ReferenceContext, bool? Background, Browser.UserContext? UserContext) : CommandParameters;

public record CreateOptions : CommandOptions
public sealed class CreateOptions : CommandOptions
{
public BrowsingContext? ReferenceContext { get; set; }

Expand All @@ -41,4 +41,4 @@ public enum ContextType
Window
}

public record CreateResult(BrowsingContext Context) : EmptyResult;
public sealed record CreateResult(BrowsingContext Context) : EmptyResult;
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/BiDi/BrowsingContext/GetTreeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class GetTreeCommand(GetTreeCommandParameters @params)
internal sealed class GetTreeCommand(GetTreeCommandParameters @params)
: Command<GetTreeCommandParameters, GetTreeResult>(@params, "browsingContext.getTree");

internal record GetTreeCommandParameters(long? MaxDepth, BrowsingContext? Root) : CommandParameters;
internal sealed record GetTreeCommandParameters(long? MaxDepth, BrowsingContext? Root) : CommandParameters;

public record GetTreeOptions : CommandOptions
public sealed class GetTreeOptions : CommandOptions
{
public GetTreeOptions() { }

Expand All @@ -41,9 +41,9 @@ internal GetTreeOptions(BrowsingContextGetTreeOptions? options)
public BrowsingContext? Root { get; set; }
}

public record BrowsingContextGetTreeOptions
public sealed record BrowsingContextGetTreeOptions
{
public long? MaxDepth { get; set; }
}

public record GetTreeResult(IReadOnlyList<BrowsingContextInfo> Contexts) : EmptyResult;
public sealed record GetTreeResult(IReadOnlyList<BrowsingContextInfo> Contexts) : EmptyResult;
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

class HandleUserPromptCommand(HandleUserPromptCommandParameters @params)
internal sealed class HandleUserPromptCommand(HandleUserPromptCommandParameters @params)
: Command<HandleUserPromptCommandParameters, EmptyResult>(@params, "browsingContext.handleUserPrompt");

internal record HandleUserPromptCommandParameters(BrowsingContext Context, bool? Accept, string? UserText) : CommandParameters;
internal sealed record HandleUserPromptCommandParameters(BrowsingContext Context, bool? Accept, string? UserText) : CommandParameters;

public record HandleUserPromptOptions : CommandOptions
public sealed class HandleUserPromptOptions : CommandOptions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐛 Correctness Issue

Breaking API Change: Record to Class Conversion.

Changing HandleUserPromptOptions from a record to a class breaks compatibility with any code relying on record-specific features like value equality or deconstruction.

Current Code (Diff):

- public sealed class HandleUserPromptOptions : CommandOptions
+ public sealed record HandleUserPromptOptions : CommandOptions
📝 Committable suggestion

‼️ IMPORTANT
Trust, but verify! 🕵️ Please review this suggestion with the care of a code archaeologist - check that it perfectly replaces the highlighted code, preserves all lines, maintains proper indentation, and won't break anything in production. Your future self will thank you! 🚀

Suggested change
public sealed class HandleUserPromptOptions : CommandOptions
public sealed record HandleUserPromptOptions : CommandOptions

{
public bool? Accept { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public record HistoryUpdatedEventArgs(BiDi BiDi, BrowsingContext Context, DateTimeOffset Timestamp, string Url)
public sealed record HistoryUpdatedEventArgs(BiDi BiDi, BrowsingContext Context, DateTimeOffset Timestamp, string Url)
: BrowsingContextEventArgs(BiDi, Context);
Loading