コード例 #1
0
        /// <summary>
        /// Returns a widget of type <typeparamref name="T"/> newly fetched from the browser.
        /// </summary>
        /// <typeparam name="T">The type of the widget to return.</typeparam>
        /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param>
        /// <param name="path">The widget path.</param>
        /// <param name="timeoutInSeconds">The number of seconds to wait for the widget (default is 5).</param>
        /// <returns>An widget newly fetched from the browser.</returns>
        /// <remarks>
        /// Removes an existing widget from the cache and fetches a fresh widget from the browser.
        /// </remarks>
        public static T WidgetRefresh <T>(this WisejWebDriver driver, string path, long timeoutInSeconds = 5)
        {
            T widget = (T)driver.Refresh(path, timeoutInSeconds);

            Assert.IsNotNull(widget, string.Format("{0} {1} not found.", typeof(T).Name, path));
            return(widget);
        }
コード例 #2
0
        /// <summary>
        /// Returns an <see cref="IWidget"/> newly fetched from the browser.
        /// </summary>
        /// <param name="driver">The <see cref="WisejWebDriver"/> to use.</param>
        /// <param name="path">The widget path.</param>
        /// <param name="widgetType">The widget type name.</param>
        /// <param name="timeoutInSeconds">The number of seconds to wait for the widget (default is 5).</param>
        /// <returns>An widget newly fetched from the browser.</returns>
        /// <remarks>
        /// Removes an existing widget from the cache and fetches a fresh widget from the browser.
        /// </remarks>
        public static IWidget WidgetRefresh(this WisejWebDriver driver, string path, string widgetType,
                                            long timeoutInSeconds = 5)
        {
            IWidget widget = driver.Refresh(path, timeoutInSeconds);

            Assert.IsNotNull(widget, string.Format("{0} {1} not found.", widgetType, path));
            return(widget);
        }