コード例 #1
0
ファイル: StepProcessor.cs プロジェクト: karthik-kt/SWAT-Main
 private void TestCaseStart(TestSteps testSteps)
 {
     TestCaseId = Int32.Parse((testSteps.DataReference.Split('_')[0]));
     TestStepStatus.Clear();
     TestCaseStartIndex = testSteps.Index;
     TestStepStatus.Add(Constants.ResultStatus_Passed);
     testSteps.ActualResult = "";
 }
コード例 #2
0
ファイル: StepProcessor.cs プロジェクト: karthik-kt/SWAT-Main
 public void TestStepProcessor(TestSteps testSteps)
 {
     try
     {
         if (!ProcessStepRunOption(testSteps.Option))
         {
             return;
         }
         string actualResult  = "NotExecuted";
         string stepResult    = Constants.ResultStatus_Failed;
         int    numberOfRetry = 1;
         if (testSteps.Action.ToUpper() == "TESTCASE.START")
         {
             //ToDo : Testcases without id.
             TestCaseStart(testSteps);
             return;
         }
         if (testSteps.Action.ToUpper() == "TESTCASE.STOP")
         {
             TestCaseStop(testSteps);
             return;
         }
         string[] arraction = testSteps.Action.Split('.');
         TestData.GetData(testSteps.DataReference);
         do
         {
             if (arraction[0] == Constants.Bazooka)
             {
                 var keywords = new Keyword(TestStartInfo);
                 actualResult = keywords.ExecuteTestStep(testSteps.Action, TestData);
             }
             else
             {
                 var KeyWords = new ClawKeyword(TestStartInfo, testSteps.DataReference);
                 actualResult = KeyWords.ExecuteTestStep(testSteps.Action, TestData);
             }
             if (actualResult.ToUpper().Trim() != testSteps.ExpectedResult)
             {
                 MyLogger.Log("Refer " + TakeScreenshot(TestStartInfo.ResultPath + testSteps.Action.Replace('.', '_')));
                 stepResult = Constants.ResultStatus_Failed;
             }
             else
             {
                 stepResult = Constants.ResultStatus_Passed;
             }
             numberOfRetry--;
         }while (stepResult == Constants.ResultStatus_Failed &&
                 testSteps.Option == Constants.Option_Retry &&
                 numberOfRetry >= 0);
         testSteps.ActualResult = actualResult;
         TestStepStatus.Add(stepResult);
     }
     catch
     {
         TestStepStatus.Add(Constants.ResultStatus_Failed);
     }
 }
コード例 #3
0
ファイル: StepProcessor.cs プロジェクト: karthik-kt/SWAT-Main
        private void TestCaseStop(TestSteps testSteps)
        {
            string stepResult = UpdateTestCaseResult();

            ShareTestCaseResult(stepResult);
            InstrSheet.Rows[TestCaseStartIndex][Constants.Column_Status] = stepResult;
            testSteps.ActualResult = "";
            TestStepStatus.Add(stepResult);
        }
コード例 #4
0
ファイル: StepProcessor.cs プロジェクト: karthik-kt/SWAT-Main
        private string UpdateTestCaseResult()
        {
            string testCaseStatus = Constants.ResultStatus_Passed;

            if (TestStepStatus.Contains(Constants.ResultStatus_Failed))
            {
                testCaseStatus = Constants.ResultStatus_Failed;
            }
            return(testCaseStatus);
        }
コード例 #5
0
ファイル: StepProcessor.cs プロジェクト: karthik-kt/SWAT-Main
 private bool ProcessStepRunOption(string option)
 {
     if (option == Constants.Option_Ignore)
     {
         TestStepStatus.Add(Constants.ResultStatus_Ignored);
         return(false);
     }
     if (option == Constants.Option_DependsOnAbove &&
         TestStepStatus.Last() != Constants.ResultStatus_Passed)
     {
         TestStepStatus.Add(Constants.TCResultStatus_Skipped);
         return(false);
     }
     return(true);
 }