Skip to content

Commit

Permalink
Merge pull request #18890 from ramezgerges/shapevisual_viewbox_test_f…
Browse files Browse the repository at this point in the history
…laky

chore: fix When_ShapeVisual_ViewBox_Shape_Combinations flakiness
  • Loading branch information
ramezgerges authored Nov 27, 2024
2 parents 5b90f03 + 19cf3f2 commit d12128a
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Hosting;
using Microsoft.UI.Xaml.Media;
using Private.Infrastructure;
using Uno.UI.RuntimeTests.Helpers;

namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Composition;
Expand All @@ -16,7 +17,6 @@ public class Given_ShapeVisual
#if __SKIA__
[RequiresFullWindow]
[TestMethod]
[Ignore("https://github.com/unoplatform/uno/issues/18752")]
public async Task When_ShapeVisual_ViewBox_Shape_Combinations()
{
// runtime test version of the ShapeVisualClipping sample
Expand Down Expand Up @@ -76,9 +76,21 @@ public async Task When_ShapeVisual_ViewBox_Shape_Combinations()
Source = new Uri($"ms-appx:/Assets/When_ShapeVisual_ViewBox_Shape_Combinations/{filename}")
};

var imageOpened = false;
referenceImage.ImageOpened += (s, e) => imageOpened = true;

await UITestHelper.Load(referenceImage);
await TestServices.WindowHelper.WaitFor(() => imageOpened);
var screenShot2 = await UITestHelper.ScreenShot(referenceImage);
await ImageAssert.AreEqualAsync(screenShot1, screenShot2);
// there can be a very small _bit_ difference when drawing with metal on macOS
if (OperatingSystem.IsMacOS())
{
await ImageAssert.AreSimilarAsync(screenShot1, screenShot2);
}
else
{
await ImageAssert.AreEqualAsync(screenShot1, screenShot2);
}
}
}
}
Expand Down

0 comments on commit d12128a

Please sign in to comment.