From 4bcd85b9bb3ff03070f3c2e6b8161a3284d6e960 Mon Sep 17 00:00:00 2001 From: James Parsons Date: Thu, 4 Apr 2024 13:29:48 -0700 Subject: [PATCH] Add ui test --- .../Issues/Issue17665.cs | 22 ++++++++++++++++ .../tests/UITests/Tests/Issues/Issue17665.cs | 26 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/Controls/samples/Controls.Sample.UITests/Issues/Issue17665.cs create mode 100644 src/Controls/tests/UITests/Tests/Issues/Issue17665.cs diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17665.cs b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17665.cs new file mode 100644 index 000000000000..c811c898a488 --- /dev/null +++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue17665.cs @@ -0,0 +1,22 @@ +using Microsoft.Maui.Controls; + +namespace Maui.Controls.Sample.Issues +{ + [Issue(IssueTracker.Github, 17665, "Image is not centered in AspectFill mode", PlatformAffected.UWP)] + public class Issue17665 : TestContentPage + { + protected override void Init() + { + Content = + new Grid() + { + new Image() + { + AutomationId = "AspectFillImage", + Aspect = Microsoft.Maui.Aspect.AspectFill, + WidthRequest = 100, + } + }; + } + } +} diff --git a/src/Controls/tests/UITests/Tests/Issues/Issue17665.cs b/src/Controls/tests/UITests/Tests/Issues/Issue17665.cs new file mode 100644 index 000000000000..7659ac379882 --- /dev/null +++ b/src/Controls/tests/UITests/Tests/Issues/Issue17665.cs @@ -0,0 +1,26 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.AppiumTests.Issues +{ + public class Issue17665 : _IssuesUITest + { + public Issue17665(TestDevice device) : base(device) + { + } + + public override string Issue => "Image is not centered in AspectFill mode"; + + [Test] + [Category(UITestCategories.ActionSheet)] + public void Issue17665Test() + { + this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.iOS }, "Only affects Windows."); + + App.WaitForElement("AspectFillImage", timeout: TimeSpan.FromSeconds(4)); + + VerifyScreenshot(); + } + } +}