Пример #1
0
        public static void ConditionIsTrue(Func <bool> condition, string conditionDescription = "Condition", int timeoutSec = 15)
        {
            void IsResultTrue()
            {
                if (!condition())
                {
                    throw new Exception();
                }
            }

            TryCatchMethods.TryCatchVoid(IsResultTrue, timeoutSec, $"{conditionDescription} was not true after timeout.");
        }
Пример #2
0
 public static void ClickOnElement(this IWebElement element, int timeOutSec = DefaultTimeOutSec)
 => TryCatchMethods.TryCatchVoid(element.Click, timeOutSec);
Пример #3
0
 public static IWebElement GetElementBy(this ISearchContext rootElement, By locator, int timeOutSec = DefaultTimeOutSec)
 => TryCatchMethods.TryCatchReturn(() => rootElement?.FindElement(locator), timeOutSec);