Write and update WPF UI tests in MaterialDesignThemes.UITests using XAMLTest. Use when template, layout, focus, interaction, or visual behavior needs coverage, or when a reviewer asks to move runtime UI checks out of MaterialDesignThemes.Wpf.Tests.
Use this skill when working on runtime WPF behavior in this repository.
PART_TextBox or PART_IncreaseButton.Padding, Visibility, ActualWidth, or DataContext state after layout.tests/MaterialDesignThemes.UITests.tests/MaterialDesignThemes.Wpf.Tests.tests/MaterialDesignThemes.UITests/WPF/<feature>/ instead of creating a generic catch-all test file.TestRecorderTestBase.LoadXaml<T>() for focused control scenarios.LoadUserControl<T>() when you need a sample view model, bindings, or additional focus targets.GetElement<T>("PART_Name").RemoteExecute with static methods for properties that helpers do not expose directly.Wait.For(...) for layout-sensitive assertions.GetCoordinates() for alignment and spacing assertions.RemoteExecute for Padding, Visibility, ActualWidth, Margin, or DataContext inspection.MoveKeyboardFocus, SendKeyboardInput, and LeftClick for interaction.MaterialDesignThemes.Wpf.Tests for runtime template behavior.[Test]
public async Task DecimalUpDown_WithMaximum_DisablesPlusButton()
{
await using var recorder = new TestRecorder(App);
var decimalUpDown = await LoadXaml<DecimalUpDown>("""
<materialDesign:DecimalUpDown Value="1" Maximum="2" />
""");
var plusButton = await decimalUpDown.GetElement<RepeatButton>("PART_IncreaseButton");
var textBox = await decimalUpDown.GetElement<TextBox>("PART_TextBox");
await plusButton.LeftClick();
await Wait.For(async () =>
{
await Assert.That(await textBox.GetText()).IsEqualTo("2");
await Assert.That(await decimalUpDown.GetValue()).IsEqualTo(2);
});
await Assert.That(await plusButton.GetIsEnabled()).IsFalse();
recorder.Success();
}
tests/MaterialDesignThemes.UITests/TestBase.cstests/MaterialDesignThemes.UITests/XamlTestExtensions.cstests/MaterialDesignThemes.UITests/WPF/