.NET MAUI is adding support for dotnet test:
For example, with .NET 11 Preview 4 (hopefully), it should be possible to use dotnet test within a "properly configured Android project 1" which will:
- Launch an emulator (if an emulator configuration already exists)
- Install the app
- Run the unit tests within the app
- Extract the resulting
.trx file from the device
- Close the emulator
((1), (2), (3-ish), and (5) are done in .NET 11 Preview 3 for dotnet run; dotnet test support is still ongoing.)
It would be nice if the same workflow could be applied to blazorwasm projects
- Create
blazorwasm app which contains unit tests. (Again, see 1.)
dotnet test:
- runs
dotnet run (which starts a local server hosting the blazorwasm project),
- launches a web browser (possibly with
--headless) connecting to the URL from (1)
- runs the tests
- extracts the test results
- closes the web browser
The browser to use for testing should be configurable and overridable via command-line arguments.
.NET MAUI is adding support for
dotnet test:For example, with .NET 11 Preview 4 (hopefully), it should be possible to use
dotnet testwithin a "properly configured Android project 1" which will:.trxfile from the device((1), (2), (3-ish), and (5) are done in .NET 11 Preview 3 for
dotnet run;dotnet testsupport is still ongoing.)It would be nice if the same workflow could be applied to blazorwasm projects
blazorwasmapp which contains unit tests. (Again, see 1.)dotnet test:dotnet run(which starts a local server hosting the blazorwasm project),--headless) connecting to the URL from (1)The browser to use for testing should be configurable and overridable via command-line arguments.
Footnotes
The definition of "properly configured project" is not as well defined as I'd like. .NET 11 Preview 4's
dotnet testfor Android will launch and wait for an Instrumentation, which will have the "required glue code" to make the magic happen. ↩ ↩2