Ejemplo n.º 1
0
        public static SearchCondition CreateForControlType(Type testControlType, WindowsFramework framework)
        {
            if (testControlType.IsCustomType())
                return CreateForControlType(CustomControlTypeMapping.ControlType(testControlType, framework));
            var controlTypes = ControlDictionary.Instance.GetControlType(testControlType, framework.FrameworkId());
            if (controlTypes.Length == 1)
                return CreateForControlType(controlTypes[0]);

            return new OrSearchCondition(controlTypes.Select(CreateForControlType).ToArray());
        }
Ejemplo n.º 2
0
 void FindNode(WindowsFramework framework)
 {
     Assert.True(tree.HasNode("Root"));
     Assert.False(tree.HasNode("Roo"));
     Assert.True(tree.HasNode("Main"));
     Assert.True(tree.HasNode("Root", "Child"));
     Assert.True(tree.HasNode("Root", "Child", "Grand Child"));
     var exception = Assert.Throws<AutomationException>(() => tree.HasNode("Root", "Child", "Grand Child", "Grand Child"));
     string expected = string.Format(
         "Cannot expand TreeNode {0}TreeNode. AutomationId:, Name:Grand Child, " +
         "ControlType:tree view item, FrameworkId:{1}, expand button not visible",
         framework == WindowsFramework.Wpf ? "WPF" : "Win32",
         framework.FrameworkId());
     Assert.Equal(expected, exception.Message);
 }
Ejemplo n.º 3
0
        void FindNode(WindowsFramework framework)
        {
            Assert.True(tree.HasNode("Root"));
            Assert.False(tree.HasNode("Roo"));
            Assert.True(tree.HasNode("Main"));
            Assert.True(tree.HasNode("Root", "Child"));
            Assert.True(tree.HasNode("Root", "Child", "Grand Child"));
            var    exception = Assert.Throws <AutomationException>(() => tree.HasNode("Root", "Child", "Grand Child", "Grand Child"));
            string expected  = string.Format(
                "Cannot expand TreeNode {0}TreeNode. AutomationId:, Name:Grand Child, " +
                "ControlType:tree view item, FrameworkId:{1}, expand button not visible",
                framework == WindowsFramework.Wpf ? "WPF" : "Win32",
                framework.FrameworkId());

            Assert.Equal(expected, exception.Message);
        }
Ejemplo n.º 4
0
 public virtual SearchCriteria AndOfFramework(WindowsFramework framework)
 {
     conditions.Insert(0, SearchConditionFactory.CreateForFrameworkId(framework.FrameworkId()));
     return(this);
 }
 protected override void ExecuteTestRun(WindowsFramework framework)
 {
     RunTest(()=>TestToString(framework.FrameworkId()));
 }
Ejemplo n.º 6
0
 SearchCriteria Criteria()
 {
     return(SearchCriteria.ByFramework(framework.FrameworkId()).AndByText("MainWindow"));
 }
Ejemplo n.º 7
0
        public static SearchCondition CreateForControlType(Type testControlType, WindowsFramework framework)
        {
            if (testControlType.IsCustomType())
            {
                return(CreateForControlType(CustomControlTypeMapping.ControlType(testControlType, framework)));
            }
            var controlTypes = ControlDictionary.Instance.GetControlType(testControlType, framework.FrameworkId());

            if (controlTypes.Length == 1)
            {
                return(CreateForControlType(controlTypes[0]));
            }

            return(new OrSearchCondition(controlTypes.Select(CreateForControlType).ToArray()));
        }
Ejemplo n.º 8
0
 public virtual SearchCriteria AndOfFramework(WindowsFramework framework)
 {
     conditions.Insert(0, SearchConditionFactory.CreateForFrameworkId(framework.FrameworkId()));
     return this;
 }
 protected override void ExecuteTestRun(WindowsFramework framework)
 {
     RunTest(() => TestToString(framework.FrameworkId()));
 }