Skip to content

Commit 4d5a04e

Browse files
committed
Wraps clear button click in retry
Wraps the clear button click and assertion in a retry block to address potential timing issues in UI tests.
1 parent 5a53e17 commit 4d5a04e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/MaterialDesignThemes.UITests/WPF/TimePickers/TimePickerTests.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,15 @@ public async Task TimePicker_WithClearButton_ClearButtonClearsUncommittedText()
528528
await timePickerTextBox.SendKeyboardInput($"invalid time");
529529
await Assert.That(await timePickerTextBox.GetText()).IsEqualTo("invalid time");
530530

531-
// Act
532-
await clearButton.LeftClick();
533-
await Task.Delay(50, TestContext.Current!.CancellationToken);
531+
await Wait.For(async () =>
532+
{
533+
// Act
534+
await clearButton.LeftClick();
535+
await Task.Delay(50, TestContext.Current!.CancellationToken);
534536

535-
// Assert
536-
await Assert.That(await timePickerTextBox.GetText()).IsNull();
537+
// Assert
538+
await Assert.That(await timePickerTextBox.GetText()).IsNull();
539+
});
537540

538541
recorder.Success();
539542
}

0 commit comments

Comments
 (0)