Skip to content

[Testing] Feature matrix UITest Cases for Map Control#30954

Closed
HarishKumarSF4517 wants to merge 14 commits intomainfrom
unknown repository
Closed

[Testing] Feature matrix UITest Cases for Map Control#30954
HarishKumarSF4517 wants to merge 14 commits intomainfrom
unknown repository

Conversation

@HarishKumarSF4517
Copy link
Copy Markdown
Contributor

@HarishKumarSF4517 HarishKumarSF4517 commented Jul 31, 2025

This pull request adds a new feature to test map controls in the app. It includes UI components to test user interaction, map behavior, and customization. Key changes include a Map Feature Matrix page, a main Map Control page, and a Map Options page for configuration.
Note: Tests are added only for iOS and macOS, as Maps aren't supported on Windows and require an API key on Android.

New Map Feature Matrix Page

  • Added a new entry for the MapControlPage in the CorePageView to include it in the feature matrix navigation.
  • Created MapControlPage.xaml to define the UI for displaying a map and its interactive elements, including labels for map and marker click events, and bindings for various map properties.
  • Implemented MapControlPage.xaml.cs to handle map interactions, synchronize map state with the ViewModel, and manage events like map clicks, pin additions, and property changes.
  • Added MapOptionsPage.xaml to provide a UI for configuring map behavior and properties, such as visibility, zoom, traffic, and user location. It also includes options to manage pins and map elements.
MapFeatureMatrix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 31, 2025
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @@HarishKumarSF4517! 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 the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 31, 2025
@ghost ghost added the area-testing Unit tests, device tests label Jul 31, 2025
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
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.

Pending snapshots already available in the latest build.
image
Could you commit the images?

@HarishKumarSF4517 HarishKumarSF4517 marked this pull request as ready for review August 6, 2025 11:21
Copilot AI review requested due to automatic review settings August 6, 2025 11:21
@HarishKumarSF4517 HarishKumarSF4517 requested a review from a team as a code owner August 6, 2025 11:21
Copy link
Copy Markdown
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 adds comprehensive UI testing infrastructure for Map controls in the .NET MAUI framework. The implementation provides a feature matrix testing approach to validate various map functionalities including user interaction, visual elements, and map behavior configurations.

  • Introduces a complete testing framework for Map controls with over 30 test scenarios covering visibility, user location, map types, elements, and templating
  • Creates a sophisticated options page with controls for managing map properties, pins, elements, and templating features
  • Implements a ViewModel-based architecture for managing map state and synchronizing between UI components

Reviewed Changes

Copilot reviewed 7 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
MapFeatureTests.cs Comprehensive test suite with 30+ test cases covering map visibility, user location, element types, zoom/scroll functionality, and templating scenarios
MapViewModel.cs ViewModel implementing map state management with properties for user location, map type, pins, elements, and data templating
MapOptionsPage.xaml.cs Code-behind implementing complex map configuration logic including pin management, element creation, and template setup
MapOptionsPage.xaml XAML defining the options UI with checkboxes, radio buttons, and control buttons for map configuration
MapControlPage.xaml.cs Main map page implementation handling map events, pin synchronization, and navigation between pages
MapControlPage.xaml XAML defining the main map display with event labels and property bindings
CorePageView.cs Registration of the new Map Feature Matrix page in the main gallery navigation

var rect =App.WaitForElement("MapView").GetRect();
App.DragCoordinates(rect.CenterX(), rect.CenterY(), rect.CenterX(), rect.CenterY() - 100);

Thread.Sleep(2000);
Copy link

Copilot AI Aug 6, 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 a code smell that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic wait condition instead of an arbitrary 2-second delay.

Suggested change
Thread.Sleep(2000);
App.WaitFor(() => App.WaitForElement("VisibleRegionLatitudeDegrees").GetText() != value, timeout: TimeSpan.FromSeconds(5));

Copilot uses AI. Check for mistakes.
var rect =App.WaitForElement("MapView").GetRect();
App.DragCoordinates(rect.CenterX() - 100, rect.CenterY(), rect.CenterX(), rect.CenterY() - 100);

Thread.Sleep(2000);
Copy link

Copilot AI Aug 6, 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 a code smell that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic wait condition instead of an arbitrary 2-second delay.

Suggested change
Thread.Sleep(2000);
// Wait up to 5 seconds for the value to change after dragging
bool valueChanged = UITestUtils.WaitForValueToChange(() => App.WaitForElement("VisibleRegionLatitudeDegrees").GetText(), value, timeoutMs: 5000, pollIntervalMs: 250);
Assert.That(valueChanged, Is.True, "VisibleRegionLatitudeDegrees did not change after drag.");

Copilot uses AI. Check for mistakes.
var rect =App.WaitForElement("MapView").GetRect();
App.DragCoordinates(rect.CenterX(), rect.CenterY(), rect.CenterX(), rect.CenterY() - 100);

Thread.Sleep(2000);
Copy link

Copilot AI Aug 6, 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 a code smell that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic wait condition instead of an arbitrary 2-second delay.

Suggested change
Thread.Sleep(2000);
WaitForVisibleRegionLatitudeDegreesToChange(value, timeoutInSeconds: 5);

Copilot uses AI. Check for mistakes.
var rect =App.WaitForElement("MapView").GetRect();
App.DragCoordinates(rect.CenterX(), rect.CenterY(), rect.CenterX(), rect.CenterY() - 100);

Thread.Sleep(2000);
Copy link

Copilot AI Aug 6, 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 a code smell that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic wait condition instead of an arbitrary 2-second delay.

Suggested change
Thread.Sleep(2000);
App.WaitFor(() => App.WaitForElement("VisibleRegionLatitudeDegrees").GetText() != value, timeout: TimeSpan.FromSeconds(5));

Copilot uses AI. Check for mistakes.
var rect =App.WaitForElement("MapView").GetRect();
App.DragCoordinates(rect.CenterX(), rect.CenterY(), rect.CenterX(), rect.CenterY() - 100);

Thread.Sleep(2000);
Copy link

Copilot AI Aug 6, 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 a code smell that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic wait condition instead of an arbitrary 2-second delay.

Suggested change
Thread.Sleep(2000);
App.WaitFor(() => App.WaitForElement("VisibleRegionLatitudeDegrees").GetText() != value, timeout: TimeSpan.FromSeconds(5));

Copilot uses AI. Check for mistakes.
var rect =App.WaitForElement("MapView").GetRect();
App.DragCoordinates(rect.CenterX() - 100, rect.CenterY(), rect.CenterX(), rect.CenterY() - 100);

Thread.Sleep(2000);
Copy link

Copilot AI Aug 6, 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 a code smell that can lead to flaky tests. Consider using App.WaitForElement with a timeout or a more deterministic wait condition instead of an arbitrary 2-second delay.

Copilot uses AI. Check for mistakes.
…MapFeatureTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
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.

Pending snapshots:
image
Already available in the latest build, could you commit the images?

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
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.

There are some failing tests on Mac:
image

Small differences:
Snapshot different than baseline: Map_Pins_WithItemTemplateSelector_WithVisibleRegion.png (1.19% difference)
image

@ghost ghost closed this by deleting the head repository Sep 17, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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