Exemplo n.º 1
0
 public ClickAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Click = GetAttributeValue<bool>("click");
     this.ClickNew = GetAttributeValue<bool>("clicknew");
     this.MouseClick = GetAttributeValue<bool>("mouseclick");
 }
Exemplo n.º 2
0
 public ScrollAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Position = GetAttributeValue<Position>("position");
     this.Offset = GetAttributeValue<int>("offset");
     this.Period = GetAttributeValue<int>("period", 500);
     this.Factor = GetAttributeValue<int>("factor", 0);
 }
Exemplo n.º 3
0
        public TextAction(AutomationAction automationActionData)
            : base(automationActionData)
        {
            this.Attrbute = this.GetAttributeValue<string>("text_attr");
            this.AttrbuteRegex = this.GetAttributeValue<string>("text_attr_regex");

            this.TextSaveKey = this.GetAttributeValue<string>("textSaveDatakey");
            this.TextGetKey = this.GetAttributeValue<string>("textGetDatakey");
        }
Exemplo n.º 4
0
        public void Add(AutomationAction action)
        {
            if (this.ActionList == null)
            {
                this.ActionList = new List<AutomationAction>();
            }

            this.ActionList.Add(action);
        }
Exemplo n.º 5
0
        public void Test_LoadBrowserAction()
        {
            AutomationAction actionConfig = new AutomationAction();
            actionConfig.Type = "Mouse";
            IAction action = ClassLoader.LoadAction(actionConfig);

            Assert.IsNotNull(action);
            Assert.AreEqual(action.ActionType, ActionType.MouseAction);
        }
Exemplo n.º 6
0
 public MouseAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Click = GetAttributeValue<bool>("click");
     this.ClickNew = GetAttributeValue<bool>("clicknew");
     this.MouseClick = GetAttributeValue<bool>("mouseclick");
     this.Over = GetAttributeValue<bool>("over");
     this.OverNew = GetAttributeValue<bool>("overnew");
     this.Down = GetAttributeValue<bool>("down");
     this.Up = GetAttributeValue<bool>("up");
     this.Focus = GetAttributeValue<bool>("focus");
     this.Move = GetAttributeValue<bool>("move");
     this.MoveNew = GetAttributeValue<bool>("movenew");
     this.MoveEnter = GetAttributeValue<bool>("moveenter");
 }
        public void Test_LoadConfig()
        {
            AutomationAction action = new AutomationAction();
            action.Type = "Mouse";

            AutomationAction childAction = new AutomationAction();
            childAction.Type = "Mouse";
            action.AddChild(childAction);

            AutomationStep step = new AutomationStep();
            step.Name = "First";
            step.Description = "test";
            step.Add(action);

            WebAutomationConfig config = new WebAutomationConfig();
            config.Add(step);

            AutomationManagement manager = new AutomationManagement();
            manager.LoadConfig(config);
        }
Exemplo n.º 8
0
        public FindAction(AutomationAction automationActionData)
            : base(automationActionData)
        {
            this.Combine = GetAttributeValue<bool>("combine");
            this.Contains = GetAttributeValue<bool>("contains");
            this.WildCard = GetAttributeValue<bool>("wildcard");
            this.Trim = GetAttributeValue<bool>("trim");

            this.ID = GetAttributeValue<string>("id");
            this.Name = GetAttributeValue<string>("name");
            this.ClassName = GetAttributeValue<string>("class");
            this.TagName = GetAttributeValue<string>("tagname");
            this.Type = GetAttributeValue<string>("type");
            this.Title = GetAttributeValue<string>("title");
            this.Url = GetAttributeValue<string>("href");
            this.InnerText = GetAttributeValue<string>("innertext");

            this.Index = GetAttributeValue<int>("index", -1);

            this.XPath = GetAttributeValue<string>("xpath");

            List<string> embedAttrbuteList = GetAttributeValueStartWith<string>("embed_");
            if (embedAttrbuteList != null && embedAttrbuteList.Count > 0)
            {
                this.EmbedAttribute = new Dictionary<string, string>();
                foreach (string str in embedAttrbuteList)
                {
                    int index = str.IndexOf(":");
                    if (index != -1)
                    {
                        string key = str.Substring(0, index);
                        string value = str.Substring(index + 1, str.Length - index - 1);

                        this.EmbedAttribute.Add(key, value);
                    }
                }
            }
        }
Exemplo n.º 9
0
        public void Test_ConfigurationSerialize()
        {
            WebAutomationConfig config = new WebAutomationConfig();
            config.Name = "Test1";
            config.Version = "0.1";

            AutomationStep step = new AutomationStep();
            step.Name = "aaa";
            step.ActionList = new System.Collections.Generic.List<AutomationAction>();

            config.Add(step);

            AutomationAction action = new AutomationAction();
            action.Type = "Wait";

            AutomationActionAttribute attr = new AutomationActionAttribute();
            attr.Name = "name";
            attr.Value = "value";
            action.Add(attr);

            AutomationAction childAction = new AutomationAction();
            childAction.Type = "Click";
            childAction.Add(attr);

            action.AddChild(childAction);
            step.Add(action);

            WebAutomationConfig.Save(config);

            WebAutomationConfig loadConfig = WebAutomationConfig.Load();

            Assert.IsNotNull(loadConfig);
            Assert.AreEqual(loadConfig.Name, config.Name);
            Assert.AreEqual(loadConfig.StepList.Count, config.StepList.Count);
            Assert.AreEqual(loadConfig.StepList[0].Name, config.StepList[0].Name);
        }
Exemplo n.º 10
0
 public ClearDataAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
 }
Exemplo n.º 11
0
 public SendKeyAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Keys = GetAttributeValueStartWith<string>("sendkey_");
 }
Exemplo n.º 12
0
        private void LoadConditionAction(IAction action, AutomationAction actionData)
        {
            if (actionData.ConditionActionList != null && actionData.ConditionActionList.Count > 0)
            {
                foreach (AutomationAction childData in actionData.ConditionActionList)
                {
                    if (!childData.Enabled)
                    {
                        continue;
                    }

                    IAction childAction = ConvertToAction(childData);
                    if (action.ConditoinAction == null)
                    {
                        action.ConditoinAction = new List<IAction>();
                    }
                    action.ConditoinAction.Add(childAction);

                    LoadConditionAction(childAction, childData);
                }
            }
        }
Exemplo n.º 13
0
 private IAction ConvertToAction(AutomationAction actionData)
 {
     return ClassLoader.LoadAction(actionData);
 }
Exemplo n.º 14
0
 public BrowserAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Name = GetAttributeValue<string>("name");
     this.Url = GetAttributeValue<string>("url");
 }
Exemplo n.º 15
0
 public ConditionAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
 }
Exemplo n.º 16
0
 public static void Debug(AutomationAction AutomationActionData)
 {
     System.Diagnostics.Debug.WriteLine(AutomationActionData.ToString());
 }
Exemplo n.º 17
0
        public void AddChild(AutomationAction childAction)
        {
            if (this.ChildActionList == null)
            {
                this.ChildActionList = new List<AutomationAction>();
            }

            this.ChildActionList.Add(childAction);
        }
Exemplo n.º 18
0
 public WaitAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Seconds = GetAttributeValue<int>("seconds");
     this.Milliseconds = GetAttributeValue<int>("milliseconds");
 }
Exemplo n.º 19
0
 public ClearHistoryAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.ClearHistoryType = GetAttributeValue<ClearHistoryType>("type");
 }
Exemplo n.º 20
0
 public PageAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.MaxPageIndex = this.GetAttributeValue<int>("max", 10);
 }
Exemplo n.º 21
0
 public KeyboardAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.KeyDown = GetAttributeValue<bool>("keydown");
     this.KeyUp = GetAttributeValue<bool>("keyup");
 }
Exemplo n.º 22
0
 public TimerAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.Seconds = GetAttributeValue<int>("seconds");
 }
Exemplo n.º 23
0
 public ScriptAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
     this.ScriptContent = GetAttributeValue<string>("script");
 }
Exemplo n.º 24
0
 public PackageAction(AutomationAction automationActionData)
     : base(automationActionData)
 {
 }