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

Properties for TextContext to get info from Test details summary #3228

Open
adrozdowski opened this issue Jul 8, 2024 · 1 comment
Open

Comments

@adrozdowski
Copy link

Summary

TextContext class includes 2 new properties. TextContext.StackTrace and TextContext.Message (Exception).

Background and Motivation

Hi. I highly need properties for TestContext to get Error message and Stack trace. I am making a custom report and now getting this data is alomost impossible

Proposed Feature

When I use TextContext.Message a message from red rectangle will be returned.
When I use TextContext.StackTrace a stack trace from green rectangle will be returned.
image

Alternative Designs

It is the same feature like NUnit 3.x has https://stackoverflow.com/questions/43236826/how-to-obtain-the-stacktrace-and-error-message-from-mstest-run:

var stackTrace = TestContext.CurrentContext.Result.StackTrace;
var errorMessage = TestContext.CurrentContext.Result.Message;

@Evangelink
Copy link
Member

Hi @adrian,

Thanks for the request. It would indeed makes sense to be able to retrieve more information about the test execution.

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

No branches or pull requests

2 participants