[Testing] Feature Matrix UITest Cases for RefreshView Control#30614
Conversation
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@jsuarezruiz I have added the pending snapshots in the latest commit. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@jsuarezruiz I have added the pending snapshots in the latest commit. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jsuarezruiz
left a comment
There was a problem hiding this comment.
Previously included, but the test ProgressSpinnerNotDisabledOnStartup that is a RefreshView test, is failing on Android.
Failed ProgressSpinnerNotDisabledOnStartup [11 s]
Error Message:
VisualTestUtils.VisualTestFailedException :
Snapshot different than baseline: Issue28343_ProgressSpinnerDisabled.png (2.70% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.
Could you review it in this PR?
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive UI test cases for the RefreshView control to validate its functionality across different platforms. The implementation includes a feature matrix test page that tests properties like Command, CommandParameter, FlowDirection, IsEnabled, IsVisible, IsRefreshing, RefreshColor, and Shadow with different content types.
Key changes include:
- Addition of RefreshView feature matrix UI test infrastructure with XAML pages and ViewModel
- Comprehensive test suite covering RefreshView properties and pull-to-refresh interactions
- Platform-specific conditional compilation for Catalyst and Windows limitations
Reviewed Changes
Copilot reviewed 9 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| RefreshViewFeatureTests.cs | New comprehensive test suite with 13 test methods validating RefreshView functionality |
| RefreshViewControlPage.xaml/.cs | Main UI page for testing RefreshView with dynamic content switching between ScrollView and CollectionView |
| RefreshViewOptionsPage.xaml/.cs | Configuration page allowing interactive property modifications for RefreshView testing |
| RefreshViewViewModel.cs | ViewModel implementing property binding and command execution for RefreshView operations |
| Issue28343.cs | Updated existing issue test with additional UI elements and scroll functionality |
| CorePageView.cs | Registration of new RefreshView Feature Matrix in the gallery navigation |
| App.WaitForElement("RefreshNotTriggered"); | ||
| App.WaitForElement("ListItem0"); | ||
| App.ScrollUp("CollectionView"); | ||
| Thread.Sleep(1000); |
There was a problem hiding this comment.
Using Thread.Sleep in UI tests is unreliable and can cause flaky tests. Consider using App.WaitForElement with a timeout or App.WaitForNoElement instead of Thread.Sleep for better test stability.
| Thread.Sleep(1000); | |
| App.WaitForElement("RefreshNotTriggered", "Waiting for RefreshNotTriggered to appear after scrolling", TimeSpan.FromSeconds(10)); |
| private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) | ||
| { | ||
| SetScrollViewContent(); | ||
| BindingContext = _viewModel = new RefreshViewViewModel(); |
There was a problem hiding this comment.
Creating a new ViewModel instance and reassigning the field in the NavigateToOptionsPage_Clicked method will lose the current state. This could cause unexpected behavior when returning from the options page. Consider preserving the existing ViewModel state or clearly documenting this reset behavior.
| BindingContext = _viewModel = new RefreshViewViewModel(); |
| _viewModel.RefreshColor = Colors.Orange; | ||
| break; | ||
| default: | ||
| _viewModel.RefreshColor = null; |
There was a problem hiding this comment.
Setting RefreshColor to null in the default case may not be the intended behavior. Consider using a default color value or removing this case if no default handling is needed.
| _viewModel.RefreshColor = null; | |
| _viewModel.RefreshColor = Colors.Gray; // Assign a default color |
@jsuarezruiz I have updated the ProgressSpinnerNotDisabledOnStartup test case to address the snapshot mismatch on Android |
|
I have been working on this PR: #30692 This should make it more consistent. Also, I found that if you use the "scroll up" gesture on appium, it does pull to refresh. |
|
There is also a |
@mattleibow I have replaced DragCoordinates with the ScrollUp method in the test cases. |
@mattleibow I have checked the RefreshViewPage.cs hostapp sample its not been unused. It verifies the test (src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/RefreshViewTests.cs) whether the Refreshing event and the RefreshView command set IsRefreshing to true and false. |
|
I don't know if you also cover this case, but i suggest to test also the case when Command is null; in this case RefreshView should not show any activity animation. Here there is an open issue for Windows about this #12977 |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
* added test cases * updated test cases * updated ui * added test cases * added failing condition * added Android and iOS snapshots * added snapshots * removed VerifyScreenshot * added additional test case * added mac snapshot * modified ProgressSpinnerNotDisabledOnStartup test case * Replaced DragCoordinates with the ScrollUp method
* added test cases * updated test cases * updated ui * added test cases * added failing condition * added Android and iOS snapshots * added snapshots * removed VerifyScreenshot * added additional test case * added mac snapshot * modified ProgressSpinnerNotDisabledOnStartup test case * Replaced DragCoordinates with the ScrollUp method
* added test cases * updated test cases * updated ui * added test cases * added failing condition * added Android and iOS snapshots * added snapshots * removed VerifyScreenshot * added additional test case * added mac snapshot * modified ProgressSpinnerNotDisabledOnStartup test case * Replaced DragCoordinates with the ScrollUp method
* added test cases * updated test cases * updated ui * added test cases * added failing condition * added Android and iOS snapshots * added snapshots * removed VerifyScreenshot * added additional test case * added mac snapshot * modified ProgressSpinnerNotDisabledOnStartup test case * Replaced DragCoordinates with the ScrollUp method
* added test cases * updated test cases * updated ui * added test cases * added failing condition * added Android and iOS snapshots * added snapshots * removed VerifyScreenshot * added additional test case * added mac snapshot * modified ProgressSpinnerNotDisabledOnStartup test case * Replaced DragCoordinates with the ScrollUp method




This PR includes a comprehensive set of UI test cases for the RefreshView control. The tests validate the RefreshView control functionality, including properties such as Command, CommandParameter, FlowDirection, IsEnabled, IsVisible, IsRefreshing, RefreshColor, and Shadow, along with pull-to-refresh interactions with different content types (ScrollView and CollectionView).
RefreshView Control Implementation:
Added RefreshViewControlMainPage to host the RefreshView control, with bindings for properties like Command, CommandParameter, FlowDirection, IsEnabled, IsVisible, IsRefreshing, RefreshColor, and Shadow. The control dynamically switches between ScrollView and CollectionView content to demonstrate refresh functionality with different scrollable containers.
Created RefreshViewOptionsPage to allow users to configure RefreshView properties interactively, including command parameter selection, state control, layout direction, refresh color selection, and visual effects configuration.
Added event handlers for property changes in RefreshViewOptionsPage.xaml.cs to update the RefreshView control dynamically through a ViewModel pattern, enabling real-time property modifications and validation.
Implemented RefreshViewViewModel with comprehensive property binding and Command execution that handles refresh operations, parameter-based content changes, and status tracking.
Implemented a suite of UI tests in RefreshViewFeatureTests to validate default state verification, pull-to-refresh functionality with different content types, command parameter handling, state management (IsEnabled, IsVisible, IsRefreshing), refresh color styling, flow direction support, shadow effects, and visual verification of property configurations using VerifyScreenshot() across platforms with platform-specific conditional compilation for Catalyst and Windows limitations.
Issues Identified
Screen.Recording.2025-07-14.at.6.37.11.PM.mov