From 8e6894b5b164a56151327f1112d08e2fa39393a3 Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Fri, 6 Dec 2024 14:22:46 +0100 Subject: [PATCH] fix: Make ImageStretch_None wait for images to actually load Images displayed on the ImageStretch_None page are coming from the uno-assets.platform.uno site, and may not have loaded yet when the sample runs --- .../ImageTests/UnoSamples_Tests.Image.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Controls/ImageTests/UnoSamples_Tests.Image.cs b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Controls/ImageTests/UnoSamples_Tests.Image.cs index 0d22270034b1..6f98d4ff4ce8 100644 --- a/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Controls/ImageTests/UnoSamples_Tests.Image.cs +++ b/src/SamplesApp/SamplesApp.UITests/Windows_UI_Xaml_Controls/ImageTests/UnoSamples_Tests.Image.cs @@ -65,8 +65,7 @@ public void ImageStretch_None() void HasValidSize(string name) { var rect = _app.Query(q => q.All().Marked(name)).First().Rect; - Assert.That(rect.Width != 0); - Assert.That(rect.Height != 0); + _app.WaitFor(() => rect.Width != 0 && rect.Height != 0, timeout: TimeSpan.FromSeconds(2)); } HasValidSize("image01");