Exemple #1
0
        public override void Body()
        {
            ActualResult = QAliber.RemotingModel.TestCaseResult.Failed;

            UIControlBase c = UIControlBase.FindControlByPath(control);

            if (!c.Exists)
            {
                ActualResult = QAliber.RemotingModel.TestCaseResult.Failed;
                Log.Error("Control not found");
                return;
            }

            IScrollItemPattern pattern = c.GetControlInterface <IScrollItemPattern>();

            if (pattern != null && _scrollIntoView)
            {
                pattern.ScrollIntoView();
            }

            LowLevelInput.PressKeys(_modifierKeys);
            c.Click(button, point);
            LowLevelInput.ReleaseKeys(_modifierKeys);

            ActualResult = QAliber.RemotingModel.TestCaseResult.Passed;
        }
Exemple #2
0
        public override void Body()
        {
            ActualResult = QAliber.RemotingModel.TestCaseResult.Failed;

            UIControlBase c = UIControlBase.FindControlByPath(control);

            if (!c.Exists)
            {
                Log.Error("Start control not found.");
                return;
            }

            IScrollItemPattern pattern = c.GetControlInterface <IScrollItemPattern>();

            if (pattern != null && _scrollIntoView)
            {
                pattern.ScrollIntoView();
            }

            if (!c.Visible)
            {
                Log.Error("Start control not visible.");
                return;
            }

            Point point2 = _point2;

            if (!string.IsNullOrEmpty(_endControl))
            {
                UIControlBase endControl = UIControlBase.FindControlByPath(_endControl);

                if (!endControl.Exists)
                {
                    Log.Error("End control not found.");
                    return;
                }

                pattern = endControl.GetControlInterface <IScrollItemPattern>();

                if (pattern != null && _scrollIntoView)
                {
                    pattern.ScrollIntoView();
                }

                if (!endControl.Visible)
                {
                    Log.Error("End control not visible.");
                    return;
                }

                // Figure out end coordinate relative to begin coord
                Vector offset = endControl.Layout.TopLeft - c.Layout.TopLeft;
                point2 += offset;
            }

            LowLevelInput.PressKeys(_modifierKeys);
            c.Drag(button, point1, point2);
            LowLevelInput.ReleaseKeys(_modifierKeys);

            ActualResult = TestCaseResult.Passed;
        }
Exemple #3
0
 /// <summary>
 /// Scrolls the element into view.
 /// </summary>
 public virtual ListBoxItem ScrollIntoView()
 {
     ScrollItemPattern?.ScrollIntoView();
     return(this);
 }