Test tools for .NET and cross-platform apps

KendraHavens

There are a few new goodies added to your everyday test tools that I hope will improve your test inner loop! To familiarize yourself with these new features you can see them in action in the Visual Studio Tips and Tricks video on Testing or keep reading!

Show in Test Explorer

Easily jump from the editor to the test in the Test Explorer with the new Show in Test Explorer command (Ctrl+E,S). Show in Test Explorer is also available from the editor right-click menu, CodeLens test glyph, and the right-click in the Solution Explorer.

Image of the show in test explorer command in Visual Studio
Show in Test Explorer command in right-click menu

Play a sound when a test run completes!

The Test Explorer can now play a sound when a test run completes. You can select two sounds, one that indicates the test run succeeded with all passing tests and a second sound to indicate the test run completed with at least one failing test. These sounds are completely customizable using the Windows sound dialog!

Image of test audio cues in visual studio test explorer
Test Audio Cues in Test Explorer settings

Console.WriteLine in Test Explorer

Console.Writeline will now appear in the test detail pane. For xUnit, output that uses the ITestOutputHelper will appear. Standard output as well as standard error will be shown in this pane, so your test output is available where you need it.

Image of console writeline output appearing in test explorer in visual studio
Console.Writeline output appears in Test Explorer details

Remote Testing

Run and debug tests on Linux containers, WSL, or over SSH connections!

Visual Studio can make your cross-platform development easier than ever with remote testing! You can now run Linux tests from Visual Studio by connecting the Test Explorer to remote environments. These can be Linux containers, WSL, and even SSH connections! Check out the setup documentation to get started at https://aka.ms/remotetesting.

Normally I’d have to push to a CI run before getting feedback from Linux test or other operating systems, but now I can get it all in my inner dev loop, including debugging a test in a Linux container.

Image of remote testing in visual studio debugging a test in a Linux container
Debug a test in a Linux container with Remote Testing

Test web apps with Playwright

Playwright is the latest in cross-platform, asynchronous web UI testing. It’s built with modern browsers and services in mind meaning each step automatically uses awaits. This reduces the flakiness that typically plagues web UI tests. Not only is Playwright cross-platform, but it is also cross-language supporting TypeScript, JavaScript, Python, Java, and .NET. It also comes with a recorder that generates tests based on your actions. Read more https://playwright.dev.

Image of playwright recorder generating .NET test code
Playwright recorder generating .NET tests

Where can I learn more?

If you are interested in more on performance, how hot reload can apply to the Test Explorer, or more on running tests over SSH connections check out the longer demo from .NET Conf.

You can find more test tools documentation at http://aka.ms/visualstudiotest.

To get started with Remote Testing follow the instructions at https://aka.ms/remotetesting.

As always, we are incredibly thankful to the community who suggested many of these features, commented design suggestions, and upvoted them to the top of our backlog! This guidance is invaluable to creating tools that the community loves. Share what you’d like to see next in your test experience in the comments!

Thanking you all and wishing you well,