public void TraceDuration(TimeSpan elapsed, string text) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Duration = elapsed.Ticks * 100; // ReportFileInstance.WriteToXml(TestResultsDirectory); } }
public void AfterScenario() { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentScenario != null) { ReportFileInstance.UpdateCurrentFeatureWithFileContent(FeatureFilePath, GetFullFeaturePath(FeatureFilePath)); ReportFileInstance.WriteToXml(TestResultsDirectory); ReportFileInstance.CurrentScenario = null; } }
public void TraceStepSkipped() { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Status = TestResultStatus.Skipped; // ReportFileInstance.WriteToXml(TestResultsDirectory); } ReportFileInstance.CurrentStep = null; }
public void TraceWarning(string text) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Status = TestResultStatus.Passed; ReportFileInstance.CurrentStep.ErrorMessageString = text; ReportFileInstance.WriteToXml(TestResultsDirectory); } }
public void TraceError(Exception ex) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Status = TestResultStatus.Failed; ReportFileInstance.CurrentStep.ErrorMessageString = ex.ToString(); // ReportFileInstance.WriteToXml(TestResultsDirectory); } }
public void TraceStepDone(BindingMatch match, object[] arguments, TimeSpan duration) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Status = TestResultStatus.Passed; ReportFileInstance.CurrentStep.Duration = duration.Ticks * 100; // ReportFileInstance.WriteToXml(TestResultsDirectory); } ReportFileInstance.CurrentStep = null; }
public void TraceNoMatchingStepDefinition(StepInstance stepInstance, ProgrammingLanguage targetLanguage, CultureInfo bindingCulture, List <BindingMatch> matchesWithoutScopeCheck) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Status = TestResultStatus.Failed; ReportFileInstance.CurrentStep.ErrorMessageString = stepInstance.ToString(); // ReportFileInstance.WriteToXml(TestResultsDirectory); } }
public void TraceStepPending(BindingMatch match, object[] arguments) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentStep != null) { ReportFileInstance.CurrentStep.Status = TestResultStatus.Skipped; ReportFileInstance.CurrentStep.ErrorMessageString = "One or more step definitions are not implemented yet.\r" + match.StepBinding.Method.Name + "(" + ")"; // ReportFileInstance.WriteToXml(TestResultsDirectory); } ReportFileInstance.CurrentStep = null; }
public static void BeforeFeature() { log.Trace(MethodBase.GetCurrentMethod().Name); if (FeatureContext.Current != null) { ReportFileInstance.CurrentFeature = new FeatureElement(); ReportFileInstance.CurrentFeature.Started = GetStartUnixTime(); ReportFileInstance.CurrentFeature.Name = FeatureContext.Current.FeatureInfo.Title; var tidTag = FeatureContext.Current.FeatureInfo.Tags.FirstOrDefault(tag => tag.StartsWith("@TID")); ReportFileInstance.CurrentFeature.Tag = string.IsNullOrEmpty(tidTag) ? string.Empty : tidTag; ReportFileInstance.OctaneSpecflowReport.Features.Add(ReportFileInstance.CurrentFeature); ReportFileInstance.UpdateCurrentFeatureWithFileContent(FeatureFilePath, GetFullFeaturePath(FeatureFilePath)); ReportFileInstance.WriteToXml(TestResultsDirectory); } }
public void BeforeScenario() { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentFeature != null && ScenarioContext.Current != null) { ReportFileInstance.CurrentScenario = new ScenarioElement(); ReportFileInstance.CurrentScenario.Name = ScenarioContext.Current.ScenarioInfo.Title; ReportFileInstance.CurrentFeature.Scenarios.Add(ReportFileInstance.CurrentScenario); if (ReportFileInstance.OctaneSpecflowReport.Features.Count == 0) { ReportFileInstance.OctaneSpecflowReport.Features.Add(ReportFileInstance.CurrentFeature); } ReportFileInstance.UpdateCurrentFeatureWithFileContent(FeatureFilePath, GetFullFeaturePath(FeatureFilePath)); ReportFileInstance.WriteToXml(TestResultsDirectory); } }
public void TraceStep(StepInstance stepInstance, bool showAdditionalArguments) { log.Trace(MethodBase.GetCurrentMethod().Name); if (ReportFileInstance.CurrentScenario != null) { ReportFileInstance.CurrentStep = new StepElement(); ReportFileInstance.CurrentStep.Status = TestResultStatus.Started; string stepTitle = String.Empty; stepTitle += stepInstance.Keyword + " " + stepInstance.Text; if (stepInstance.MultilineTextArgument != null) { stepTitle += stepInstance.MultilineTextArgument; } ReportFileInstance.CurrentStep.Name = stepTitle; ReportFileInstance.CurrentScenario.Steps.Add(ReportFileInstance.CurrentStep); ReportFileInstance.WriteToXml(TestResultsDirectory); } }