XamlTreeDump 1.0.10
dotnet add package XamlTreeDump --version 1.0.10
NuGet\Install-Package XamlTreeDump -Version 1.0.10
<PackageReference Include="XamlTreeDump" Version="1.0.10" />
paket add XamlTreeDump --version 1.0.10
#r "nuget: XamlTreeDump, 1.0.10"
// 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:
- any property with a string value of
<ANYTHING>
in the master will match any value in the output regardless of its type. - numbers are compared to within a precision of 1.0f
DependencyObject
s with aVisibility == Collapsed
will be compared as if they do not existScrollBar
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 | Versions Compatible and additional computed target framework versions. |
---|---|
Universal Windows Platform | netcore50 is compatible. uap was computed. uap10.0 is compatible. |
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
博客用到的代码
|