From bff4ab04ff043207b6bfd3a202f2a22ff689e200 Mon Sep 17 00:00:00 2001 From: Tamilarasan Paranthaman <93904422+Tamilarasan-Paranthaman@users.noreply.github.com> Date: Fri, 10 Jan 2025 23:25:46 +0530 Subject: [PATCH] [Windows] Fix for Flyout Content Template not updating dynamically (#26536) * Windows FlyoutContentTemplate fix * Enabled test case * Test script changes --- .../src/Core/Handlers/Shell/ShellHandler.cs | 1 + .../Issues/XFIssue/ShellFlyoutContent.cs | 24 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs b/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs index 491366642de9..3e95a660e4db 100644 --- a/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs +++ b/src/Controls/src/Core/Handlers/Shell/ShellHandler.cs @@ -33,6 +33,7 @@ public partial class ShellHandler [nameof(Shell.FlyoutItems)] = MapFlyoutItems, #if WINDOWS [nameof(Shell.FlyoutIcon)] = MapFlyoutIcon, + [nameof(Shell.FlyoutContentTemplate)] = MapFlyout, #endif }; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContent.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContent.cs index ad62a2c5c6e6..248e97718622 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContent.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/ShellFlyoutContent.cs @@ -1,5 +1,4 @@ -#if TEST_FAILS_ON_WINDOWS // On Windows, the Shell Flyout Content Template does not update dynamically. Issue: https://github.com/dotnet/maui/issues/26435. -using NUnit.Framework; +using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -7,6 +6,15 @@ namespace Microsoft.Maui.TestCases.Tests.Issues; public class ShellFlyoutContent : _IssuesUITest { + +#if WINDOWS //In Windows AutomationId for FlyoutItems not works in Appium. + const string FlyoutItem = "Flyout Item Top"; + const string ResetButton = "Click to Reset"; +#else + const string FlyoutItem = "FlyoutItem"; + const string ResetButton = "Reset"; +#endif + public ShellFlyoutContent(TestDevice testDevice) : base(testDevice) { } @@ -18,14 +26,12 @@ public ShellFlyoutContent(TestDevice testDevice) : base(testDevice) public void FlyoutContentTests() { App.WaitForElement("PageLoaded"); - App.TapInShellFlyout("FlyoutItem"); + App.TapInShellFlyout(FlyoutItem); App.Tap("ToggleContent"); App.TapInShellFlyout("ContentView"); - App.Tap("FlyoutItem"); + App.Tap(FlyoutItem); App.Tap("ToggleFlyoutContentTemplate"); - App.TapInShellFlyout("Reset"); - App.Tap("FlyoutItem"); + App.TapInShellFlyout(ResetButton); + App.Tap(FlyoutItem); } -} -#endif - +} \ No newline at end of file