Ejemplo n.º 1
0
        private StepConfig processElement(XElement el)
        {
            var action = el.Element("command").Value;
            var target = el.Element("target").Value;
            var value  = el.Element("value").Value;

            IScriptActionConfig scriptAction = null;
            IPath path = getPath(target);

            switch (action)
            {
            case "logMessage":
                scriptAction = new LogMessageActionConfig()
                {
                    Message = value
                };
                break;

            case "submit":
                scriptAction = new FormSubmitActionConfig()
                {
                    Target = path
                };
                break;

            case "click":
                scriptAction = new ClickActionConfig()
                {
                    Target = path
                };
                break;

            case "type":
                scriptAction = new EnterTextActionConfig()
                {
                    Text   = value,
                    Target = path
                };
                break;

            case "special":
                scriptAction = new EnterTextActionConfig()
                {
                    Text   = value,
                    Target = path
                };
                break;
            }

            IScriptExpectConfig scriptExpects = null;

            switch (action.ToLower())
            {
            case "doubleclick":
                scriptExpects = parseExpects(target, value);
                break;

            case "verifytext":
            case "elementtext":
                scriptExpects = new ElementTextExpectConfig()
                {
                    MatchType = StringMatchTypes.ContainsCaseInsensative,
                    Target    = path,
                    Text      = value
                };
                break;
            }

            return(new StepConfig()
            {
                Expectations = new List <IScriptExpectConfig>()
                {
                    scriptExpects
                },
                Actions = new List <IScriptActionConfig>()
                {
                    scriptAction
                }
            });
        }
Ejemplo n.º 2
0
 public FormSubmitActionRuntime(FormSubmitActionConfig config) : base(config)
 {
     ExplicitWait = config.ExplicitWait;
 }