Esempio n. 1
0
        public void WpfDemoControlSearchOnBooleanCriteriaTest()
        {
            UiAutomationFixture.SearchBy("Tooltip");
            Assert.IsTrue(_fixture.SelectItem("Caption:Usual Controls"), "Select 'Usual Controls' tab");
            var control1 = _fixture.GetControl("ControlType:CheckBox && IsEnabled:false");

            Assert.IsNotNull(control1.AutomationElement, "Found a disabled checkbox");
            Assert.AreEqual("Disabled CheckBox", _fixture.NameOfControl("ControlType:CheckBox && IsEnabled:false"),
                            "Found right (only) disabled control");
            Assert.AreEqual("DisabledCheckBox", control1.AutomationElement.CurrentAutomationId, "Found right (only) disabled control");
            Assert.IsTrue(_fixture.SelectItem("Caption:More Controls"), "Select 'More Controls' tab");
            var control2 = _fixture.GetControl("IsPassword:true");

            Assert.IsNotNull(control2.AutomationElement, "Found a password control");
            Assert.AreEqual("PasswordBox1", control2.AutomationElement.CurrentAutomationId, "Found right (only) password control");
        }