public void ExtendedSearchContext_MissingAll_Timeout_Unsafely() { GoTo("static"); using (StopwatchAsserter.WithinSeconds(5, .3)) Assert.Throws <NotMissingElementException>(() => Driver.Try().MissingAll(_existingElementBy.Unsafely(), _anotherMissingElementBy.Unsafely())); }
public void ExtendedSearchContext_Get_Unsafely() { GoTo("static"); using (StopwatchAsserter.WithinSeconds(5, .3)) Assert.Throws <NoSuchElementException>(() => Driver.Get(_missingElementBy.Unsafely())); }
public void SafeWait_Success_Immediate() { using (StopwatchAsserter.WithinSeconds(0, .01)) wait.Until(_ => { return(true); }); }
public void ExtendedSearchContext_Try_Get_Timeout() { GoTo("static"); using (StopwatchAsserter.WithinSeconds(3, .3)) Assert.Throws <NoSuchElementException>(() => Driver.Try(TimeSpan.FromSeconds(3)).Get(_missingElementBy)); }
public void SafeWait_Timeout() { using (StopwatchAsserter.WithinSeconds(.3, .015)) wait.Until(_ => { return(false); }); }
public void ExtendedSearchContext_Get_Timeout_ButHidden() { GoTo("static"); using (StopwatchAsserter.WithinSeconds(3, .3)) Assert.Throws <NoSuchElementException>(() => Driver.Get(_hiddenElementBy.Visible().Within(TimeSpan.FromSeconds(3)))); }
public void SafeWait_PollingInterval() { using (StopwatchAsserter.WithinSeconds(.3, .2)) wait.Until(_ => { Thread.Sleep(TimeSpan.FromSeconds(.1)); return(false); }); }
public void ExtendedSearchContext_Get_OfAnyVisibility() { GoTo("static"); using (StopwatchAsserter.WithinSeconds(0, .3)) { IWebElement element = Driver.Get(_hiddenElementBy.OfAnyVisibility()); Assert.That(element, Is.Not.Null); } }
public void SafeWait_PollingInterval_GreaterThanTimeout() { wait.PollingInterval = TimeSpan.FromSeconds(1); using (StopwatchAsserter.WithinSeconds(.3, .02)) wait.Until(_ => { return(false); }); }
public void ExtendedSearchContext_Get_Safely() { GoTo("static"); IWebElement element; using (StopwatchAsserter.WithinSeconds(5, .3)) element = Driver.Get(_missingElementBy.Safely()); Assert.That(element, Is.Null); }
public void ExtendedSearchContext_MissingAll_Timeout_Safely() { GoTo("static"); bool result; using (StopwatchAsserter.WithinSeconds(5, .3)) result = Driver.Try().MissingAll(_existingElementBy.Safely(), _anotherMissingElementBy.Safely()); Assert.That(result, Is.False); }
public void ExtendedSearchContext_MissingAll() { GoTo("static"); bool result; using (StopwatchAsserter.WithinSeconds(0, .6)) result = Driver.Try().MissingAll(_missingElementBy, _anotherMissingElementBy); Assert.That(result, Is.True); }
public void ExtendedSearchContext_Try_Until_TimeoutOfUntil() { GoTo("static"); bool result; using (StopwatchAsserter.WithinSeconds(2, .05)) result = Driver.Try().Until(x => false, TimeSpan.FromSeconds(2)); Assert.That(result, Is.False); }
public void ExtendedSearchContext_Try_Until_DefaultTimeout() { GoTo("static"); bool result; using (StopwatchAsserter.WithinSeconds(5, .3)) result = Driver.Try().Until(x => false); Assert.That(result, Is.False); }
public void ExtendedSearchContext_Try_Until_Immediate() { GoTo("static"); bool result; using (StopwatchAsserter.WithinSeconds(0, .05)) result = Driver.Try(TimeSpan.FromSeconds(2)).Until(x => true); Assert.That(result, Is.True); }
public void ExtendedSearchContext_Get_Immediate() { GoTo("static"); IWebElement element; using (StopwatchAsserter.WithinSeconds(0, .3)) element = Driver.Get(_existingElementBy); Assert.That(element, Is.Not.Null); }
public void ExtendedSearchContext_Get_Retry() { GoTo("dynamic"); Driver.Get(By.Id("add-value")).Click(); IWebElement element = StopwatchAsserter.WithinSeconds(2, 1.5).Execute( () => Driver.Get(By.Id("value-block"))); Assert.That(element, Is.Not.Null); }
public void ExtendedSearchContext_Missing() { GoTo("static"); bool result; using (StopwatchAsserter.WithinSeconds(0, .3)) result = Driver.Try().Missing(missingElementBy.Safely()); Assert.That(result, Is.True); }