Skip to content

Commit 54bd140

Browse files
nvborisenkosandeepsuryaprasad
authored andcommitted
[dotnet] [bidi] Added UnhandledPromptBehavior for new session capability (SeleniumHQ#15391)
1 parent 031c5f8 commit 54bd140

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;
2323

24-
public record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, UserPromptType Type, string Message)
24+
public record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, Session.UserPromptHandlerType Handler, UserPromptType Type, string Message)
2525
: BrowsingContextEventArgs(BiDi, Context)
2626
{
2727
[JsonInclude]

dotnet/src/webdriver/BiDi/Modules/Session/CapabilitiesRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Modules.Session;
2323

24-
public class CapabilitiesRequest
24+
public record CapabilitiesRequest
2525
{
2626
public CapabilityRequest? AlwaysMatch { get; set; }
2727

dotnet/src/webdriver/BiDi/Modules/Session/CapabilityRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
namespace OpenQA.Selenium.BiDi.Modules.Session;
2121

22-
public class CapabilityRequest
22+
public record CapabilityRequest
2323
{
2424
public bool? AcceptInsecureCerts { get; set; }
2525

@@ -31,5 +31,5 @@ public class CapabilityRequest
3131

3232
public ProxyConfiguration? ProxyConfiguration { get; set; }
3333

34-
public bool? WebSocketUrl { get; set; }
34+
public UserPromptHandler? UnhandledPromptBehavior { get; set; }
3535
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// <copyright file="UserPromptHandler.cs" company="Selenium Committers">
2+
// Licensed to the Software Freedom Conservancy (SFC) under one
3+
// or more contributor license agreements. See the NOTICE file
4+
// distributed with this work for additional information
5+
// regarding copyright ownership. The SFC licenses this file
6+
// to you under the Apache License, Version 2.0 (the
7+
// "License"); you may not use this file except in compliance
8+
// with the License. You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing,
13+
// software distributed under the License is distributed on an
14+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
// KIND, either express or implied. See the License for the
16+
// specific language governing permissions and limitations
17+
// under the License.
18+
// </copyright>
19+
20+
namespace OpenQA.Selenium.BiDi.Modules.Session;
21+
22+
public record UserPromptHandler
23+
{
24+
public UserPromptHandlerType? Alert { get; set; }
25+
26+
public UserPromptHandlerType? BeforeUnload { get; set; }
27+
28+
public UserPromptHandlerType? Confirm { get; set; }
29+
30+
public UserPromptHandlerType? Default { get; set; }
31+
32+
public UserPromptHandlerType? File { get; set; }
33+
34+
public UserPromptHandlerType? Prompt { get; set; }
35+
}
36+
37+
public enum UserPromptHandlerType
38+
{
39+
Accept,
40+
Dismiss,
41+
Ignore
42+
}

0 commit comments

Comments
 (0)