diff --git a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs index 9b400f6550fa..c309e4496128 100644 --- a/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs +++ b/src/Uno.UI.RuntimeTests/IntegrationTests/dxaml/controls/calendardatepicker/CalendarDatePickerIntegrationTests.cs @@ -276,46 +276,50 @@ public async Task CanOpenCloseFlyoutBySettingIsCalendarOpen() { TestCleanupWrapper cleanup; - Grid rootPanel = null; - CalendarDatePickerHelper helper = new CalendarDatePickerHelper(); - await helper.PrepareLoadedEvent(); - Microsoft.UI.Xaml.Controls.CalendarDatePicker cp = await helper.GetCalendarDatePicker(); + // This test may be unstable on iOS + await TestHelper.RetryAssert(async () => + { + Grid rootPanel = null; + CalendarDatePickerHelper helper = new CalendarDatePickerHelper(); + await helper.PrepareLoadedEvent(); + Microsoft.UI.Xaml.Controls.CalendarDatePicker cp = await helper.GetCalendarDatePicker(); - rootPanel = await CreateTestResources(); + rootPanel = await CreateTestResources(); - // load into visual tree - await RunOnUIThread(() => - { - rootPanel.Children.Append(cp); - }); + // load into visual tree + await RunOnUIThread(() => + { + rootPanel.Children.Append(cp); + }); - await helper.WaitForLoaded(); + await helper.WaitForLoaded(); - await TestServices.WindowHelper.WaitForIdle(); + await TestServices.WindowHelper.WaitForIdle(); - await helper.PrepareOpenedEvent(); + await helper.PrepareOpenedEvent(); - await RunOnUIThread(() => - { - cp.IsCalendarOpen = true; - }); - await helper.WaitForOpened(); + await RunOnUIThread(() => + { + cp.IsCalendarOpen = true; + }); + await helper.WaitForOpened(); - await helper.PrepareClosedEvent(); + await helper.PrepareClosedEvent(); - await RunOnUIThread(() => - { - cp.IsCalendarOpen = false; - }); + await RunOnUIThread(() => + { + cp.IsCalendarOpen = false; + }); - await helper.WaitForClosed(); + await helper.WaitForClosed(); - await RunOnUIThread(() => - { - // disable CP to make sure input pane is not open during clean up. - cp.IsEnabled = false; + await RunOnUIThread(() => + { + // disable CP to make sure input pane is not open during clean up. + cp.IsEnabled = false; + }); + await TestServices.WindowHelper.WaitForIdle(); }); - await TestServices.WindowHelper.WaitForIdle(); } [TestMethod]