Example #1
0
        public void BasicIsDislayed()
        {
            //Basic Examples is expanded
            Assert.AreEqual("true", _driver.FindElement(toggleBasic).GetAttribute("aria-expanded"));

            var wait    = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));
            var element = wait.Until(WebDriverHelper.GetElementOnceVisible(paneBasic));

            //Header is correct
            Assert.AreEqual("BASIC EXAMPLES TO START WITH SELENIUM", element.FindElement(By.ClassName("head")).Text);

            //Practise components are displayed as expected
            var demoComponents = element.FindElements(By.ClassName("list-group-item"));
            //TODO: Context injection for execpted components?
            var expectedComponents = new List <string> {
                "Simple Form Demo", "Check Box Demo", "Radio Buttons Demo", "Select Dropdown List", "Javascript Alerts", "Window Popup Modal", "Bootstrap Alerts", "Bootstrap Modals"
            };
            var actualComponents = new List <string>();

            foreach (var item in demoComponents)
            {
                var text = item.Text;
                actualComponents.Add(text);
            }

            Assert.AreEqual(expectedComponents, actualComponents);
        }