Esempio n. 1
0
        public void Child_DeepNode()
        {
            var path = "/Window[@Name='Generate User Key']/Button[@name='OK']/Text[@name='OK']";

            Assert.AreEqual(ControlType.Pane, AutomationElement.RootElement.Current.ControlType);
            var e = AutomationElement.RootElement.FindByWPath(path);

            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);

            path = "/Button[@name = 'OK']/Text[@name='OK']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);

            path = "/Button[@name = 'OK' ]/Text[@name='OK']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);

            path = "/Button[@name = 'OK']/Text[@name = 'OK']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);

            path = "/Button[@name='OK']/Text[@name='OK']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);
        }
Esempio n. 2
0
 public void AssertIndexPage()
 {
     PageContentElement            = AppElement.FindElement(By.CssSelector("div.pageContent"));
     PlanningPokerContainerElement = PageContentElement.FindElement(By.CssSelector("div.planningPokerContainer"));
     ContainerElement = PlanningPokerContainerElement.FindElement(By.XPath("./div[@class='container']"));
     CreateTeamForm   = ContainerElement.FindElement(By.CssSelector("form[name='createTeam']"));
     JoinTeamForm     = ContainerElement.FindElement(By.CssSelector("form[name='joinTeam']"));
 }
Esempio n. 3
0
        public void Child_OrProperty()
        {
            var path = "/Edit[@id='txtId' or @Class='TextBox']";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);
        }
Esempio n. 4
0
        public void Child_AttributeOnly()
        {
            var path = "/[@Name='ID: ']";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("ID: ", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);
        }
Esempio n. 5
0
        public void Descendants_Attribute()
        {
            var path = "//Text[@name='OK']";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);
        }
Esempio n. 6
0
        public void ChildLast()
        {
            var path = "/Edit[last()]";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("txtPlace", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);
        }
Esempio n. 7
0
        public void Child_AsDescendants()
        {
            var path = "//Edit[@name='test' or @id='test' or @enabled='true']";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "//Edit[@name='test' or @id='txtId' and @enabled='true']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "//Edit[@id='txtId' and @enabled='true' and @framework='WPF']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);
        }
Esempio n. 8
0
        public void Chlid_MultipleAttribute_WithoutType()
        {
            var path = "/[@name='test' or @id='test' or @enabled='true']";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("TitleBar", e.Current.AutomationId);
            Assert.AreEqual(ControlType.TitleBar, e.Current.ControlType);

            path = "/[@name='test' or @id='txtId' and @enabled='true']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "/[@id='txtId' and @enabled='true' and @framework='WPF']";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);
        }
Esempio n. 9
0
        public void Child_First()
        {
            var path = "/Edit[first()]";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "/Button[first()]";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("...", e.Current.Name);
            Assert.AreEqual(ControlType.Button, e.Current.ControlType);

            path = "/Text[first()]";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("ID: ", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);
        }
Esempio n. 10
0
        public void Child_Index()
        {
            var path = "/Edit[1]";
            var e    = AppElement.FindByWPath(path);

            Assert.AreEqual("txtId", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "/Edit[2]";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("txtPassword", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "/Edit[3]";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("txtPlace", e.Current.AutomationId);
            Assert.AreEqual(ControlType.Edit, e.Current.ControlType);

            path = "/Button[@name='OK']/Text[1]";
            e    = AppElement.FindByWPath(path);
            Assert.AreEqual("OK", e.Current.Name);
            Assert.AreEqual(ControlType.Text, e.Current.ControlType);
        }
Esempio n. 11
0
 public AutomationElement GetFirstButton()
 {
     return(AppElement.FindByWPath());
 }
Esempio n. 12
0
 public AppElementViewModel(AppElement element, TreeViewItemViewModel parent)
     : base(parent, true)
 {
     _element = element;
 }