Пример #1
0
        /// <summary>
        /// Initialize the TestExecutionContext. This must be done
        /// before executing the WorkItem.
        /// </summary>
        /// <remarks>
        /// Originally, the context was provided in the constructor
        /// but delaying initialization of the context until the item
        /// is about to be dispatched allows changes in the parent
        /// context during OneTimeSetUp to be reflected in the child.
        /// </remarks>
        /// <param name="context">The TestExecutionContext to use</param>
        public void InitializeContext(TestExecutionContext context)
        {
            Guard.OperationValid(_context == null, "The context has already been initialized");

            _context = context;

            if (Test is TestAssembly)
            {
                _actions.AddRange(ActionsHelper.GetActionsFromAttributeProvider(((TestAssembly)Test).Assembly));
            }
            else if (Test is ParameterizedMethodSuite)
            {
                _actions.AddRange(ActionsHelper.GetActionsFromAttributeProvider(Test.Method.MethodInfo));
            }
            else if (Test.TypeInfo != null)
            {
                _actions.AddRange(ActionsHelper.GetActionsFromTypesAttributes(Test.TypeInfo.Type));
            }
        }
Пример #2
0
        private (Actions action, string[] args) ParseCommandLine(string command)
        {
            var match = commandLineRegex_.Match(command);

            if (!match.Success)
            {
                return(Actions.Unrecognized, new string[] { });
            }

            var action    = match.Groups["action"].Value;
            var arguments = match.Groups["args"].Value;
            var args      = CommandLineHelper.SplitArgs(arguments);

            if (!ActionsHelper.TryParseEnum(action, out var cmd))
            {
                return(Actions.Unrecognized, new string[] { });
            }

            return(cmd, args);
        }
Пример #3
0
        public virtual void DBClick(int x = -1, int y = -1)
        {
            ActionsHelper actionsHelper = ActionsHelper.getInstance();

            actionsHelper.DBClick(RelayObject.SEWebElement, x, y);
        }
Пример #4
0
        public virtual void TypeText(string Text)
        {
            ActionsHelper actionsHelper = ActionsHelper.getInstance();

            actionsHelper.TypeText(RelayObject.SEWebElement, Text);
        }
Пример #5
0
        public virtual void ClearValue()
        {
            ActionsHelper actionsHelper = ActionsHelper.getInstance();

            actionsHelper.ClearValue(RelayObject.SEWebElement);
        }
Пример #6
0
        public virtual void MarkText(int start, int end)
        {
            ActionsHelper actionsHelper = ActionsHelper.getInstance();

            actionsHelper.MarkText(RelayObject.SEWebElement, start, end);
        }
Пример #7
0
        public virtual void MarkText(string markText)
        {
            ActionsHelper actionsHelper = ActionsHelper.getInstance();

            actionsHelper.MarkText(RelayObject.SEWebElement, markText);
        }