Ejemplo n.º 1
0
        public void TestElementExistsCheckWhenDisplayedReturnsTrue()
        {
            var element = new Mock <IWebElement>(MockBehavior.Strict);

            element.SetupGet(e => e.Displayed).Returns(true);

            var nativePage = new NativePage();
            var page       = new SeleniumPage(nativePage, null);

            var result = page.ElementExistsCheck(element.Object);

            Assert.AreEqual(true, result);
            element.VerifyAll();
        }
Ejemplo n.º 2
0
        public void TestElementExistsCheckWhenElementNotVisibleExceptionReturnsFalse()
        {
            var element = new Mock <IWebElement>(MockBehavior.Strict);

            element.SetupGet(e => e.Displayed).Throws <ElementNotVisibleException>();

            var nativePage = new NativePage();
            var page       = new SeleniumPage(nativePage, null);

            var result = page.ElementExistsCheck(element.Object);

            Assert.AreEqual(false, result);
            element.VerifyAll();
        }
Ejemplo n.º 3
0
        public void TestElementExistsCheckWhenDisplayedReturnsTrue()
        {
            var element = new Mock<IWebElement>(MockBehavior.Strict);
            element.SetupGet(e => e.Displayed).Returns(true);

            var nativePage = new NativePage();
            var page = new SeleniumPage(nativePage);

            var result = page.ElementExistsCheck(element.Object);

            Assert.AreEqual(true, result);
            element.VerifyAll();
        }
Ejemplo n.º 4
0
        public void TestElementExistsCheckWhenElementNotVisibleExceptionReturnsFalse()
        {
            var element = new Mock<IWebElement>(MockBehavior.Strict);
            element.SetupGet(e => e.Displayed).Throws<ElementNotVisibleException>();

            var nativePage = new NativePage();
            var page = new SeleniumPage(nativePage);

            var result = page.ElementExistsCheck(element.Object);

            Assert.AreEqual(false, result);
            element.VerifyAll();
        }