Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Unit Test Infrastructure for VisualTree related tests #3746

Merged

Conversation

michael-hawker
Copy link
Member

@michael-hawker michael-hawker commented Feb 10, 2021

Supports #3685

We want to add some additional tests to the existing helpers so that we can then port them to the work being done in #3685 and have confidence that we haven't broken anything with the refactor.

However, our current Unit Tests/Integration Test environments didn't support having UI layout/rendering occur while also inspecting it at a detailed level. This PR adds a new helper base class for tests which require this functionality based off of similar work done in the WinUI testing infrastructure. Thanks @chingucoding for the pointers!

I've simplified their implementation and supplemented helpers we have in the Toolkit to encapsulate our basic needs here.

TODO:

  • Test in CI (this draft PR)
  • Add more tests

FYI @jamesmcroft this should make adding a test easier for #3507 as well! 🎉🎉🎉 I'll try and write up some docs for this, but it should be more straight-forward now within the Unit Test infrastructure.

Required some new Test Infrastructure adapted from WinUI setup, but simplified.
However, running into deadlock with TaskCompletionSource after test execution (test itself is succeeding)
This may help? https://devblogs.microsoft.com/premier-developer/the-danger-of-taskcompletionsourcet-class/
@ghost
Copy link

ghost commented Feb 10, 2021

Thanks michael-hawker for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from azchohfi, Kyaa-dost and Rosuavio February 10, 2021 04:23
@michael-hawker michael-hawker added this to the 7.0 milestone Feb 10, 2021
@michael-hawker michael-hawker added next preview ✈️ Label for marking what we want to include in the next preview release for developers to try. improvements ✨ testing 🏗️ labels Feb 10, 2021
@michael-hawker michael-hawker changed the title Add Unit Tests for Visual/Logical Tree Helpers Setup Unit Test Infrastructure for VisualTree related tests Feb 11, 2021
@michael-hawker michael-hawker marked this pull request as ready for review February 11, 2021 21:27
@michael-hawker
Copy link
Member Author

Let's get the initial infrastructure merged to unblock James and then I can add more tests in another PR.

@ghost
Copy link

ghost commented Feb 13, 2021

Hello @michael-hawker!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@michael-hawker michael-hawker merged commit 3209b7a into CommunityToolkit:master Feb 13, 2021
@michael-hawker
Copy link
Member Author

@jamesmcroft you should be able to copy the test I added here for the Visual Tree and use that to add a control into the Test App and then poke it for the Automation Peer info. Let me know if you need more info than that, we should have more info in the Wiki anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merge ⚡ improvements ✨ next preview ✈️ Label for marking what we want to include in the next preview release for developers to try. testing 🏗️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants