Skip to content

VisualUITestBase Improvements#137

Merged
michael-hawker merged 4 commits intomainfrom
llama/uitestimprovements
Jun 8, 2022
Merged

VisualUITestBase Improvements#137
michael-hawker merged 4 commits intomainfrom
llama/uitestimprovements

Conversation

@michael-hawker
Copy link
Copy Markdown
Member

@michael-hawker michael-hawker commented Jun 2, 2022

Adds a TestPage attribute to load a XAML page by type as content for a test into a TestPage variable on VisualUITestBase.

Tried to simplify to not require the extra dispatch (and merge into a TestMethodAttribute itself), but hit the issue with MS Test not supporting UITestMethod + async as filed originally by @chingucoding here: microsoft/testfx#740 (comment)

This simplifies test development by letting us directly use (and re-use) XAML pages and code as we would normally, just like samples.

  • Also brings over the helper 'Log' class from the Toolkit.
  • Adds a test case for PropertySizer's initial value through binding.

Next Steps:

  • Test in CI (purpose of draft here)
  • Apply XAML Styler (not sure why that's not running locally for me in VS... maybe I don't have extension installed?)
  • Try and make a singular TestMethodWithXamlPage Attribute which includes the dispatch to the UI thread, though may rely on fix to MS Test itself (though we could take that directly first if it's scoped to the attribute method). Trying to get more details on that thread: Proposal: UIDataTestMethod / Support for DataRows in UITestMethods microsoft/testfx#740 (comment)
  • Write a few more tests
  • Update the template project to include an example test using this new method.

I'll probably save input injection as another PR, but that'd be the next step.

FYI @mrlacey as he'll want to know if this is working.

Note: In the future we could maybe use some source generator vs. reflection here, but this was the first step to investigate how this'll work. @Arlodotexe curious on your thoughts in that space based on what the method does and how that would translate.

…ally load a XAML based page by type for use within a a test

Simplifies test development by letting us directly use (and re-use) XAML pages and code as we would normally, just like samples.
Also brings over the helper 'Log' class from the Toolkit.
Adds a test case for PropertySizer's initial value through binding.
@michael-hawker michael-hawker added enhancement Improvement to an existing feature testing 🏗 CI/pipeline 🔬 dev loop ➰ For issues that impact the core dev-loop of building experiments labels Jun 2, 2022
@mrlacey
Copy link
Copy Markdown
Contributor

mrlacey commented Jun 2, 2022

XAML Style check was failing due to the location of the settings file.
The default behavior for the extension inside VS is for it only to look for a settings file as far as the directory the solution file is in.
The Labs structure puts the global settings file in the root of the repo and so isn't used.
In this location, it won't be used unless a setting is changed in the extension. If Search to drives root is set to true, the extension will find the correct settings and format the XAML as desired.
Without changing this setting, it's likely that issues of XAML formatting in individual experiments are likely to continue to cause CI to fail. :(

@michael-hawker michael-hawker force-pushed the llama/uitestimprovements branch from 53c1e60 to c8daf37 Compare June 4, 2022 00:09
@michael-hawker michael-hawker marked this pull request as ready for review June 6, 2022 18:54
@michael-hawker michael-hawker changed the title 🚧 VisualUITestBase Improvements VisualUITestBase Improvements Jun 6, 2022
@michael-hawker
Copy link
Copy Markdown
Member Author

This is good to review and merge now as an initial test/improvement. Opened #143 to track next step in this work.

@michael-hawker michael-hawker modified the milestone: Future Jun 8, 2022
@michael-hawker michael-hawker merged commit 5c5d093 into main Jun 8, 2022
@delete-merged-branch delete-merged-branch bot deleted the llama/uitestimprovements branch June 8, 2022 03:02
Martin1994 pushed a commit to Martin1994/Labs-Windows that referenced this pull request Sep 2, 2023
…itestimprovements

VisualUITestBase Improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/pipeline 🔬 dev loop ➰ For issues that impact the core dev-loop of building experiments enhancement Improvement to an existing feature testing 🏗

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants