Ejemplo n.º 1
0
        public void ExtendedSearchContext_MissingAll_Timeout_Unsafely()
        {
            GoTo("static");

            using (StopwatchAsserter.WithinSeconds(5, .3))
                Assert.Throws <NotMissingElementException>(() =>
                                                           Driver.Try().MissingAll(_existingElementBy.Unsafely(), _anotherMissingElementBy.Unsafely()));
        }
Ejemplo n.º 2
0
        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);
         });
 }
Ejemplo n.º 4
0
        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);
         });
 }
Ejemplo n.º 6
0
        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);
         });
 }
Ejemplo n.º 8
0
        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);
                });
        }
Ejemplo n.º 10
0
        public void ExtendedSearchContext_Get_Safely()
        {
            GoTo("static");

            IWebElement element;

            using (StopwatchAsserter.WithinSeconds(5, .3))
                element = Driver.Get(_missingElementBy.Safely());

            Assert.That(element, Is.Null);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
        public void ExtendedSearchContext_MissingAll()
        {
            GoTo("static");

            bool result;

            using (StopwatchAsserter.WithinSeconds(0, .6))
                result = Driver.Try().MissingAll(_missingElementBy, _anotherMissingElementBy);

            Assert.That(result, Is.True);
        }
Ejemplo n.º 13
0
        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);
        }
Ejemplo n.º 14
0
        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);
        }
Ejemplo n.º 15
0
        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);
        }
Ejemplo n.º 16
0
        public void ExtendedSearchContext_Get_Immediate()
        {
            GoTo("static");

            IWebElement element;

            using (StopwatchAsserter.WithinSeconds(0, .3))
                element = Driver.Get(_existingElementBy);

            Assert.That(element, Is.Not.Null);
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        public void ExtendedSearchContext_Missing()
        {
            GoTo("static");

            bool result;

            using (StopwatchAsserter.WithinSeconds(0, .3))
                result = Driver.Try().Missing(missingElementBy.Safely());

            Assert.That(result, Is.True);
        }