[SpecFlow+ LivingDoc] Embedding screenshots/files attached to Test Case to report with ADO REST API
Question about embedding images/files in SpecFlow LivingDocs - I've watched webinar "Enhance your Living Documentation with Text, Images and Files" and Andreas mentioned that Azure DevOps currently lacks features (suggesting usage of Azure Blob) which would allow adding URL (which would point to Azure artifact) to test-case attached image under LivingDocs step.
Wouldn't be possible from your side to develop something like this:
(applicable to runners which publish attachments to given Test Case)
- specFlowOutputHelper.AddAttachment should have 2nd method with 2 arguments - path to file and file name; file name should be kept and put into LivingDocs' JSON file;
- when LivingDocs generates report, it could use Azure DevOps Services REST API to obtain attachment URL (https://docs.microsoft.com/en-us/rest/api/azure/devops/test/runs/query?view=azure-devops-rest-6.0); then put attachment URL to LivingDocs report instead of path
Above steps could be optional, as the more files are attached, the more time consuming embedding process would be.
Thanks in advance for considering this request!
-
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 -
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Ā
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.
Comments
2 comments