private void TestCaseStart(TestSteps testSteps) { TestCaseId = Int32.Parse((testSteps.DataReference.Split('_')[0])); TestStepStatus.Clear(); TestCaseStartIndex = testSteps.Index; TestStepStatus.Add(Constants.ResultStatus_Passed); testSteps.ActualResult = ""; }
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); } }
private void TestCaseStop(TestSteps testSteps) { string stepResult = UpdateTestCaseResult(); ShareTestCaseResult(stepResult); InstrSheet.Rows[TestCaseStartIndex][Constants.Column_Status] = stepResult; testSteps.ActualResult = ""; TestStepStatus.Add(stepResult); }
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); }