Esempio n. 1
0
        public void UIComponent_IsPresent()
        {
            var page = Go.To <ContentPage>();

            using (StopwatchAsserter.Within(0))
                page.VisibleDiv.IsPresent.Value.Should().BeTrue();

            using (StopwatchAsserter.Within(0))
                page.VisibleDiv.IsPresent.Should.BeTrue();

            using (StopwatchAsserter.Within(0))
                page.VisibleDiv.Should.Exist();

            using (StopwatchAsserter.Within(0))
                page.HiddenDiv.IsPresent.Value.Should().BeTrue();

            using (StopwatchAsserter.Within(0))
                page.HiddenDiv.IsPresent.Should.BeTrue();

            using (StopwatchAsserter.Within(0))
                page.HiddenDiv.Should.Exist();

            using (StopwatchAsserter.Within(0))
                page.HiddenDivWithVisibleVisibility.IsPresent.Value.Should().BeFalse();

            using (StopwatchAsserter.Within(0))
                page.HiddenDivWithVisibleVisibility.IsPresent.Should.BeFalse();

            using (StopwatchAsserter.Within(0))
                page.HiddenDivWithVisibleVisibility.Should.Not.Exist();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        public void WaitForElement_HiddenAndVisible()
        {
            using (StopwatchAsserter.Within(2))
                page.ButtonWithHiddenAndVisibleWait.Click();

            page.Result.Should.AtOnce.Exist();
        }
Esempio n. 4
0
        public void WaitForElement_VisibleAndMissing()
        {
            using (StopwatchAsserter.Within(2))
                page.ButtonWithVisibleAndMissingWait.Click();

            page.Result.Should.AtOnce.Exist();
        }
Esempio n. 5
0
        public void Trigger_WaitForElement_VisibleAndMissing_NonExistent()
        {
            var page = Go.To <WaitingPage>();

            using (StopwatchAsserter.WithinSeconds(1))
                Assert.Throws <NoSuchElementException>(
                    () => page.ButtonWithVisibleAndMissingNonExistentWait.Click());
        }
Esempio n. 6
0
        public void Trigger_WaitForScript_Timeout()
        {
            var page = Go.To <WaitingPage>();

            using (StopwatchAsserter.Within(1))
                Assert.Throws <TimeoutException>(
                    () => page.ButtonWithTimeoutScriptWait());
        }
Esempio n. 7
0
        public void Trigger_WaitForElement_VisibleThenMissing()
        {
            WaitingPage page = Go.To <WaitingPage>();

            using (StopwatchAsserter.WithinSeconds(2))
                page.ButtonWithVisibleAndMissingWait.Click();

            page.Result.Should.AtOnce.Exist();
        }
        public void Trigger_WaitForElement_HiddenThenVisible()
        {
            var page = Go.To <WaitingPage>();

            using (StopwatchAsserter.Within(2))
                page.ButtonWithHiddenAndVisibleWait.Click();

            page.Result.Should.AtOnce.Exist();
        }
Esempio n. 9
0
        public void PageObject_RefreshPageUntil_Timeout()
        {
            var page = Go.To <WaitingPage>().
                       CurrentTime.Get(out TimeSpan? time);

            using (StopwatchAsserter.Within(1, 1))
                Assert.Throws <TimeoutException>(() =>
                                                 page.RefreshPageUntil(x => x.CurrentTime.Value > time.Value.Add(TimeSpan.FromSeconds(15)), timeout: 1));
        }
Esempio n. 10
0
        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());
        }
Esempio n. 11
0
        public void DefaultTimeout_BaseRetryTimeout_ElementFind()
        {
            ConfigureBaseAtataContext().
            UseBaseRetryTimeout(TimeSpan.FromSeconds(2)).
            Build();

            var page = Go.To <WaitingPage>();

            using (StopwatchAsserter.WithinSeconds(2))
                page.MissingControl.GetScope();
        }
Esempio n. 12
0
        public void Trigger_WaitForElement_HiddenThenVisible()
        {
            var page    = Go.To <WaitingPage>();
            var control = page.ButtonWithHiddenAndVisibleWait;

            control.WaitTo().BeVisible();

            using (StopwatchAsserter.WithinSeconds(2))
                control.Click();

            page.Result.Should.AtOnce.Exist();
        }
Esempio n. 13
0
        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());
        }
Esempio n. 14
0
        public void DefaultTimeout_VerificationTimeout_CheckDataProperty()
        {
            ConfigureBaseAtataContext().
            UseBaseRetryTimeout(TimeSpan.FromSeconds(1)).
            UseVerificationTimeout(TimeSpan.FromSeconds(3)).
            Build();

            var page = Go.To <WaitingPage>();

            using (StopwatchAsserter.Within(3))
                Assert.Throws <AssertionException>(() =>
                                                   page.MissingControl.IsEnabled.Should.BeTrue());
        }
Esempio n. 15
0
        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());
        }
Esempio n. 16
0
        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
                });
        }
Esempio n. 17
0
        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();
        }
Esempio n. 18
0
        public void UIComponent_IsPresent_Should_Fail()
        {
            var page = Go.To <ContentPage>();

            using (StopwatchAsserter.Within(2))
                Assert.Throws <AssertionException>(() =>
                                                   page.VisibleDiv.IsPresent.Should.Within(2).BeFalse());

            using (StopwatchAsserter.Within(2))
                Assert.Throws <AssertionException>(() =>
                                                   page.HiddenDiv.IsPresent.Should.Within(2).BeFalse());

            using (StopwatchAsserter.Within(2))
                Assert.Throws <AssertionException>(() =>
                                                   page.HiddenDivWithVisibleVisibility.IsPresent.Should.Within(2).BeTrue());
        }
Esempio n. 19
0
 public void WaitForElement_VisibleAndMissing_NonExistent()
 {
     using (StopwatchAsserter.Within(1))
         Assert.Throws <NoSuchElementException>(
             () => page.ButtonWithVisibleAndMissingNonExistentWait.Click());
 }