Skip to main content

Include additional info in custom JSON report

Answered

Comments

1 comment

  • Jordan Western

    Hi Victor Chang,

    Thanks for the query.

    What JSON report are you referring to?

    The Specflow+ Runner report shows the execution time of each step and you can also add anything you like to the trace. (see below!)

    [Given("the first number is (.*)")]


    public void GivenTheFirstNumberIs(int number)
    {
    Thread.Sleep(2000);
    System.Console.WriteLine("This is some custom text 1");
    }

    [Given("the second number is (.*)")]
    public void GivenTheSecondNumberIs(int number)
    {
    Thread.Sleep(2000);
    System.Console.WriteLine("This is some custom text 2");
    }

    [When("the two numbers are added")]
    public void WhenTheTwoNumbersAreAdded()
    {
    Thread.Sleep(2000);
    System.Console.WriteLine("This is some custom text 3");
    }

    [Then("the result should be (.*)")]
    public void ThenTheResultShouldBe(int result)
    {
    Thread.Sleep(2000);
    System.Console.WriteLine("This is some custom text 4");
    }

    https://docs.specflow.org/projects/specflow-runner/en/latest/Usage/Reports.html

    Hope this helps.

    0

Please sign in to leave a comment.

Powered by Zendesk