protected internal override void Execute <TOwner>(TriggerContext <TOwner> context) { ScopeSource actualScopeSource = scopeSource ?? context.Component.ScopeSource; IWebElement scopeElement = actualScopeSource.GetScopeElement(context.Component); WaitUnit[] waitUnits = GetWaitUnits(Until); Wait(scopeElement, waitUnits); }
protected virtual void Wait <TOwner>(IUIComponent <TOwner> scopeComponent, WaitUnit waitUnit) where TOwner : PageObject <TOwner> { ScopeSource actualScopeSource = scopeSource ?? scopeComponent.ScopeSource; StaleSafely.Execute( options => { IWebElement scopeElement = actualScopeSource.GetScopeElement(scopeComponent, SearchOptions.Within(options.Timeout)); By by = WaitBy.GetBy(Selector).With(options); if (waitUnit.Method == WaitUnit.WaitMethod.Presence) { scopeElement.Exists(by); } else { scopeElement.Missing(by); } }, waitUnit.SearchOptions); }