Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
16c0e0d
changes added
devanathan-vaithiyanathan Sep 24, 2024
22d7398
changes added
devanathan-vaithiyanathan Sep 24, 2024
4e1c926
Merge branch 'fix-13810' of https://github.com/devanathan-vaithiyanat…
devanathan-vaithiyanathan Sep 27, 2024
4632a2d
UI Testcases added
Dhivya-SF4094 Nov 5, 2024
226352e
Attached screenshots
Dhivya-SF4094 Nov 6, 2024
2826ecc
updated testcases.
Vignesh-SF3580 Nov 20, 2024
44e8bfc
Merge branch 'main' of https://github.com/devanathan-vaithiyanathan/m…
Vignesh-SF3580 Dec 3, 2024
06e9530
Merge branch 'main' into fix-13810
devanathan-vaithiyanathan Dec 5, 2024
4b9074c
Revert "Fixed CollectionViewHandler2 null reference exception if Item…
devanathan-vaithiyanathan Jan 8, 2025
92a1c94
Reapply "Fixed CollectionViewHandler2 null reference exception if Ite…
devanathan-vaithiyanathan Jan 8, 2025
53764a1
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan Jan 10, 2025
7666e57
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan Jan 15, 2025
19d79a6
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan Jan 16, 2025
fce9a9a
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan Jan 20, 2025
0870f89
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan Jan 22, 2025
106a119
Merge branch 'dotnet:main' into main
devanathan-vaithiyanathan Jan 23, 2025
6d91239
Merge branch 'main' of https://github.com/devanathan-vaithiyanathan/m…
Vignesh-SF3580 Jan 28, 2025
5035f51
Added null check for MauiContext in TabbedPage.Windows.cs
Vignesh-SF3580 Jan 28, 2025
d85371d
updated TabbedPage.Windows.cs
Vignesh-SF3580 Feb 5, 2025
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
3 changes: 0 additions & 3 deletions src/Controls/src/Core/NavigationPage/NavigationPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ void FireAppearing(Page page)
void RemoveFromInnerChildren(Element page)
{
InternalChildren.Remove(page);

// TODO For NET9 we should remove this because the DisconnectHandlers will take care of it
page.Handler = null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like this change is causing the winui device tests to crash.

you can download the crash dump from the artifacts and analyze it inside VS to see the exception.

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi! @devanathan-vaithiyanathan can you please fix it? It is an annoying bug that would be great to have fixed as soon as possible. I can help you if you want :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@PureWeen I have updated the code to include null checks for MauiContext to address the WinUI device test crashes. Could you please review the changes and let me know if you have any further concerns?

}

void SafePop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,6 @@ void SetupBuilder()
});
}

[Theory]
[ClassData(typeof(FlyoutPageLayoutBehaviorTestCases))]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This test has two different cases that need to be captured in the UITest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the test case PoppingFlyoutPageDoesntCrash, the flow involves navigating to the FlyoutPage using PushAsync and then returning to the previous page using PopAsync. Both Push and Pop scenarios have been addressed in the updated test cases. Could you please review the changes and let me know if you have any concerns?

public async Task PoppingFlyoutPageDoesntCrash(Type flyoutPageType)
{
SetupBuilder();
var navPage = new NavigationPage(new ContentPage()) { Title = "App Page" };

await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(navPage), async (handler) =>
{
var flyoutPage = CreateFlyoutPage(
flyoutPageType,
new NavigationPage(new ContentPage() { Content = new Border(), Title = "Detail" }),
new ContentPage() { Title = "Flyout" });

await navPage.PushAsync(flyoutPage);
await navPage.PopAsync();
});
}

[Theory]
[ClassData(typeof(FlyoutPageLayoutBehaviorTestCases))]
public async Task SwappingDetailPageWorksForSplitFlyoutBehavior(Type flyoutPageType)
Expand Down
91 changes: 91 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue10274.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 10274, "MAUI Flyout does not work on Android when not using Shell", PlatformAffected.Android)]
public class Issue10274 : NavigationPage
{
public Issue10274() : base(new MainPage())
{

}

public class MainPage : ContentPage
{
public MainPage()
{
var button = new Button
{
Text = "Navigate to Flyout Page",
AutomationId = "mainPageButton"
};

button.Clicked += OnNavigateToFlyoutPageClicked;

var label = new Label
{
Text = "This is MainPage",
AutomationId = "mainPageLabel"
};

Content = new StackLayout
{
Padding = new Thickness(20),
Children = { label, button }
};
}
private async void OnNavigateToFlyoutPageClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new CustomFlyoutPage());
}
}

public class CustomFlyoutPage : FlyoutPage
{
public CustomFlyoutPage()
{
Flyout = new ContentPage
{
Title = "Flyout",
Content = new StackLayout
{
Padding = new Thickness(20),
Children =
{
new Label { Text = "This is the Flyout page." }
}
}
};

var button = new Button
{
Text = "Go Back",
AutomationId = "flyoutPageButton"
};
button.Clicked += OnGoBackClicked;

var label = new Label
{
Text = "This is FlyoutPage",
AutomationId = "flyoutPageLabel"
};

var detailPage = new ContentPage
{
Title = "Detail",
Content = new StackLayout
{
Padding = new Thickness(20),
Children = { label, button }
}
};

Detail = new NavigationPage(detailPage);
}

private async void OnGoBackClicked(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue10274 : _IssuesUITest
{
public Issue10274(TestDevice device): base(device)
{
}

public override string Issue => "MAUI Flyout does not work on Android when not using Shell";

[Test]
[Category(UITestCategories.FlyoutPage)]
public void FlyoutPageNavigation()
{
App.WaitForElement("mainPageButton");
App.Tap("mainPageButton"); // Navigate to FlyoutPage using PushAsync()

var flyoutLabel = App.WaitForElement("flyoutPageLabel");
Assert.That(flyoutLabel.GetText(), Is.EqualTo("This is FlyoutPage"));

App.Tap("flyoutPageButton"); // Navigate to MainPage using PopAsync()

var mainLabel = App.WaitForElement("mainPageLabel");
Assert.That(mainLabel.GetText(), Is.EqualTo("This is MainPage"));
}
}
}