microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.32k stars 676 forks source link

Question: What are the plans for supporting testing of projects using WinUI3? #3584

Open mrlacey opened 3 years ago

mrlacey commented 3 years ago

I'm interested to know the broad plans for testing support of apps built using WinUI3. This doesn't appear to have been documented or discussed publicly previously.

Specific questions to help prompt a broad answer:

mrlacey commented 3 years ago

X-Ref: https://github.com/microsoft/ProjectReunion/discussions/382

mrlacey commented 3 years ago

X-Ref: https://github.com/microsoft/testfx/issues/708

mrlacey commented 3 years ago

Some more background:

Yes, for performing automated testing of applications built with WinForms and WPF, it has mostly been necessary to rely on tooling from 3rd parties. However, UWP (and WinRT, & Windows Phone before it) had automated UI test projects (previously "Coded UI" tests) that made testing of code in application projects possible.

While WinUI3 is seen as the future for Win32 and UWP apps, if it has less functionality than what is currently available for UWP (WinUI2) applications it will be seen as a step backwards.

Yes, it's possible to put application logic in a library project and run tests against the library code, but this is not a perfect solution. This is particularly an issue as the WinUI3 templates available do not encourage this or make it easy. Yes, Windows Template Studio does a better job of this but WinTS is not how most developers create their projects.

Yes, it's possible to create automated UI tests for WinUI3 apps by using WinAppDriver, however:

What I'd like:

Yes, my desired list is just one thing. This is the absolute minimum I deem to be acceptable.

For a first version I'll even accept if that can't run headless. Headless would be better so it can easily run on a CI server but I can wait for vNext for that.

I have lots of other ideas for things that could improve or make testing easier/better but those discussions seem much more appropriate once testing is possible.

In summary:

mrlacey commented 3 years ago

As WinUI is used by parts of the windows Shell, can details of how these are tested be shared?

The WinUI codebase uses both MSTest2 and TAEF as test frameworks. Without further advice, it might be easy to assume that both must be used to test any all that uses WinUI.

The WinUI codebase uses Tests that use the Microsoft.Windows.Apps.Test (MWAT) library. MWAT does not seem to be under active development. WinAppDriver has previously been pitched as a more usable way to test with MWAT. Without details of why WinUI uses MWAT directly it could easily be seen as the way all WinUI apps should be tested.

mrlacey commented 3 years ago

In the spirit of Phrasing Positively:

I want to create high quality, well tested apps. I want all developed apps to be thoroughly tested and of high quality. The ecosystem suffers when app quality is low. Testing apps makes it easier to find and fix bugs. Currently there is no easy solution to test WinUI3 apps. I want an easy way to set apps created with WInUI3. (Or if not easy, at least possible.) If Microsoft/the WinUI team do not provide a way to test WinUI3 apps it can be interpreted as implying they don't think testing is important. This will lead to fewer people testing and the general quality of apps in the ecosystem (and the ecosystem as a whole) suffering.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

mrlacey commented 1 year ago

Don't give up on requirements for a "proper" (& comprehensive) testing solution for WinUI3 apps.