@@ -30,6 +30,14 @@ internal class Navigator : INavigation
30
30
{
31
31
private WebDriver driver ;
32
32
private string browsingContextId ;
33
+ private static readonly Dictionary < string , ReadinessState > PageLoadStrategyMapper = new ( )
34
+ {
35
+ { "normal" , ReadinessState . Complete } ,
36
+ { "default" , ReadinessState . Complete } ,
37
+ { "eager" , ReadinessState . Interactive } ,
38
+ { "none" , ReadinessState . None }
39
+ } ;
40
+ private ReadinessState readinessState ;
33
41
34
42
/// <summary>
35
43
/// Initializes a new instance of the <see cref="Navigator"/> class
@@ -119,7 +127,11 @@ public async Task GoToUrlAsync(string url)
119
127
120
128
if ( this . driver . BiDiDriver != null )
121
129
{
122
- await driver . BiDiDriver . BrowsingContext . NavigateAsync ( new NavigateCommandParameters ( this . browsingContextId , url ) ) . ConfigureAwait ( false ) ;
130
+ NavigateCommandParameters navigateCommandParameters = new NavigateCommandParameters ( this . browsingContextId , url )
131
+ {
132
+ Wait = this . readinessState
133
+ } ;
134
+ await driver . BiDiDriver . BrowsingContext . NavigateAsync ( navigateCommandParameters ) . ConfigureAwait ( false ) ;
123
135
}
124
136
else
125
137
{
@@ -172,7 +184,10 @@ public async Task RefreshAsync()
172
184
if ( this . driver . BiDiDriver != null )
173
185
{
174
186
var reloadCommandParameters =
175
- new ReloadCommandParameters ( this . browsingContextId ) ;
187
+ new ReloadCommandParameters ( this . browsingContextId )
188
+ {
189
+ Wait = this . readinessState
190
+ } ;
176
191
await this . driver . BiDiDriver . BrowsingContext . ReloadAsync ( reloadCommandParameters ) . ConfigureAwait ( false ) ;
177
192
}
178
193
else
0 commit comments