public TReturnPageObject GoToPageAndCheck <TReturnPageObject>(Uri url, Pause.ScriptWaitDuration duration, bool throwWhenNotOnPage = true, Dictionary <string, object> arguments = null) where TReturnPageObject : IInteractable { _NavigateTo(url); return(ResolvePageObjectAndCheck <TReturnPageObject>(duration, throwWhenNotOnPage, arguments)); }
public TReturnPageObject ResolvePageObjectAndCheck <TReturnPageObject>(Pause.ScriptWaitDuration duration, bool throwWhenNotOnPage = true, Dictionary <string, object> arguments = null) where TReturnPageObject : IInteractable { var performPause = true; // if the onlyForBrowser object is passed in and contains elements if (SlowBrowsers != null && SlowBrowsers.Any()) { // only perform the pause for instances where the current browser is in the only list performPause = SlowBrowsers.Any(s => s == DriverSession.SuiteSettings.WebDriverSettings.Browser.EnumValue); } if (performPause) { Logging.Logging.WriteVerboseLogEntry(GetType().ToString(), "Performing slow browser pause for WaitDuration: '{0}' to ensure {1} page is fully loaded.", duration, typeof(TReturnPageObject)); Pause.PauseExecution(duration); } return(ResolvePageObjectAndCheck <TReturnPageObject>(throwWhenNotOnPage, arguments)); }
/// <summary> /// Pauses the current script execution and returns an instance of the specified type so as to be fluent /// </summary> /// <typeparam name="TPageType">The type of IRunBasePage to return</typeparam> /// <param name="duration">How long to wait for</param> /// <returns>An instance of a type to work with</returns> protected TPageType PauseExecution <TPageType>(Pause.ScriptWaitDuration duration) where TPageType : IInteractable { Pause.PauseExecution(duration); return(AppWide.Instance.Resolve <TPageType>()); }
/// <summary> /// Pauses the current script execution /// </summary> /// <param name="duration">How long to wait</param> protected void PauseExecution(Pause.ScriptWaitDuration duration) { Pause.PauseExecution(duration); }