示例#1
0
        public void ByText_Many_Matches()
        {
            SetUp();

            var resultList = Driver.FindElements(ByExtension.Text("List item"));

            Assert.AreEqual(8, resultList.Count);
        }
示例#2
0
        public void ByText_One_Of_Many()
        {
            SetUp();

            var expectedElement = Driver.FindElement(By.Id("firstLi"));
            var resultElement   = Driver.FindElement(ByExtension.Text("List item"));

            Assert.AreEqual(expectedElement, resultElement);
        }
示例#3
0
        public void ByText_Simple_Crossbrowser(string driver)
        {
            SetUp(driver);

            var expectedElement = Driver.FindElement(By.Id("secondH2"));
            var resultElement   = Driver.FindElement(ByExtension.Text("sub-heading"));

            Assert.AreEqual(expectedElement, resultElement);
        }
示例#4
0
        public void ByText_Returns_Innermost_Element()
        {
            SetUp();

            var bothElements = Driver.FindElements(ByExtension.Text("Page 1"));
            var oneElement   = Driver.FindElement(ByExtension.Text("Page 1"));

            Assert.AreEqual(2, bothElements.Count);
            Assert.AreEqual("a", oneElement.TagName);
        }
示例#5
0
        public void ByText_Case_Sensitivity_Simple()
        {
            SetUp();

            var caseSentsitiveList = Driver.FindElements(ByExtension.Text("list item", StringComparison.InvariantCulture));

            Assert.AreEqual(0, caseSentsitiveList.Count);

            var caseInsentsitiveList = Driver.FindElements(ByExtension.Text("list item", StringComparison.InvariantCultureIgnoreCase));

            Assert.AreEqual(8, caseInsentsitiveList.Count);
        }