Skip to content

Refactors UI test setup and updates dependencies#4058

Merged
Keboo merged 6 commits into
masterfrom
tunitImprovments
May 29, 2026
Merged

Refactors UI test setup and updates dependencies#4058
Keboo merged 6 commits into
masterfrom
tunitImprovments

Conversation

@Keboo
Copy link
Copy Markdown
Member

@Keboo Keboo commented May 29, 2026

Enhances the test infrastructure by centralizing UI test setup and teardown logic, leading to cleaner and more maintainable test code.

  • Introduces custom TUnit test executor: Implements XamlTestExecutor to automate the management of test application (IApp) instances and TestRecorder lifecycles for UI tests, removing repetitive boilerplate from individual test methods.
  • Updates dependencies: Upgrades TUnit to a new major version, Microsoft.NET.Test.Sdk, and GitHubActionsTestLogger. Also adds System.Net.Http and System.Text.RegularExpressions package references.
  • Refines TUnit assertion usage: Adapts existing IsCloseToExtensions to align with the updated TUnit assertion API.
  • Improves test management: Changes long-running tests from being [Skip]ped to [Explicit], allowing them to be run intentionally without being part of default test runs.
  • Adds .NET Framework compatibility shim: Includes ModuleInitializerAttribute for .NET Framework 4.7.2, enabling support for module initialization patterns on older framework versions.
  • Removes redundant code: Cleans up various UI test files by removing manual TestRecorder instantiation/disposal and obsolete using directives.
  • Removes unnecessary package references: Eliminates GitHubActionsTestLogger package references from test projects.
  • Enhances code quality: Updates default keyword usage in some tests for improved type clarity in assertion checks.

Keboo added 3 commits May 28, 2026 22:02
Centralizes remote app startup and test recorder management in XamlTestExecutor, removing boilerplate from individual tests; marks long-running tests as explicit and enables TUnit parallel limiting.
Upgrades core packages including TUnit, System.CommandLine, and XAMLTest. Refactors `CommandLineOptions` for `System.CommandLine` API updates. Adapts TUnit assertion extensions and test execution context usage. Adds `ModuleInitializerAttribute` for NET472 support.
Removes explicit `recorder.Success()` calls from UI tests, completing the centralization of test recorder management introduced by the `XamlTestExecutor` refactor. Cleans up unused package versions and test dependencies. Addresses nullable warnings and removes Byte Order Mark (BOM) for improved code hygiene.
@Keboo Keboo added this to the 5.3.3 milestone May 29, 2026
@Keboo Keboo enabled auto-merge (squash) May 29, 2026 05:10
Keboo added 3 commits May 28, 2026 22:30
Removes redundant ``, ``, and Microsoft Testing Platform-specific properties from test `.csproj` files. This cleans up project definitions, aligning them with current SDK-style project practices and the existing TUnit test infrastructure.
Defines `Microsoft.Testing.Platform` as the solution-wide test runner in `global.json`. This enables the removal of specific runner properties from individual test `.csproj` files, reducing redundancy and simplifying project configurations.
Removes redundant `--blame-crash` and `--logger GitHubActions` arguments from the `dotnet test` command. These concerns are now implicitly handled by the centralized test runner configuration, further simplifying the build artifact workflow.
@Keboo Keboo merged commit da39b20 into master May 29, 2026
2 checks passed
@Keboo Keboo deleted the tunitImprovments branch May 29, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant