MAUIverse MAUIverse

Writing UI Tests for .NET MAUI - POC

There was never an official .NET MAUI successor to Xamarin UI Tests, but the old framework can still drive a MAUI app. Mark is upfront that parts of the setup feel hacky, and he’s hoping that real-world use will encourage further development.

The walkthrough begins with a .NET Framework 4.8 test project that uses NUnit and Xamarin.UITest, a base test class that takes the platform, and a first test that waits for the counter button, taps it and checks the label. He recommends setting AutomationId in your XAML to find elements reliably. For iOS and Mac Catalyst, he adds the Xamarin.TestCloud.Agent package conditionally and starts Xamarin.Calabash behind a compile constant.

Beyond the setup, he discusses the costs: UI tests are slower, need more upkeep, and can break when the UI is redesigned. His suggestion is to begin with a smoke test that starts the app and opens each screen, then add happy-path scenarios. If you’re considering UI tests for your MAUI app, it’s a balanced read.

View Source →

← Back to Community Feed

}