Skip to main content

Add a parameter to attach base64 String image on the Specflow ISpecFlowOutputHelper

Comments

5 comments

  • Mario Steiner

    Hi Jonathan,

    thanks a lot for taking the time and sending us your request.

    Are you referring to the new SpecFlow Output API and would like to view the base 64 string directly as an image in SpecFlow+ LivingDoc?

    0
  • Jonathan Pereira

    Yes, I work with Extent reports as well and I don't need to create real images and store them in some folder to do attachment on extent reports, I just create a base64 string image with selenium driver and send to attach reports for the image to be renderer inside the HTML document like this:

    public MediaEntityModelProvider GetScreenshot(IWebDriver webDriver)
    {
    var screenshot = ((ITakesScreenshot)webDriver).GetScreenshot().AsBase64EncodedString;
    return MediaEntityBuilder.CreateScreenCaptureFromBase64String(screenshot).Build();
    }

    _scenario.CreateNode<Then>(scenarioContext.StepContext.StepInfo.Text).Fail(scenarioContext.TestError.Message, GetScreenshot(webDriver));

    This will help to improve living doc API for pipeline tests purpose

    0
  • Andreas Willich

    We discussed this topic when we developed the feature and decided against this. The reason was, that this would generate a very big TestExecution.json file, which will bring us more problems.

    1. Storage in Azure DevOps is limited. We would quickly reach the limit that would be possible to save in Azure DevOps for Extensions

    2. Time for parsing the JSON file is increasing. Some of our users have already very big Living Documentations and have a loading time of multiple seconds

     

    But that doesn't mean, that we see improvement in this area to make it easier to share a Living Documentation with images. 

    We will start with some examples for various Combinations (Build system, Image Storage, ...) how to do it.

    What are you using? Then we can prioritize the combinations first which are used out there.

    0
  • Jonathan Pereira

    We are not using azure to store images, we are curently working with two different reports, we have integrated Living doc on our azure DevOps and sometimes we run locally to generate the extent reports with attached images.

    But we are on the way to work only with Specflow.

    If you give me another solution to share the failure screenshots using Living Doc on azure I'll aprecciate.

    1
  • Piotr Niedzialek (PL)

    I would like to join to Jonathan's request - embedding of screenshots in Living Docs captured during test execution on remote server would be a nice feature (since SpecRunner doesn't support this one yet). 

    1

Please sign in to leave a comment.

Powered by Zendesk