public void UIComponent_IsVisible() { var page = Go.To <ContentPage>(); using (StopwatchAsserter.WithinSeconds(0)) page.VisibleDiv.IsVisible.Value.Should().BeTrue(); using (StopwatchAsserter.WithinSeconds(0)) page.VisibleDiv.IsVisible.Should.BeTrue(); using (StopwatchAsserter.WithinSeconds(0)) page.VisibleDiv.Should.BeVisible(); using (StopwatchAsserter.WithinSeconds(0)) page.HiddenDiv.IsVisible.Value.Should().BeFalse(); using (StopwatchAsserter.WithinSeconds(0)) page.HiddenDiv.IsVisible.Should.BeFalse(); using (StopwatchAsserter.WithinSeconds(0)) page.HiddenDiv.Should.BeHidden(); using (StopwatchAsserter.WithinSeconds(0)) page.HiddenDivWithVisibleVisibility.IsVisible.Value.Should().BeFalse(); using (StopwatchAsserter.WithinSeconds(0)) page.HiddenDivWithVisibleVisibility.IsVisible.Should.BeFalse(); using (StopwatchAsserter.WithinSeconds(0)) page.HiddenDivWithVisibleVisibility.Should.BeHidden(); }
public void Trigger_WaitForElement_VisibleAndMissing_NonExistent() { var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(1)) Assert.Throws <NoSuchElementException>( () => page.ButtonWithVisibleAndMissingNonExistentWait.Click()); }
public void Trigger_WaitForScript_Timeout() { var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(1)) Assert.Throws <TimeoutException>( () => page.ButtonWithTimeoutScriptWait()); }
public void Trigger_WaitForElement_VisibleThenMissing() { WaitingPage page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(2)) page.ButtonWithVisibleAndMissingWait.Click(); page.Result.Should.AtOnce.Exist(); }
public void PageObject_RefreshPageUntil_Timeout() { var page = Go.To <WaitingPage>(). CurrentTime.Get(out TimeSpan? time); using (StopwatchAsserter.WithinSeconds(1)) Assert.Throws <TimeoutException>(() => page.RefreshPageUntil(x => x.CurrentTime.Value > time.Value.Add(TimeSpan.FromSeconds(15)), timeout: 1)); }
public void Trigger_WaitForElement_HiddenThenVisible() { var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(2)) page.ButtonWithHiddenAndVisibleWait.Click(); page.Result.Should.AtOnce.Exist(); }
public void Find_Timeout(double timeout) { var control = _page.MissingOptionById; control.Metadata.Get <FindAttribute>().Timeout = timeout; using (StopwatchAsserter.WithinSeconds(timeout)) Assert.Throws <NoSuchElementException>(() => control.Click()); }
public void DefaultTimeout_BaseRetryTimeout_ElementFind() { ConfigureBaseAtataContext(). UseBaseRetryTimeout(TimeSpan.FromSeconds(2)). Build(); var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(2)) page.MissingControl.GetScope(); }
public void DefaultTimeout_BaseRetryTimeout_Verification() { ConfigureBaseAtataContext(). UseBaseRetryTimeout(TimeSpan.FromSeconds(2)). Build(); var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(2)) Assert.Throws <AssertionException>(() => page.MissingControl.Should.BeEnabled()); }
public void DefaultTimeout_VerificationTimeout_DoesExist() { ConfigureBaseAtataContext(). UseBaseRetryTimeout(TimeSpan.FromSeconds(1)). UseVerificationTimeout(TimeSpan.FromSeconds(3)). Build(); var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(3)) AssertThrowsWithInnerException <AssertionException, NoSuchElementException>(() => page.MissingControl.Should.Exist()); }
public void DefaultTimeout_BaseRetryTimeout_Waiting() { ConfigureBaseAtataContext(). UseBaseRetryTimeout(TimeSpan.FromSeconds(2)). Build(); var page = Go.To <WaitingPage>(); using (StopwatchAsserter.WithinSeconds(2)) page.MissingControl.Wait(Until.Visible, new WaitOptions { ThrowOnPresenceFailure = false }); }
public void ControlList_Empty() { var component = Go.To <TablePage>().EmptyTable.Rows; using (StopwatchAsserter.WithinSeconds(0)) component.Should.BeEmpty(); using (StopwatchAsserter.WithinSeconds(0)) component.Count.Should.Equal(0); using (StopwatchAsserter.WithinSeconds(0)) component.Should.HaveCount(0); using (StopwatchAsserter.WithinSeconds(0)) component.AsEnumerable().Should().BeEmpty(); }
public void UIComponent_IsPresent_Should_Fail() { var page = Go.To <ContentPage>(); using (StopwatchAsserter.WithinSeconds(2)) Assert.Throws <AssertionException>(() => page.VisibleDiv.IsPresent.Should.Within(2).BeFalse()); using (StopwatchAsserter.WithinSeconds(2)) Assert.Throws <AssertionException>(() => page.HiddenDiv.IsPresent.Should.Within(2).BeFalse()); using (StopwatchAsserter.WithinSeconds(2)) Assert.Throws <AssertionException>(() => page.HiddenDivWithVisibleVisibility.IsPresent.Should.Within(2).BeTrue()); }