示例#1
0
        public Test(JArray steps)
        {
            _testSteps = new List <ITestStep>();

            for (int i = 0; i < steps.Count; i++)
            {
                _testSteps.Add(ITestStep.CreateTestStep((JObject)steps[i]));
            }
        }
示例#2
0
        public static ITestStep CreateTestStep(JObject step)
        {
            string testType = (string)step["testType"];

            TestStepType type = ITestStep.ParseTestStepType(testType);

            ITestStep testStep = null;

            switch (type)
            {
            case TestStepType.CLICK:
                testStep = new ClickTestStep(step);
                break;

            case TestStepType.INPUT:
                testStep = new InputTestStep(step);
                break;

            case TestStepType.SUBMIT:
                testStep = new SubmitTestStep(step);
                break;

            case TestStepType.TAP:
                testStep = new TapTestStep(step);
                break;

            case TestStepType.SWIPE:
                testStep = new SwipeTestStep(step);
                break;

            default:
                break;
            }

            testStep._testStepType = type;
            testStep._stepName     = (string)step["stepName"];

            return(testStep);
        }
示例#3
0
 public void AddTestStep(ITestStep step)
 {
     Test.TestSteps.Add(step);
 }
示例#4
0
 public void AddTestStep(JObject step)
 {
     Test.TestSteps.Add(ITestStep.CreateTestStep(step));
 }