Example #1
0
        public void ButtonToAutomationElementTest()
        {
            ObjectDescriptor descriptor = ObjectDescriptor.FromJson(
                @"
                 {
			        ntype: ""uia"",
			        nname: ""button1"",
			        ""identifyProperties"": {
                        ""name"": ""1""
                    }
			        description: ""button""
		        }"        );

            UIATestObject testObject = UIATestObject.ToTestObject(descriptor);

            testObject.TryInvoke();
        }
        public void UIACondition_CachedProperties()
        {
            ObjectDescriptor descriptor = ObjectDescriptor.FromJson(
                @"
                 {
			        ntype: ""uia"",
			        nname: ""button1"",
			        identifyProperties:{""name"": ""1""},
                    cachedProperties:{""className"": ""QWidget""},
			        description: ""button""
		        }"        );

            UIATestObject testObject = UIATestObject.ToTestObject(descriptor);

            CachedPropertyGroup cachedGroup = testObject.GetContext <CachedPropertyGroup>();

            Assert.AreNotEqual(null, cachedGroup);

            UIACondition condition = new UIACondition(testObject);

            Assert.AreEqual(1, condition.CachedProperties.Count);
        }