Ejemplo n.º 1
0
        public void ShouldListTodos()
        {
            NgDriver.Navigate().GoToUrl("http://www.angularjs.org");
            var elements = NgDriver.FindElements(NgBy.Repeater("todo in todoList.todos"));

            Assert.AreEqual("build an AngularJS app", elements[1].Text.Trim());
            Assert.AreEqual(false, elements[1].Evaluate("todo.done"));
        }
Ejemplo n.º 2
0
 public bool SetElements(By by)
 {
     try
     {
         NgElements = new List <NgWebElement>();
         foreach (var element in NgDriver.FindElements(by))
         {
             NgElements.Add(new NgWebElement(NgDriver, element, by));
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        public AngularDirectivePage ClickAngularDirective()
        {
            //This line is needed in order the NgDriver to know that this is going to be an Angular page
            //Going forward we will re-factor this.
            NgWebDriver ngDriver = new NgWebDriver(NgDriver.WrappedDriver, "[ng-app='docsApp']");

            IList <NgWebElement> eList = NgDriver.FindElements(NgBy.Repeater("navItem in navGroup.navItems"));

            foreach (NgWebElement ngWebElement in eList.Where(ngWebElement => ngWebElement.FindElement(By.XPath("//a[.='directive']")).Displayed))
            {
                ngWebElement.Click();
                break;
            }

            return(new AngularDirectivePage(ngDriver));
        }