Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 public void AfterScenario()
 {
     log.Trace(MethodBase.GetCurrentMethod().Name);
     if (ReportFileInstance.CurrentScenario != null)
     {
         ReportFileInstance.UpdateCurrentFeatureWithFileContent(FeatureFilePath, GetFullFeaturePath(FeatureFilePath));
         ReportFileInstance.WriteToXml(TestResultsDirectory);
         ReportFileInstance.CurrentScenario = null;
     }
 }
Exemplo n.º 3
0
 public void TraceStepSkipped()
 {
     log.Trace(MethodBase.GetCurrentMethod().Name);
     if (ReportFileInstance.CurrentStep != null)
     {
         ReportFileInstance.CurrentStep.Status = TestResultStatus.Skipped;
         //
         ReportFileInstance.WriteToXml(TestResultsDirectory);
     }
     ReportFileInstance.CurrentStep = null;
 }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        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);
            }
        }
Exemplo n.º 10
0
        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);
            }
        }
Exemplo n.º 11
0
        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);
            }
        }