Skip to content

[Testing] Feature matrix UITest Cases for Secondary Toolbar #30811

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

Open
wants to merge 8 commits into
base: net10.0
Choose a base branch
from

Conversation

NafeelaNazhir
Copy link
Contributor

This pull request introduces a new ToolbarFeaturePage to the application, enhancing the Primary and Secondary toolbar functionality and adding comprehensive test coverage. The changes include the addition of a new feature matrix page, implementation of toolbar item interactions, and updates to existing test cases to improve compatibility and functionality.

New Toolbar Feature Implementation:

  • Added a new ToolbarFeaturePage to the CorePageView navigation, allowing users to interact with various toolbar items and test their behaviors (src/Controls/tests/TestCases.HostApp/CoreViews/CorePageView.cs).
  • Created ToolbarFeaturePage.xaml to define the UI layout and toolbar items, including primary and secondary toolbar items with various properties (src/Controls/tests/TestCases.HostApp/FeatureMatrix/ToolbarItem/ToolbarFeaturePage.xaml).
  • Implemented ToolbarFeaturePage.xaml.cs to handle toolbar item interactions, such as enabling/disabling items, changing text, and modifying commands dynamically (src/Controls/tests/TestCases.HostApp/FeatureMatrix/ToolbarItem/ToolbarFeaturePage.xaml.cs).

Test Coverage for Toolbar Features:

  • Added a new test suite, ToolbarFeatureTests, to validate toolbar item behaviors, including enabling/disabling, text changes, command updates, and interactions between primary and secondary items (src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ToolbarFeatureTests.cs).

Updates to Existing Test Cases:

  • Updated test cases for issues (Issue20177, Issue29499, Issue7156, Issue6127) to replace toolbar interaction methods with App.WaitForMoreButton and App.TapMoreButton, ensuring compatibility across platforms (src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20177.cs, Issue29499.cs, Issue7156.cs, Issue6127.cs) [1] [2] [3] [4] [5] [6] [7].

Issues Identified

Screen.Recording.2025-07-24.at.4.00.19.PM.mov

Copy link
Contributor

Hey there @@NafeelaNazhir! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jul 24, 2025
@NafeelaNazhir NafeelaNazhir added area-testing Unit tests, device tests area-controls-toolbar ToolBar labels Jul 24, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review July 25, 2025 07:09
@Copilot Copilot AI review requested due to automatic review settings July 25, 2025 07:09
@NafeelaNazhir NafeelaNazhir requested a review from a team as a code owner July 25, 2025 07:09
Copy link
Contributor

@Copilot 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 comprehensive test coverage for Primary and Secondary toolbar functionality by adding a new ToolbarFeaturePage to the test application and implementing corresponding UI tests. The changes standardize toolbar interaction methods across existing test cases and add new feature matrix testing capabilities.

Key Changes:

  • Added a new ToolbarFeaturePage with comprehensive toolbar item testing capabilities
  • Updated existing test cases to use standardized toolbar interaction methods (App.WaitForMoreButton and App.TapMoreButton)
  • Implemented extensive test coverage for toolbar item behaviors including enable/disable, text changes, and command modifications

Reviewed Changes

Copilot reviewed 8 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Controls/tests/TestCases.HostApp/CoreViews/CorePageView.cs Added navigation entry for new ToolbarFeaturePage
src/Controls/tests/TestCases.HostApp/FeatureMatrix/ToolbarItem/ToolbarFeaturePage.xaml Created XAML layout defining toolbar items and test UI controls
src/Controls/tests/TestCases.HostApp/FeatureMatrix/ToolbarItem/ToolbarFeaturePage.xaml.cs Implemented code-behind logic for toolbar item interactions and state management
src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ToolbarFeatureTests.cs Added comprehensive test suite for toolbar functionality validation
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue20177.cs Updated platform constraints and standardized toolbar interaction methods
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29499.cs Updated platform constraints and replaced direct Selenium calls
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue7156.cs Removed Windows-only constraint and standardized toolbar methods
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/XFIssue/Issue6127.cs Updated comment to reference specific GitHub issue

App.WaitForElement("IsEnabledButton2");
App.Tap("IsEnabledButton2");
// Wait for 1 seconds to ensure the button is disabled after the delay
Thread.Sleep(1000);
Copy link
Preview

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

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

Using Thread.Sleep in UI tests is an anti-pattern that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic waiting mechanism instead.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The element is initially enabled and transitions to a disabled state after a one-second delay introduced at the sample level. Since the element is already present in the UI, Thread.Sleep is used to accommodate the known timing of this state change. In this context, WaitForElement is not appropriate, as it only waits for the element to appear , not for changes in its enabled or disabled state.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-toolbar ToolBar 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.

2 participants