Would you use a bUnit-like test library for native .NET MAUI views? #34757
jaimeatsherpa
started this conversation in
Polls
Replies: 1 comment
-
|
CommunityToolkit.Maui uses xUnit and CommunityToolkit.Maui.Markup uses nUnit. In both of those cases they add a base test harness that mocks a .NET MAUI application and the corresponding dispatcher so that .NET MAUI components can be tested. I'm not familiar with bUnit but you will need to solve the same problem. If you don't have those things mocked, then, you will not be able to satisfactory test any .NET MAUI component. Help vote up CommunityToolkit/Maui#3040 so that the general .NET MAUI developer community can reuse the same test harness. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Would you use a bUnit-like test library for native .NET MAUI views?
I’m experimenting with a small library for testing native .NET MAUI
ContentView/ContentPageinstances in a way that sits between:Appium is the official/main path for MAUI UI automation and is great for real end-to-end validation, but it’s also heavier and slower because it drives the actual app on device/desktop.
What I’m exploring instead is something closer in spirit to bUnit for Blazor: render a view in a test, inspect the resulting tree, find controls, and assert on their state. bUnit is useful precisely because it provides fast component-level tests instead of requiring full browser automation for everything.
Based on something like:
The kind of API I have in mind is:
This would not replace Appium. It would be for things like:
IsVisible,IsEnabled,TextSo the value would be:
Would this be useful to you?
The main question I’m trying to answer is whether MAUI is missing a middle layer:
ViewModel tests → component/page tests → Appium tests
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions