Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32277.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 32277, "When a FlyoutPage is pushed Modally it doesn't inset the AppBarLayout", PlatformAffected.Android)]
public partial class Issue32277 : NavigationPage
{
public Issue32277()
{
PushAsync(new Issue32277_ContentPage());
}
}

public class Issue32277_ContentPage : ContentPage
{
public Issue32277_ContentPage()
{
Title = "Issue 32277";

Button button = new Button
{
Text = "Push Modal Flyout Page",
AutomationId = "PushModalFlyoutButton"
};
button.Clicked += async (s, e) =>
{
await Navigation.PushModalAsync(new Issue32277_FlyoutPage());
};
Content = new StackLayout
{
Children =
{
button
}
};
}
}

public class Issue32277_FlyoutPage : FlyoutPage
{
public Issue32277_FlyoutPage()
{
Flyout = new ContentPage
{
Title = "Flyout",
Content = new StackLayout
{
Children =
{
new Label
{
Text = "This is the flyout page.",
AutomationId = "FlyoutLabel"
}
}
}
};

Detail = new NavigationPage(new ContentPage
{
Title = "Detail",
Content = new StackLayout
{
Children =
{
new Label
{
Text = "This is the detail page.",
AutomationId = "DetailLabel"
}
}
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#if ANDROID || IOS // Exclude desktop platforms (Windows, MacCatalyst)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot , replace App.WaitForElement("DetailLabel", "Detail page should be visible with proper insets"); with VerifyScreenshot().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in e3adbcc. Replaced App.WaitForElement("DetailLabel", "Detail page should be visible with proper insets") with VerifyScreenshot() for visual verification of proper AppBarLayout insets.

Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This platform directive unnecessarily restricts the test. According to the UI Testing Guidelines (CodingGuidelineID: 1000002), tests should run on all applicable platforms by default unless there is a specific technical limitation. The HostApp code-behind specifies PlatformAffected.Android, which suggests this is primarily an Android issue, but the test infrastructure will handle platform filtering automatically. Unless FlyoutPage modal navigation has known issues on iOS/Windows/MacCatalyst that would cause the test to fail, this directive should be removed to allow the test to run on all platforms.

Copilot generated this review using guidance from repository custom instructions.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue32277 : _IssuesUITest
{
public Issue32277(TestDevice device) : base(device)
{
}

public override string Issue => "When a FlyoutPage is pushed Modally it doesn't inset the AppBarLayout";

[Test]
[Category(UITestCategories.FlyoutPage)]
public void FlyoutPageModalAppBarLayoutGetsInsets()
{
// Tap the button to push the FlyoutPage modally
App.WaitForElement("PushModalFlyoutButton");
App.Tap("PushModalFlyoutButton");

// Wait for the modal FlyoutPage to appear
App.WaitForElement("DetailLabel");

// Verify the detail page is visible and properly positioned
// If the AppBarLayout insets are not applied correctly, the navigation bar
// would render behind system UI elements
VerifyScreenshot();
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading