Skip to content

Conversation

@HarishKumarSF4517
Copy link
Contributor

This pull request adds a new feature matrix test page for NavigationPage to the test host app. The main changes introduce a comprehensive UI for testing and interacting with various NavigationPage features, including navigation events, bar colors, icon colors, and navigation bar settings.

Addition of NavigationPage Feature Matrix:

  • Added a new NavigationPageControlPage to the test case gallery list in CorePageView.cs, making it accessible from the test app's main navigation.
  • Introduced a new XAML page, NavigationPageControlPage.xaml, which provides a detailed UI for testing NavigationPage features 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

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Sep 3, 2025
@ghost ghost added the area-testing Unit tests, device tests label Sep 3, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz jsuarezruiz added the area-navigation NavigationPage label Sep 4, 2025
@HarishKumarSF4517 HarishKumarSF4517 marked this pull request as ready for review September 4, 2025 14:11
Copilot AI review requested due to automatic review settings September 4, 2025 14:11
@HarishKumarSF4517 HarishKumarSF4517 requested a review from a team as a code owner September 4, 2025 14:11

This comment was marked as outdated.

@sheiksyedm sheiksyedm requested a review from Copilot September 5, 2025 07:41
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Sep 5, 2025

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.

Copilot uses AI. Check for mistakes.
System.Diagnostics.Debug.WriteLine($"Push next page error: {ex.Message}");
}
}),
AutomationId = $"PushPage{pageNumber + 1}Button",
Copy link

Copilot AI Sep 5, 2025

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.

Copilot uses AI. Check for mistakes.
Assert.That(App.FindElement("CurrentPageLabel").GetText(), Is.EqualTo("Sample Page"));
}

#if TEST_FAILS_ON_IOS && !ANDROID && !WINDOWS //Issue
Copy link

Copilot AI Sep 5, 2025

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.

Suggested change
#if TEST_FAILS_ON_IOS && !ANDROID && !WINDOWS //Issue
#if TEST_FAILS_ON_IOS && !ANDROID && !WINDOWS // Issue Link: https://github.com/dotnet/maui/issues/XXXXX

Copilot uses AI. Check for mistakes.
VerifyScreenshot();
}

#if TEST_FAILS_ON_ANDROID //Issue Link: https://github.com/dotnet/maui/issues/31445
Copy link

Copilot AI Sep 5, 2025

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.

Suggested change
#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

Copilot uses AI. Check for mistakes.
Comment on lines +553 to +563
Command = new Command(async () => {
try
{
_pendingOperation = "Pop";
await Navigation.PopAsync();
}
catch (System.Exception ex)
{
System.Diagnostics.Debug.WriteLine($"Pop page error: {ex.Message}");
}
}),
Copy link

Copilot AI Sep 5, 2025

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.

Copilot uses AI. Check for mistakes.
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Failing tests on Windows.
image

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)

@HarishKumarSF4517
Copy link
Contributor Author

Hi @jsuarezruiz, I have resolved the issues and committed the changes.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen changed the base branch from main to inflight/current September 12, 2025 18:09
@PureWeen PureWeen merged commit 61df9ee into dotnet:inflight/current Sep 12, 2025
78 checks passed
PureWeen pushed a commit that referenced this pull request Sep 18, 2025
* 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]>
PureWeen pushed a commit that referenced this pull request Sep 18, 2025
* 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]>
github-actions bot pushed a commit that referenced this pull request Sep 18, 2025
* 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]>
github-actions bot pushed a commit that referenced this pull request Sep 23, 2025
* 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]>
github-actions bot pushed a commit that referenced this pull request Sep 23, 2025
* 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]>
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-navigation NavigationPage area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants