Skip to main content

[SpecFlow+ LivingDoc] Embedding screenshots/files attached to Test Case to report with ADO REST API

Comments

2 comments

  • Mario Steiner

    Hi Piotr,

    thanks a lot for taking the time and sending us your request. Sounds interesting, we will take a look at your suggestion.

    We are currently collecting all community requests, prioritize them and try to further improve SpecFlow+ LivingDoc in the upcoming weeks/months.

    We will keep you updated.

    1
  • Mortimer, Andrew EXT

    When we upload screenshots using the specflow scenariocontext

    context.AddResultFile(path);

    inside our runs which are driven through azure devops pipelines, the screenshots are already uploaded and stored in blobstorage. We can even find out what that url is usingĀ 

    https://vstmr.dev.azure.com/{organization}/{project}/_apis/testresults/runs/{runId}/results/{resultId}/testlogstoreendpoint?type=generalAttachment&filePath={filePath}&api-version=6.0-preview.1

    The problem is however, while the test is running we can find out everything except the resultID. So we can't call specFlowOutputHelper.AddAttachment with the correct url while the test is running. As a solution, perhaps we shouldn't have to call specFlowOutputHelper.AddAttachment at all? Perhaps the specflow plugin could be adjusted to scrape the correct resultID from the run after completion then populate the livingdoc file attachments using everything that is attached to the result in azure devops? If the correct positioning within the scenario steps is still required, we could call specFlowOutputHelper.AddAttachment with the filepath as we do now, which gives filepaths in living doc like this D:\a\1\s\TestAutomation\bin\DebugContacts_Making_a_call_210807134917.873.png then the livingdoc extension could use that filename to find the attachment in the azure devops result and simply add the correct url to that file?

    0

Please sign in to leave a comment.

Powered by Zendesk