public static bool OpenTestScenario(OpenScenarioCmdletBase cmdlet) { bool result = false; if (TestData.CurrentTestResult.Details.Count > 0) { TMX.TestData.AddTestResult( "autoclosed", TestData.GetTestResultId(), null, false, // isKnownIssue false, // geenrateNextResult cmdlet.MyInvocation, null, // Error string.Empty, // 20130322 //true); // 20130626 //true, TestResultOrigins.Automatic, false); } // 20130301 // set time spent on the previous scenario if (null != TMX.TestData.CurrentTestScenario) { if (System.DateTime.MinValue != TMX.TestData.CurrentTestScenario.Timestamp) { TMX.TestData.CurrentTestScenario.SetTimeSpent( TMX.TestData.CurrentTestScenario.TimeSpent += (System.DateTime.Now - TMX.TestData.CurrentTestScenario.Timestamp).TotalSeconds); TMX.TestData.CurrentTestScenario.Timestamp = System.DateTime.MinValue; } } //true); //TMX.TestData.CurrentTestScenario = TMX.TestData.GetTestScenario(cmdlet.InputObject, cmdlet.Name, cmdlet.Id, cmdlet.TestSuiteName, cmdlet.TestSuiteId, cmdlet.TestPlatformId); if (TMX.TestData.CurrentTestScenario != null) { TMX.TestData.CurrentTestScenario.TestResults.Add( new TestResult( TMX.TestData.CurrentTestScenario.Id, TMX.TestData.CurrentTestScenario.SuiteId)); TMX.TestData.CurrentTestResult = TMX.TestData.CurrentTestScenario.TestResults[TMX.TestData.CurrentTestScenario.TestResults.Count - 1]; // 20130301 // set the initial time for this scenario's session TMX.TestData.CurrentTestScenario.SetNow(); //TMX.TestData.FireTMXTestScenarioOpened(TMX.TestData.CurrentTestResult, null); TMX.TestData.OnTMXTestScenarioOpened(TMX.TestData.CurrentTestScenario, null); result = true; } return result; }
public static void GetTestScenarioStatus(OpenScenarioCmdletBase cmdlet, bool skipAutomatic) { TMXHelper.OpenTestScenario(cmdlet); if (null != TestData.CurrentTestScenario) { // 201330322 //TestData.RefreshScenarioStatistics(TestData.CurrentTestScenario); TestData.RefreshScenarioStatistics(TestData.CurrentTestScenario, skipAutomatic); cmdlet.WriteObject(cmdlet, TestData.CurrentTestScenario.Status); } }
public static void GetTestScenarioStatus(OpenScenarioCmdletBase cmdlet) { TMXHelper.OpenTestScenario(cmdlet); if (null != TestData.CurrentTestScenario) { TestData.RefreshScenarioStatistics(TestData.CurrentTestScenario); cmdlet.WriteObject(cmdlet, TestData.CurrentTestScenario.Status); } }