@@ -24,53 +24,145 @@ namespace OpenQA.Selenium.BiDi.Emulation;
2424class EmulationTest : BiDiTestFixture
2525{
2626 [ Test ]
27+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
2728 public void CanSetTimezoneOverride ( )
2829 {
29- Assert . That ( async ( ) => await bidi . Emulation . SetTimezoneOverrideAsync ( "UTC" , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
30- Assert . That ( async ( ) => await bidi . Emulation . SetTimezoneOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
30+ Assert . That (
31+ async ( ) => await bidi . Emulation . SetTimezoneOverrideAsync ( "UTC" , new ( ) { Contexts = [ context ] } ) ,
32+ Throws . Nothing ) ;
3133 }
3234
3335 [ Test ]
36+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
37+ public void CanSetTimezoneOverrideToDefault ( )
38+ {
39+ Assert . That (
40+ async ( ) => await bidi . Emulation . SetTimezoneOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) ,
41+ Throws . Nothing ) ;
42+ }
43+
44+ [ Test ]
45+ [ IgnoreBrowser ( Selenium . Browser . Chrome , "Not supported yet?" ) ]
46+ [ IgnoreBrowser ( Selenium . Browser . Edge , "Not supported yet?" ) ]
47+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
3448 public void CanSetUserAgentOverride ( )
3549 {
36- Assert . That ( async ( ) => await bidi . Emulation . SetUserAgentOverrideAsync ( "MyUserAgent/1.0" , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
37- Assert . That ( async ( ) => await bidi . Emulation . SetUserAgentOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
50+ Assert . That (
51+ async ( ) => await bidi . Emulation . SetUserAgentOverrideAsync ( "MyUserAgent/1.0" , new ( ) { Contexts = [ context ] } ) ,
52+ Throws . Nothing ) ;
53+ }
54+
55+ [ Test ]
56+ [ IgnoreBrowser ( Selenium . Browser . Chrome , "Not supported yet?" ) ]
57+ [ IgnoreBrowser ( Selenium . Browser . Edge , "Not supported yet?" ) ]
58+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
59+ public void CanSetUserAgentOverrideToDefault ( )
60+ {
61+ Assert . That (
62+ async ( ) => await bidi . Emulation . SetUserAgentOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) ,
63+ Throws . Nothing ) ;
3864 }
3965
4066 [ Test ]
4167 public void CanSetLocaleOverride ( )
4268 {
43- Assert . That ( async ( ) => await bidi . Emulation . SetLocaleOverrideAsync ( "en-US" , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
44- Assert . That ( async ( ) => await bidi . Emulation . SetLocaleOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
69+ Assert . That (
70+ async ( ) => await bidi . Emulation . SetLocaleOverrideAsync ( "en-US" , new ( ) { Contexts = [ context ] } ) ,
71+ Throws . Nothing ) ;
4572 }
4673
4774 [ Test ]
75+ public void CanSetLocaleOverrideToDefault ( )
76+ {
77+ Assert . That (
78+ async ( ) => await bidi . Emulation . SetLocaleOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) ,
79+ Throws . Nothing ) ;
80+ }
81+
82+ [ Test ]
83+ [ IgnoreBrowser ( Selenium . Browser . Chrome , "Not supported yet?" ) ]
84+ [ IgnoreBrowser ( Selenium . Browser . Edge , "Not supported yet?" ) ]
85+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
4886 public void CanSetForcedColorsModeThemeOverride ( )
4987 {
50- Assert . That ( async ( ) => await bidi . Emulation . SetForcedColorsModeThemeOverrideAsync ( ForcedColorsModeTheme . Light , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
51- Assert . That ( async ( ) => await bidi . Emulation . SetForcedColorsModeThemeOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
88+ Assert . That (
89+ async ( ) => await bidi . Emulation . SetForcedColorsModeThemeOverrideAsync ( ForcedColorsModeTheme . Light , new ( ) { Contexts = [ context ] } ) ,
90+ Throws . Nothing ) ;
91+ }
92+
93+ [ Test ]
94+ [ IgnoreBrowser ( Selenium . Browser . Chrome , "Not supported yet?" ) ]
95+ [ IgnoreBrowser ( Selenium . Browser . Edge , "Not supported yet?" ) ]
96+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
97+ public void CanSetForcedColorsModeThemeOverrideToDefault ( )
98+ {
99+ Assert . That (
100+ async ( ) => await bidi . Emulation . SetForcedColorsModeThemeOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) ,
101+ Throws . Nothing ) ;
52102 }
53103
54104 [ Test ]
105+ [ IgnoreBrowser ( Selenium . Browser . Chrome , "Not supported yet?" ) ]
106+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
55107 public void CanSetScriptingEnabled ( )
56108 {
57- Assert . That ( async ( ) => await bidi . Emulation . SetScriptingEnabledAsync ( false , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
58- Assert . That ( async ( ) => await bidi . Emulation . SetScriptingEnabledAsync ( null , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
109+ Assert . That (
110+ async ( ) => await bidi . Emulation . SetScriptingEnabledAsync ( false , new ( ) { Contexts = [ context ] } ) ,
111+ Throws . Nothing ) ;
59112 }
60113
61114 [ Test ]
115+ [ IgnoreBrowser ( Selenium . Browser . Chrome , "Not supported yet?" ) ]
116+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
117+ public void CanSetScriptingEnabledToDefault ( )
118+ {
119+ Assert . That (
120+ async ( ) => await bidi . Emulation . SetScriptingEnabledAsync ( null , new ( ) { Contexts = [ context ] } ) ,
121+ Throws . Nothing ) ;
122+ }
123+
124+ [ Test ]
125+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
62126 public void CanSetScreenOrientationOverride ( )
63127 {
64128 var orientation = new ScreenOrientation ( ScreenOrientationNatural . Portrait , ScreenOrientationType . PortraitPrimary ) ;
65- Assert . That ( async ( ) => await bidi . Emulation . SetScreenOrientationOverrideAsync ( orientation , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
66- Assert . That ( async ( ) => await bidi . Emulation . SetScreenOrientationOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
129+
130+ Assert . That (
131+ async ( ) => await bidi . Emulation . SetScreenOrientationOverrideAsync ( orientation , new ( ) { Contexts = [ context ] } ) ,
132+ Throws . Nothing ) ;
133+ }
134+
135+ [ Test ]
136+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "Not supported yet?" ) ]
137+ public void CanSetScreenOrientationOverrideToDefault ( )
138+ {
139+ Assert . That (
140+ async ( ) => await bidi . Emulation . SetScreenOrientationOverrideAsync ( null , new ( ) { Contexts = [ context ] } ) ,
141+ Throws . Nothing ) ;
142+ }
143+
144+ [ Test ]
145+ public void CanSetGeolocationCoordinatesOverride ( )
146+ {
147+ Assert . That (
148+ async ( ) => await bidi . Emulation . SetGeolocationCoordinatesOverrideAsync ( 0 , 0 , new ( ) { Contexts = [ context ] } ) ,
149+ Throws . Nothing ) ;
150+ }
151+
152+ [ Test ]
153+ public void CanSetGeolocationCoordinatesOverrideToDefault ( )
154+ {
155+ Assert . That (
156+ async ( ) => await bidi . Emulation . SetGeolocationCoordinatesOverrideAsync ( new ( ) { Contexts = [ context ] } ) ,
157+ Throws . Nothing ) ;
67158 }
68159
69160 [ Test ]
70- public void CanSetGeolocationOverride ( )
161+ [ IgnoreBrowser ( Selenium . Browser . Firefox , "invalid argument: Expected \" coordinates\" to be an object, got [object Undefined] undefined" ) ]
162+ public void CanSetGeolocationPositionErrorOverride ( )
71163 {
72- Assert . That ( async ( ) => await bidi . Emulation . SetGeolocationCoordinatesOverrideAsync ( 0 , 0 , new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
73- Assert . That ( async ( ) => await bidi . Emulation . SetGeolocationCoordinatesOverrideAsync ( new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
74- Assert . That ( async ( ) => await bidi . Emulation . SetGeolocationPositionErrorOverrideAsync ( new ( ) { Contexts = [ context ] } ) , Throws . Nothing ) ;
164+ Assert . That (
165+ async ( ) => await bidi . Emulation . SetGeolocationPositionErrorOverrideAsync ( new ( ) { Contexts = [ context ] } ) ,
166+ Throws . Nothing ) ;
75167 }
76168}
0 commit comments