Exemplo n.º 1
0
        public void StartTwoInstances()
        {
            var propertyExpression = new PropertyExpression(AutomationElement.AutomationIdProperty, Constants.ID_METL_MAIN_WINDOW);
            foreach (var i in Enumerable.Range(0,2))
            {
                var metl = new UITestHelper(UITestHelper.RootElement, MeTL.StartProcess());
                metl.SearchProperties.Add(propertyExpression);

                var success = metl.WaitForControlEnabled();
                Assert.IsTrue(success, ErrorMessages.EXPECTED_MAIN_WINDOW);
            }

            var desktopBounds = AutomationElement.RootElement.Current.BoundingRectangle;
            var windows = MeTL.GetAllMainWindows(2, true);
            Assert.AreEqual(2, windows.Count);

            // move each window into position
            var windowCount = 0;
            foreach (AutomationElement window in windows)
            {
                var windowPattern = window.GetCurrentPattern(WindowPattern.Pattern) as WindowPattern;
                windowPattern.SetWindowVisualState(WindowVisualState.Normal);

                var transformPattern = window.GetCurrentPattern(TransformPattern.Pattern) as TransformPattern;
                transformPattern.Resize(desktopBounds.Width, desktopBounds.Height / 2);
                transformPattern.Move(0, (desktopBounds.Height / 2) * windowCount++);
            }
        }
        public void WaitUntilConversationJoined(AutomationElement parent)
        {
            // wait until we've finished joining the conversation before returning
            var canvasStack = new UITestHelper(parent);
            canvasStack.SearchProperties.Add(new PropertyExpression(AutomationElement.ClassNameProperty, typeof(SandRibbon.Components.CollapsedCanvasStack).Name));
            var success = canvasStack.WaitForControlEnabled();

            Assert.IsTrue(success, ErrorMessages.WAIT_FOR_CONTROL_FAILED);
        }
Exemplo n.º 3
0
        public void StartOneInstance()
        {
            Assert.AreEqual(0, MeTL.GetAllMainWindows().Count);

            var metl = new UITestHelper(UITestHelper.RootElement, MeTL.StartProcess());
            metl.SearchProperties.Add(new PropertyExpression(AutomationElement.AutomationIdProperty, Constants.ID_METL_MAIN_WINDOW));

            var success = metl.WaitForControlEnabled();
            Assert.IsTrue(success, ErrorMessages.EXPECTED_MAIN_WINDOW);
        }
 public void WaitForControlEnabledTest()
 {
     UITestHelper target = new UITestHelper(); // TODO: Initialize to an appropriate value
     string controlAutomationId = string.Empty; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.WaitForControlEnabled();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }