File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
src/webdriver/BiDi/Modules/Script Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Script;
2727[ JsonDerivedType ( typeof ( StringLocalValue ) , "string" ) ]
2828[ JsonDerivedType ( typeof ( NullLocalValue ) , "null" ) ]
2929[ JsonDerivedType ( typeof ( UndefinedLocalValue ) , "undefined" ) ]
30+ [ JsonDerivedType ( typeof ( BooleanLocalValue ) , "boolean" ) ]
3031[ JsonDerivedType ( typeof ( ChannelLocalValue ) , "channel" ) ]
3132[ JsonDerivedType ( typeof ( ArrayLocalValue ) , "array" ) ]
3233[ JsonDerivedType ( typeof ( DateLocalValue ) , "date" ) ]
@@ -84,6 +85,8 @@ public record NullLocalValue : PrimitiveProtocolLocalValue;
8485
8586public record UndefinedLocalValue : PrimitiveProtocolLocalValue ;
8687
88+ public record BooleanLocalValue ( bool Value ) : PrimitiveProtocolLocalValue ;
89+
8790public record ChannelLocalValue ( ChannelLocalValue . ChannelProperties Value ) : LocalValue
8891{
8992 // TODO: Revise why we need it
Original file line number Diff line number Diff line change @@ -56,6 +56,22 @@ await context.Script.CallFunctionAsync($$"""
5656 } , Throws . Nothing ) ;
5757 }
5858
59+ [ Test ]
60+ public void CanCallFunctionWithArgumentBoolean ( )
61+ {
62+ var arg = new BooleanLocalValue ( true ) ;
63+ Assert . That ( async ( ) =>
64+ {
65+ await context . Script . CallFunctionAsync ( $$ """
66+ (arg) => {
67+ if (arg !== true) {
68+ throw new Error("Assert failed: " + arg);
69+ }
70+ }
71+ """ , false , new ( ) { Arguments = [ arg ] } ) ;
72+ } , Throws . Nothing ) ;
73+ }
74+
5975 [ Test ]
6076 public void CanCallFunctionWithArgumentEmptyString ( )
6177 {
You can’t perform that action at this time.
0 commit comments