Exemplo n.º 1
0
        private void ClickActions(IClick Element, eElementAction ClickElementAction)
        {
            switch (ClickElementAction)
            {
            case eElementAction.Click:
                Element.Click();
                break;

            case eElementAction.JavaScriptClick:
                Element.JavascriptClick();
                break;

            case eElementAction.MouseClick:

                Element.MouseClick();
                break;

            case eElementAction.Select:
                Element.DoubleClick();
                break;

            case eElementAction.ClickAndValidate:

                string         ValidationType = (string)InputParams["ValidationType"];
                string         mClickType     = (string)InputParams["ClickType"];
                eElementAction ClickType      = (eElementAction)Enum.Parse(typeof(eElementAction), mClickType);

                ClickActions(Element, ClickType);
                IGingerWebElement ValidationElement = GetValidationElement();


                if ("IsVisible".Equals(ValidationType))
                {
                    if (ValidationElement.IsVisible())
                    {
                        ExecutionInfo = "Validation element is Visible";
                    }
                    else
                    {
                        Error = "Validation Element is not visble";
                    }
                }
                else if ("IsEnabled".Equals(ValidationType))
                {
                    if (ValidationElement.IsEnabled())
                    {
                        ExecutionInfo = "Validation element is Enabled";
                    }
                    else
                    {
                        Error = "Validation Element is not Enabled";
                    }
                }
                break;
            }
        }
Exemplo n.º 2
0
        public int Count(TimeSpan ts)
        {
            if (ts > this.KeepClicksFor)
            {
                throw new ArgumentException("Can not count for a timespan more than what clicker is keeping track of");
            }

            long       ticksWhen = DateTime.UtcNow.Ticks - ts.Ticks;
            int        count     = 0;
            IClick <V> cur       = this.m_head;

            while (null != cur && cur.When >= ticksWhen)
            {
                count++;
                cur = cur.Next;
            }
            return(count);
        }
Exemplo n.º 3
0
        private void Trim()
        {
            // trim keeps the head.
            long       ticksWhen = DateTime.UtcNow.Ticks - this.KeepClicksFor.Ticks;
            IClick <V> cur       = this.m_head;
            IClick <V> next      = cur.Next;

            while (null != next)
            {
                if (next.When <= ticksWhen)
                {
                    cur.Next = null;
                    break;
                }
                cur  = next;
                next = next.Next;
            }

            // call on trim
            if (this.m_OnTrimChanged)
            {
                this.OnTrim(this.CloneInTimeSpan(this.KeepClicksFor));
            }
        }
Exemplo n.º 4
0
 public RunReport(IClick report, FillType fillType)
 {
     _report   = report;
     _fillType = fillType;
 }
Exemplo n.º 5
0
 public void Click(IClick click)
 {
     ApplyAutoDelay();
     click.ExecuteClick(new MouseContext(GetMousePosition()));
 }