public void TestLeftVdiTestWithImplicitNavigation() { VDIWebPage vdi = new VDIWebPage(); vdi.Goto <Seminare>().SearchFor("praxis qualitätssicherung"); DialogWait.For(() => vdi.On <Seminare>().SeminarZeilen.Count(), c => c == 3, "3 seminars in list"); }
public void TestLeftAbstractVdiTestWithImplicitNavigation() { IVDIWebPage vdi = WebPageObject.Resolve <IVDIWebPage>(); vdi.Goto <ISeminare>().SearchFor("praxis qualitätssicherung"); DialogWait.For(() => vdi.On <ISeminare>().SeminarZeilen.Count(), c => c == 3, "3 seminars in list"); vdi.WritePdfTree(); }
public void TestLeftVdiTestWithExplicitNavigation() { VDIWebPage vdi = new VDIWebPage(); vdi.Open(); vdi.On <VDI>().VisibleOnScreen.WaitFor(); vdi.On <Menu>().FortbildungsZentrum.Click(); vdi.On <FortbildungsZentrum>().WeitereSeminare.Click(); vdi.On <Seminare>().Volltextsuche.ScrollTo(); vdi.On <Seminare>().Volltextsuche.Content = "praxis qualitätssicherung"; vdi.On <Seminare>().SucheAnzeigen.Click(); DialogWait.For(() => vdi.On <Seminare>().SeminarZeilen.Count(), c => c == 3, "3 seminars in list", TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(1), true, null); }
public void AbstractVdiTestWithImplicitNavigation() { try { vdi = TabObject.Resolve <IVdiTab>(); vdi.Goto <IEvents>().SearchFor("praxis qualitätssicherung"); DialogWait.For(() => vdi.On <IEvents>().EventList.Count(), c => c == 0, "0 seminars in list"); } finally { vdi.Quit(); } }
public void TestWithImplicitNavigation() { try { vdi = new VdiTab(); vdi.Goto <Events>().SearchFor("praxis qualitätssicherung"); DialogWait.For(() => vdi.On <Events>().EventList.Count(), c => c == 0, "0 seminars in list"); } finally { vdi.Quit(); } }
public void IfTheConditionIsFalse_ExceptionIsThrown_WithExceptionMessage() { Assert.Throws <DialogWaitForTimeoutException>(() => { try { DialogWait.For(() => false, "Order list is empty", @long, medium, @short); } catch (DialogWaitForTimeoutException e) { Assert.AreEqual("Timeout of " + @long.TotalSeconds.ToString("0.00") + " seconds exceeded when waiting for 'Order list is empty'", e.Message); throw; } }); }
/// <summary> /// Wait until the property evaluates to <c>true</c>. /// Show a dialog. /// </summary> /// <param name="expectation">Expectation predicate.</param> /// <param name="expectationText">Expectation text, i.e. the predicate expressed as a human-readable text.</param> /// <param name="timeout">The timeout.</param> public void WaitFor(Predicate <T> expectation, string expectationText, TimeSpan timeout) { string message = $"{name} in {owner.Name}: {expectationText}"; if (showDialog()) { DialogWait.For(() => Value, value => expectation(value), message, timeout, positiveTimeout(), TimeSpan.FromMilliseconds(100)); } else { if (!TryWaitFor(expectation, timeout)) { throw new WaitForException(owner, message); } } }
public void TestWithExplicitNavigation() { try { vdi = new VdiTab(); vdi.Open(); vdi.On <VDI>().Displayed.WaitFor(); vdi.On <Menu>().Events.Click(); vdi.On <Events>().SearchText.Content = "praxis qualitätssicherung"; vdi.On <Events>().Find.Click(); DialogWait.For(() => vdi.On <Events>().EventList.Count(), c => c == 0, "0 seminars in list"); } finally { vdi.Quit(); } }
public void IfTheNestedConditionsAreTrue_ThenNoExceptionIsThrown() { DialogWait.For( () => { try { DialogWait.For(() => true, "sub wait", TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(2), TimeSpan.FromMilliseconds(100)); System.Threading.Thread.Sleep(250); return(true); } catch { return(false); } }, "main wait", TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(5), TimeSpan.FromMilliseconds(1000)); }
public void IfTheConditionIsFlipsBad_ThenTimeout() { bool b = false; Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => (b = !b), "Empty", @long, medium, TimeSpan.FromMilliseconds(500))); }
public void IfTheConditionIsFalse_ThenTimeout_LazyCondition() { int i = 0; Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => { System.Threading.Thread.Sleep(1000); return(i++); }, j => j == 2, "Empty", @long, medium, @short)); }
public void IfTheConditionIsFalse_ThenTimeout_ZeroPollingTime() => Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => false, "Empty", @long, medium, TimeSpan.Zero));
public void IfTheConditionIsFalse_ThenTimeout() => Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => false, "Empty", @long, medium, @short));
public void IfTheConditionIsFalseAndMaxPositiveTimeout_ThenTimeout() // no negative timeout should be displayed on the UI => Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => false, "Empty", @long, TimeSpan.MaxValue, @short));
public void LongExpectationText_IsShownInTwoLines() => DialogWait.For(() => true, "We wait until the expected condition turns to true, so we can continue with the test.", @long, medium, @short);
public void IfTheConditionIsTrue_ThenNoExceptionIsThrown() => DialogWait.For(() => true, "Empty", @long, medium, @short);
public void IfTheConditionIsTrue_ThenNoExceptionIsThrown_ClickThrough() => DialogWait.For(() => true, "Door is closed", @long, @long, @short, true);
public void IfTheConditionIsTrue_ThenNoExceptionIsThrown_FastContinue() => DialogWait.For(() => true, "Empty", @long, TimeSpan.FromSeconds(0), @short);
public void IfTheConditionIsFlipsBad_ThenTimeout_ShowCurrentValue() { int i = 0; Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => ++ i, v => v % 2 == 0, "Even", medium, medium, @short, false, null)); }
public void Repeat_IfTheConditionIsTrue_ThenNoExceptionIsThrown() => Enumerable.Range(0, 50).ToList().ForEach(_ => DialogWait.For(() => true, "Empty", @long, none, @short));
public void IfTheConditionIsTrue_ThenNoExceptionIsThrown_NegativeTimes() => Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => false, "Empty", TimeSpan.FromSeconds(-10), TimeSpan.FromSeconds(-10), TimeSpan.FromSeconds(-10)));
public void IfTheConditionIsTrue_ThenNoExceptionIsThrown_TimeoutBeforeFirstPoll() => Assert.Throws <DialogWaitForTimeoutException>(() => DialogWait.For(() => false, "Empty", TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2)));
public void IfTheConditionIsTrueAndMaxNegativeTimeout_ThenNoExceptionIsThrown() // no negative timeout should be displayed on the UI => DialogWait.For(() => true, "Empty", TimeSpan.MaxValue, @long, @short);