XamlTreeDump 1.0.10

dotnet add package XamlTreeDump --version 1.0.10
NuGet\Install-Package XamlTreeDump -Version 1.0.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XamlTreeDump" Version="1.0.10" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XamlTreeDump --version 1.0.10
#r "nuget: XamlTreeDump, 1.0.10"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XamlTreeDump as a Cake Addin
#addin nuget:?package=XamlTreeDump&version=1.0.10

// Install XamlTreeDump as a Cake Tool
#tool nuget:?package=XamlTreeDump&version=1.0.10

XamlTreeDump

A UWP library to produce and compare XAML tree dumps useful for visual end-to-end testing

XamlTreeDump can be used to produce a data representation of a UWP XAML UI ("tree dump") and compare it to a checked-in version ("master") to detect regressions in visual output.

There are two main entrypoints to the library:

public static string VisualTreeDumper.DumpTree(
  DependencyObject root, 
  DependencyObject excludeNode,
  IVector<string> additionalProperties,
  DumpTreeMode mode)

This will traverse the tree starting at the root, skipping the optional excludeNode, and collect a set of standard properties - which you can add to through additionalProperties. The format of the dump can be switched between Default (a key=value text format), or the recommended Json format.

The string you receive from DumpTree can be saved to a file so that your test application can later use TreeDumpHelper.DumpsAreEqual to check for differences.

The second entrypoint:

public static bool TreeDumpHelper.DumpsAreEqual(string expected, string actual)

will perform a semantic comparison of the two dumps by following these rules:

  1. any property with a string value of <ANYTHING> in the master will match any value in the output regardless of its type.
  2. numbers are compared to within a precision of 1.0f
  3. DependencyObjects with a Visibility == Collapsed will be compared as if they do not exist
  4. ScrollBar types will be ignored (since UI automation can sometimes hover over them and trigger them on accident)

See UnitTests for more usage and examples.

Product Compatible and additional computed target framework versions.
Universal Windows Platform netcore50 is compatible.  uap was computed.  uap10.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on XamlTreeDump:

Repository Stars
lindexi/lindexi_gd
博客用到的代码
Version Downloads Last updated
1.0.10 173 6/28/2023
1.0.9 25,311 4/30/2021
1.0.8 866 3/4/2021
1.0.7 359 3/3/2021
1.0.6 829 1/25/2021
1.0.5 1,558 10/28/2020
1.0.4 489 7/6/2020
1.0.3 3,299 5/16/2020
1.0.2 427 5/15/2020
1.0.1 446 5/15/2020
1.0.0 473 5/11/2020