Merge pull request #962 from visagang/features/vguruparan
Update default timeout for web driver
This commit is contained in:
commit
4c62ce18f0
|
|
@ -6,6 +6,7 @@ public class WebBrowsingSettings
|
||||||
public bool Headless { get; set; }
|
public bool Headless { get; set; }
|
||||||
// Default timeout in milliseconds
|
// Default timeout in milliseconds
|
||||||
public float DefaultTimeout { get; set; } = 30000;
|
public float DefaultTimeout { get; set; } = 30000;
|
||||||
|
public float DefaultNavigationTimeout { get; set; } = 30000;
|
||||||
public bool IsEnableScreenshot { get; set; }
|
public bool IsEnableScreenshot { get; set; }
|
||||||
// Default wait time in seconds after page is opened
|
// Default wait time in seconds after page is opened
|
||||||
public int DefaultWaitTime { get; set; } = 5;
|
public int DefaultWaitTime { get; set; } = 5;
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ public class PlaywrightInstance : IDisposable
|
||||||
|
|
||||||
public async Task<IBrowserContext> InitContext(string ctxId, BrowserActionArgs args)
|
public async Task<IBrowserContext> InitContext(string ctxId, BrowserActionArgs args)
|
||||||
{
|
{
|
||||||
|
var _webDriver = _services.GetRequiredService<WebBrowsingSettings>();
|
||||||
if (_contexts.ContainsKey(ctxId))
|
if (_contexts.ContainsKey(ctxId))
|
||||||
return _contexts[ctxId];
|
return _contexts[ctxId];
|
||||||
|
|
||||||
|
|
@ -83,6 +84,8 @@ public class PlaywrightInstance : IDisposable
|
||||||
// "--start-maximized"
|
// "--start-maximized"
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
_contexts[ctxId].SetDefaultTimeout(_webDriver.DefaultTimeout);
|
||||||
|
_contexts[ctxId].SetDefaultNavigationTimeout(_webDriver.DefaultNavigationTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
_pages[ctxId] = new List<IPage>();
|
_pages[ctxId] = new List<IPage>();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue