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 @@ -28,6 +28,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Script;
2828[ JsonDerivedType ( typeof ( NullLocalValue ) , "null" ) ]
2929[ JsonDerivedType ( typeof ( UndefinedLocalValue ) , "undefined" ) ]
3030[ JsonDerivedType ( typeof ( BooleanLocalValue ) , "boolean" ) ]
31+ [ JsonDerivedType ( typeof ( BigIntLocalValue ) , "bigint" ) ]
3132[ JsonDerivedType ( typeof ( ChannelLocalValue ) , "channel" ) ]
3233[ JsonDerivedType ( typeof ( ArrayLocalValue ) , "array" ) ]
3334[ JsonDerivedType ( typeof ( DateLocalValue ) , "date" ) ]
@@ -87,6 +88,8 @@ public record UndefinedLocalValue : PrimitiveProtocolLocalValue;
8788
8889public record BooleanLocalValue ( bool Value ) : PrimitiveProtocolLocalValue ;
8990
91+ public record BigIntLocalValue ( string Value ) : PrimitiveProtocolLocalValue ;
92+
9093public record ChannelLocalValue ( ChannelLocalValue . ChannelProperties Value ) : LocalValue
9194{
9295 // TODO: Revise why we need it
Original file line number Diff line number Diff line change @@ -72,6 +72,22 @@ await context.Script.CallFunctionAsync($$"""
7272 } , Throws . Nothing ) ;
7373 }
7474
75+ [ Test ]
76+ public void CanCallFunctionWithArgumentBigInt ( )
77+ {
78+ var arg = new BigIntLocalValue ( "12345" ) ;
79+ Assert . That ( async ( ) =>
80+ {
81+ await context . Script . CallFunctionAsync ( $$ """
82+ (arg) => {
83+ if (arg !== 12345n) {
84+ throw new Error("Assert failed: " + arg);
85+ }
86+ }
87+ """ , false , new ( ) { Arguments = [ arg ] } ) ;
88+ } , Throws . Nothing ) ;
89+ }
90+
7591 [ Test ]
7692 public void CanCallFunctionWithArgumentEmptyString ( )
7793 {
You can’t perform that action at this time.
0 commit comments