https://github.com/verifytests/verify.xaml
Extends Verify to allow verification of Xaml UIs
https://github.com/verifytests/verify.xaml
Last synced: 11 months ago
JSON representation
Extends Verify to allow verification of Xaml UIs
- Host: GitHub
- URL: https://github.com/verifytests/verify.xaml
- Owner: VerifyTests
- License: mit
- Created: 2020-02-08T08:38:34.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-07-10T00:28:54.000Z (12 months ago)
- Last Synced: 2025-07-10T10:08:27.182Z (12 months ago)
- Language: C#
- Homepage:
- Size: 796 KB
- Stars: 21
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license.txt
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README
#
Verify.Xaml
[](https://github.com/orgs/VerifyTests/discussions)
[](https://ci.appveyor.com/project/SimonCropp/verify-xaml)
[](https://www.nuget.org/packages/Verify.Xaml/)
Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of Xaml UIs.
**See [Milestones](../../milestones?state=closed) for release notes.**
## NuGet
* https://nuget.org/packages/Verify.Xaml
## Usage
```cs
[ModuleInitializer]
public static void Init() =>
VerifyXaml.Initialize();
```
snippet source | anchor
A visual element (Window/Page/Control etc) can then be verified as follows:
```cs
[Test]
public async Task WindowUsage()
{
var window = new MyWindow();
await Verify(window);
}
```
snippet source | anchor
With the state of the element being rendered as a verified files:
[TheTests.WindowUsage.verified.xml](/src/Tests/TheTests.WindowUsage.verified.xml):
7
8
9
4
5
6
1
2
3
0
.
+/-
/
*
-
+
Sqrt
%
1/X
=
C
CE
MC
MR
MS
M+
```
snippet source | anchor
[TheTests.WindowUsage.verified.png](/src/Tests/TheTests.WindowUsage.verified.png):

## OS specific rendering
The rendering of XAML elements can very slightly between different OS versions. This can make verification on different machines (eg CI) problematic. There are several approaches to mitigate this:
* [Forcing elements to use a specific theme](https://arbel.net/2006/11/03/forcing-wpf-to-use-a-specific-windows-theme/)
* Using a [custom comparer](https://github.com/VerifyTests/Verify/blob/master/docs/comparer.md)
## Icon
[Gem](https://thenounproject.com/term/gem/2247823/) designed by [Adnen Kadri](https://thenounproject.com/adnen.kadri/) from [The Noun Project](https://thenounproject.com).