-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] Feature matrix UITest Cases for NavigationPage #31468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Testing] Feature matrix UITest Cases for NavigationPage #31468
Conversation
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces a comprehensive test matrix for NavigationPage functionality to the test infrastructure. The PR adds a new feature matrix test page that provides comprehensive UI testing capabilities for NavigationPage properties, attached properties, and navigation lifecycle events.
- Adds a complete NavigationPage test page with interactive controls for all NavigationPage features
- Implements comprehensive UI tests covering navigation events, visual appearance, and property validation
- Provides detailed event tracking and parameter validation for navigation lifecycle events
Reviewed Changes
Copilot reviewed 5 out of 65 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| NavigationPageFeatureTests.cs | Adds comprehensive UI test suite with 20+ test methods covering navigation events, visual validation, and property testing |
| NavigationPageViewModel.cs | Implements view model with properties for all NavigationPage features and navigation event tracking |
| NavigationPageControlPage.xaml.cs | Implements the main test page with event handlers, navigation logic, and property management |
| NavigationPageControlPage.xaml | Defines the UI layout with controls for testing all NavigationPage features and displaying event information |
| CorePageView.cs | Registers the new NavigationPage feature matrix in the test gallery |
|
|
||
| namespace Microsoft.Maui.TestCases.Tests | ||
| { | ||
| public class NavigationPageFeatureTests : UITest |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test class lacks adequate test coverage as required by the coding guidelines. All code changes should have relevant test cases in both TestCases.HostApp and TestCases.Shared.Tests, and tests should be able to execute properly on TestCases.HostApp.
| System.Diagnostics.Debug.WriteLine($"Push next page error: {ex.Message}"); | ||
| } | ||
| }), | ||
| AutomationId = $"PushPage{pageNumber + 1}Button", |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AutomationIds should be UNIQUE and should NOT be reused, or WaitForElement will fail to find the correct element. The dynamic generation of AutomationIds like 'PushPage{pageNumber + 1}Button' could potentially create duplicate IDs if pages are reused or created in unexpected sequences.
| Assert.That(App.FindElement("CurrentPageLabel").GetText(), Is.EqualTo("Sample Page")); | ||
| } | ||
|
|
||
| #if TEST_FAILS_ON_IOS && !ANDROID && !WINDOWS //Issue |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional compilation directive lacks a proper issue link or explanation. The comment should include a specific GitHub issue URL to track why this test fails on iOS.
| #if TEST_FAILS_ON_IOS && !ANDROID && !WINDOWS //Issue | |
| #if TEST_FAILS_ON_IOS && !ANDROID && !WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/XXXXX |
| VerifyScreenshot(); | ||
| } | ||
|
|
||
| #if TEST_FAILS_ON_ANDROID //Issue Link: https://github.com/dotnet/maui/issues/31445 |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this conditional compilation directive includes an issue link, the comment formatting should be improved for better readability and the excessive trailing spaces should be removed.
| #if TEST_FAILS_ON_ANDROID //Issue Link: https://github.com/dotnet/maui/issues/31445 | |
| #if TEST_FAILS_ON_ANDROID // See issue: https://github.com/dotnet/maui/issues/31445 |
| Command = new Command(async () => { | ||
| try | ||
| { | ||
| _pendingOperation = "Pop"; | ||
| await Navigation.PopAsync(); | ||
| } | ||
| catch (System.Exception ex) | ||
| { | ||
| System.Diagnostics.Debug.WriteLine($"Pop page error: {ex.Message}"); | ||
| } | ||
| }), |
Copilot
AI
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of async void lambda in Command constructor is an anti-pattern that can lead to unhandled exceptions. Consider using a proper async command implementation or handling the Task properly.
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example, TitleIcon_Add_Visual
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2530
at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2547
at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 743
at Microsoft.Maui.TestCases.Tests.NavigationPageFeatureTests.TitleIcon_Add_Visual() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/NavigationPageFeatureTests.cs:line 309
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
|
Hi @jsuarezruiz, I have resolved the issues and committed the changes. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* Added the testbed sample for the NavigationPage Feature Matrix * Added the testcases for NavigationPage * Updated NavigationPageFeatureTests * Added the Snapshots * Added snapshots for mac and windows * Updated the testcases * Update NavigationPageFeatureTests.cs * Update NavigationPageFeatureTests.cs * Added Windows and Mac snapshots * Update TitleViewCleared.png --------- Co-authored-by: nivetha-nagalingam <[email protected]>
* Added the testbed sample for the NavigationPage Feature Matrix * Added the testcases for NavigationPage * Updated NavigationPageFeatureTests * Added the Snapshots * Added snapshots for mac and windows * Updated the testcases * Update NavigationPageFeatureTests.cs * Update NavigationPageFeatureTests.cs * Added Windows and Mac snapshots * Update TitleViewCleared.png --------- Co-authored-by: nivetha-nagalingam <[email protected]>
* Added the testbed sample for the NavigationPage Feature Matrix * Added the testcases for NavigationPage * Updated NavigationPageFeatureTests * Added the Snapshots * Added snapshots for mac and windows * Updated the testcases * Update NavigationPageFeatureTests.cs * Update NavigationPageFeatureTests.cs * Added Windows and Mac snapshots * Update TitleViewCleared.png --------- Co-authored-by: nivetha-nagalingam <[email protected]>
* Added the testbed sample for the NavigationPage Feature Matrix * Added the testcases for NavigationPage * Updated NavigationPageFeatureTests * Added the Snapshots * Added snapshots for mac and windows * Updated the testcases * Update NavigationPageFeatureTests.cs * Update NavigationPageFeatureTests.cs * Added Windows and Mac snapshots * Update TitleViewCleared.png --------- Co-authored-by: nivetha-nagalingam <[email protected]>
* Added the testbed sample for the NavigationPage Feature Matrix * Added the testcases for NavigationPage * Updated NavigationPageFeatureTests * Added the Snapshots * Added snapshots for mac and windows * Updated the testcases * Update NavigationPageFeatureTests.cs * Update NavigationPageFeatureTests.cs * Added Windows and Mac snapshots * Update TitleViewCleared.png --------- Co-authored-by: nivetha-nagalingam <[email protected]>

This pull request adds a new feature matrix test page for
NavigationPageto the test host app. The main changes introduce a comprehensive UI for testing and interacting with variousNavigationPagefeatures, including navigation events, bar colors, icon colors, and navigation bar settings.Addition of NavigationPage Feature Matrix:
NavigationPageControlPageto the test case gallery list inCorePageView.cs, making it accessible from the test app's main navigation.NavigationPageControlPage.xaml, which provides a detailed UI for testingNavigationPagefeatures such as navigation actions, bar background and text colors, icon color, title attachments, and navigation bar settings. The page includes controls for triggering navigation events, updating bar appearance, and toggling navigation bar options.Screen.Recording.2025-09-03.at.7.22.17.PM.mov