Example #1
0
        /// <summary>
        ///     Waits, until the browser's loaded Url should to be the given value.
        /// </summary>
        /// <param name="wait">The <see cref="WebDriverWait" /> instance, that is used to command the browser for wait.</param>
        /// <param name="url">The URL the browser is currently displaying.</param>
        /// <exception cref="WebDriverTimeoutException"></exception>
        public static bool UntilUrlToBe(
            [NotNull] this WebDriverWait wait,
            [NotNull] string url)
        {
            if (wait == null)
            {
                throw new ArgumentNullException(nameof(wait));
            }
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            wait.Message += " Waited for " +
                            "loaded url " +
                            $"to be ({url})";

            return(wait.Until(WebDriverWaitConditions.UrlToBe(url)));
        }