diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs b/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs index e6b8a1541c0c6..2a748c34a3c9c 100644 --- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs +++ b/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs @@ -21,7 +21,7 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext; -public record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, UserPromptType Type, string Message) +public record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, Session.UserPromptHandlerType Handler, UserPromptType Type, string Message) : BrowsingContextEventArgs(BiDi, Context) { [JsonInclude] diff --git a/dotnet/src/webdriver/BiDi/Modules/Session/CapabilitiesRequest.cs b/dotnet/src/webdriver/BiDi/Modules/Session/CapabilitiesRequest.cs index df1b8498786bc..3740ce75cbb1f 100644 --- a/dotnet/src/webdriver/BiDi/Modules/Session/CapabilitiesRequest.cs +++ b/dotnet/src/webdriver/BiDi/Modules/Session/CapabilitiesRequest.cs @@ -21,7 +21,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Session; -public class CapabilitiesRequest +public record CapabilitiesRequest { public CapabilityRequest? AlwaysMatch { get; set; } diff --git a/dotnet/src/webdriver/BiDi/Modules/Session/CapabilityRequest.cs b/dotnet/src/webdriver/BiDi/Modules/Session/CapabilityRequest.cs index e035f1f9687bc..a5878f7597768 100644 --- a/dotnet/src/webdriver/BiDi/Modules/Session/CapabilityRequest.cs +++ b/dotnet/src/webdriver/BiDi/Modules/Session/CapabilityRequest.cs @@ -19,7 +19,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Session; -public class CapabilityRequest +public record CapabilityRequest { public bool? AcceptInsecureCerts { get; set; } @@ -31,5 +31,5 @@ public class CapabilityRequest public ProxyConfiguration? ProxyConfiguration { get; set; } - public bool? WebSocketUrl { get; set; } + public UserPromptHandler? UnhandledPromptBehavior { get; set; } } diff --git a/dotnet/src/webdriver/BiDi/Modules/Session/UserPromptHandler.cs b/dotnet/src/webdriver/BiDi/Modules/Session/UserPromptHandler.cs new file mode 100644 index 0000000000000..edd7a815aeb36 --- /dev/null +++ b/dotnet/src/webdriver/BiDi/Modules/Session/UserPromptHandler.cs @@ -0,0 +1,42 @@ +// +// Licensed to the Software Freedom Conservancy (SFC) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The SFC licenses this file +// to you 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. +// + +namespace OpenQA.Selenium.BiDi.Modules.Session; + +public record UserPromptHandler +{ + public UserPromptHandlerType? Alert { get; set; } + + public UserPromptHandlerType? BeforeUnload { get; set; } + + public UserPromptHandlerType? Confirm { get; set; } + + public UserPromptHandlerType? Default { get; set; } + + public UserPromptHandlerType? File { get; set; } + + public UserPromptHandlerType? Prompt { get; set; } +} + +public enum UserPromptHandlerType +{ + Accept, + Dismiss, + Ignore +}