Skip to content

Commit

Permalink
Add ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
japarson committed Apr 16, 2024
1 parent 28964e8 commit 4bcd85b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Controls/samples/Controls.Sample.UITests/Issues/Issue17665.cs
Original file line number Diff line number Diff line change
@@ -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,
}
};
}
}
}
26 changes: 26 additions & 0 deletions src/Controls/tests/UITests/Tests/Issues/Issue17665.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}

0 comments on commit 4bcd85b

Please sign in to comment.