Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for file Attachments #936

Closed
scabana opened this issue Aug 12, 2016 · 14 comments
Closed

Allow for file Attachments #936

scabana opened this issue Aug 12, 2016 · 14 comments

Comments

@scabana
Copy link

scabana commented Aug 12, 2016

We are migrating from MsTest to xunit and one thing that is missing from xunit are file attachments. MsTest allows your to add files to the result using TestContext.AddResultFile(fileName). The place where to push those files (for vstest.console.exe) is in the Attachments property of the Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResult class. Our usecase is to attach screenshots on failure or dynamicaly created data for some tests.

@SDETRK
Copy link

SDETRK commented Aug 12, 2016

This is definitely needed

@jordanchang
Copy link

I'm working on a Selenium test project for a website and would really like to attach a screenshot to failed tests.

@sandersaares
Copy link

I would also like not only attachments but writable file streams - my tests (as a whole, not individually) generate tracing data very useful for failure analysis. However, I am currently left to handle it completely outside the xunit universe, in parallel to actual test code. This is suboptimal.

It would be especially great if this worked also for platforms where normal file I/O is otherwise permission-limited (e.g. UWP).

@scabana
Copy link
Author

scabana commented Aug 24, 2016

The writable streams would be great. We don't have the limitation of platforms like you do, but it would definitely save some work.

@MaxWilson
Copy link

Is there a workaround for VSTest, or are we just out of luck for now when it comes to screenshots?

@jordanchang
Copy link

jordanchang commented Apr 6, 2017 via email

@bradwilson
Copy link
Member

Closed for age.

@sandersaares
Copy link

Is this issue no longer relevant?

@bradwilson
Copy link
Member

@altrive
Copy link

altrive commented Nov 15, 2018

It seems xunit v3 expeced to have "test context" feature. #621
Is there any plan to support file attachments to test result feature also?

@SychevIgor
Copy link

It will be nice to have this feature in Xunit.
Our UX testing team choose NUnit only because they can't attach screenshots of failed tests in XUnit.

@sjoerdvanloon
Copy link

I was really in love with the XUnit framework, but I am really missing this feature and am considering to switch back to NUnit for my company UX tests. Are there still no plans to include this feature?

@pabrams
Copy link

pabrams commented Jan 18, 2021

Why's this closed? Does that mean it won't be considered as a feature?

@filzrev
Copy link

filzrev commented Nov 9, 2022

There is following feature ticket on xUnit.net v3 roadmap.
#2457

If this feature will be supported by v3.
Attached files can display files on VS Test Explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests