예제 #1
0
 protected virtual void OnWait(WaitUnit waitUnit)
 {
     StaleSafely.Execute(
         options =>
     {
         if (waitUnit.Method == WaitUnit.WaitMethod.Presence)
         {
             Exists(options);
         }
         else
         {
             Missing(options);
         }
     },
         waitUnit.SearchOptions);
 }
예제 #2
0
        protected virtual void Wait <TOwner>(IUIComponent <TOwner> scopeComponent, WaitUnit waitUnit)
            where TOwner : PageObject <TOwner>
        {
            ScopeSource actualScopeSource = scopeSource ?? scopeComponent.ScopeSource;

            StaleSafely.Execute(
                options =>
            {
                ISearchContext scopeContext = actualScopeSource.GetScopeContext(scopeComponent, SearchOptions.Within(options.Timeout));

                By by = WaitBy.GetBy(Selector).With(options);

                if (waitUnit.Method == WaitUnit.WaitMethod.Presence)
                {
                    scopeContext.Exists(by);
                }
                else
                {
                    scopeContext.Missing(by);
                }
            },
                waitUnit.SearchOptions);
        }