Skip to content

[Testing] Feature Matrix UITest Cases for CollectionView EmptyView Feature #28679

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

Merged

Conversation

NafeelaNazhir
Copy link
Contributor

@NafeelaNazhir NafeelaNazhir commented Mar 28, 2025

Description

This PR includes a comprehensive set of UI test cases for the CollectionView control. The tests validate the EmptyView feature functionality in CollectionView, including properties such as: EmptyView , EmptyViewTemplate, Header, Footer, ItemsLayout, ItemTemplate, ItemsSource.

  • Added UI test cases covering different EmptyView options (None, String, View, View With Size).
  • Implemented tests for EmptyViewTemplate with different configurations (None, View, View With Size).
  • Verified Header and Footer behavior with multiple configurations (None, String, View).
  • Added ItemsLayout selection test cases for various layout options (Vertical List, Horizontal List, Vertical Grid, Horizontal Grid).
  • Covered ItemTemplate variations (None, Basic DataTemplate).
  • Ensured ItemsSource selection updates dynamically (None, ObservableCollection, Grouped List, Empty Grouped List, Empty ObservableCollection).

EmptyView-Related Issues Identified in CollectionView

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Mar 28, 2025
@NafeelaNazhir NafeelaNazhir added area-testing Unit tests, device tests partner/syncfusion Issues / PR's with Syncfusion collaboration and removed community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Mar 28, 2025
@anandhan-rajagopal anandhan-rajagopal added the community ✨ Community Contribution label Mar 28, 2025
@NafeelaNazhir NafeelaNazhir changed the title [Testing] Feature Matrix UITest Cases for CollectionView Control [Testing] Feature Matrix UITest Cases for CollectionView EmptyView Feature Mar 28, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 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.

Other tests failing on Android:

  • ValidateEmptyViewStringDisplayed_AndItemSourceEmptyObservableCollectionSetFirst
  • ValidateEmptyViewStringDisplayed_AndObservableCollectionSetFirst
  • ValidateEmptyViewStringDisplayed_GroupedListSetFirst
  • ValidateEmptyViewStringDisplayedSetFirst_AndBasicItemTemplate
  • ValidateEmptyViewStringDisplayedSetFirst_AndGroupedList
  • ValidateEmptyViewStringDisplayedSetFirst_AndItemSourceEmptyGroupedList
  • ValidateEmptyViewStringSetFirst_AndObservableCollection
  • ValidateEmptyViewTemplateDisplayed
  • ValidateEmptyViewTemplateDisplayed_AndCustomEmptyView
  • ValidateEmptyViewTemplateDisplayed_AndEmptyGroupedListSetFirst
  • ValidateEmptyViewTemplateDisplayed_AndEmptyViewString
  • ValidateEmptyViewTemplateDisplayed_AndGroupedListSetFirst
  • ValidateEmptyViewTemplateDisplayedSetFirst_AndBaicItemTemplate


[Test]
[Category(UITestCategories.CollectionView)]
public void ValidateECustomEmptyViewSizeDisplayedSetFirst_AndEmptyObservableCollection()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails on Android:

   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 2384
   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 665
   at Microsoft.Maui.TestCases.Tests.CollectionView_EmptyViewFeatureTests.ValidateECustomEmptyViewSizeDisplayedSetFirst_AndEmptyObservableCollection() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_EmptyViewFeatureTests.cs:line 328
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)


[Test]
[Category(UITestCategories.CollectionView)]
public void ValidateEmptyViewStringDisplayed_AndBasicItemTemplateSetFirst()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is failing on Android:

     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 2367
   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 2384
   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 665
   at Microsoft.Maui.TestCases.Tests.CollectionView_EmptyViewFeatureTests.ValidateEmptyViewStringDisplayed_AndBasicItemTemplateSetFirst() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_EmptyViewFeatureTests.cs:line 491
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)


[Test]
[Category(UITestCategories.CollectionView)]
public void ValidateEmptyViewStringDisplayed_AndEmptyGroupedListSetFirst()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test fails on Android:

 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 2367
   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 2384
   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 665
   at Microsoft.Maui.TestCases.Tests.CollectionView_EmptyViewFeatureTests.ValidateEmptyViewStringDisplayed_AndEmptyGroupedListSetFirst() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_EmptyViewFeatureTests.cs:line 131
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)


[Test]
[Category(UITestCategories.CollectionView)]
public void ValidateEmptyViewStringDisplayed_AndEmptyViewTemplate()
Copy link
Contributor

Choose a reason for hiding this comment

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

Fails on Android:

    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 2367
   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 2384
   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 665
   at Microsoft.Maui.TestCases.Tests.CollectionView_EmptyViewFeatureTests.ValidateEmptyViewStringDisplayed_AndEmptyViewTemplate() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_EmptyViewFeatureTests.cs:line 431
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

App.Tap("Apply");
App.WaitForElement("No Items Available(String)");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

misspelling: Baic -> Basic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jsuarezruiz I have corrected the spelling mistake in the latest commit.

@NafeelaNazhir NafeelaNazhir marked this pull request as ready for review March 28, 2025 17:31
@NafeelaNazhir NafeelaNazhir requested a review from a team as a code owner March 28, 2025 17:31
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 adds a comprehensive suite of UI test cases for the CollectionView control, specifically targeting the EmptyView feature and its related configurations such as Header, Footer, ItemsLayout, and ItemTemplate.

  • Introduces several new pages and view model changes for dynamic EmptyView, Header, and Footer updates.
  • Adds various test cases covering different EmptyView options and ItemsSource scenarios.
  • Updates the core gallery page to include the new CollectionView feature.

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
EmptyViewOptionsPage.xaml.cs Implements UI logic for switching between various EmptyView, Header, and Footer options.
CollectionViewViewModal.cs Contains the view model logic for handling the CollectionView test items and configurations.
CollectionViewFeaturePage.xaml.cs Provides a feature page to display the CollectionView UI test cases.
CollectionViewControlPage.xaml.cs Implements the control page for navigating to EmptyView options.
CorePageView.cs Updates the core gallery to include the new CollectionView feature page.
Files not reviewed (3)
  • src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/EmptyView/CollectionViewControlPage.xaml: Language not supported
  • src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/EmptyView/CollectionViewFeaturePage.xaml: Language not supported
  • src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/EmptyView/EmptyViewOptionsPage.xaml: Language not supported
Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/EmptyView/CollectionViewViewModal.cs:31

  • The file name 'CollectionViewViewModal.cs' does not match the class name 'CollectionViewViewModel'. Consider renaming the file to 'CollectionViewViewModel.cs' for consistency.
public class CollectionViewViewModel : INotifyPropertyChanged

@NafeelaNazhir
Copy link
Contributor Author

Other tests failing on Android:

  • ValidateEmptyViewStringDisplayed_AndItemSourceEmptyObservableCollectionSetFirst
  • ValidateEmptyViewStringDisplayed_AndObservableCollectionSetFirst
  • ValidateEmptyViewStringDisplayed_GroupedListSetFirst
  • ValidateEmptyViewStringDisplayedSetFirst_AndBasicItemTemplate
  • ValidateEmptyViewStringDisplayedSetFirst_AndGroupedList
  • ValidateEmptyViewStringDisplayedSetFirst_AndItemSourceEmptyGroupedList
  • ValidateEmptyViewStringSetFirst_AndObservableCollection
  • ValidateEmptyViewTemplateDisplayed
  • ValidateEmptyViewTemplateDisplayed_AndCustomEmptyView
  • ValidateEmptyViewTemplateDisplayed_AndEmptyGroupedListSetFirst
  • ValidateEmptyViewTemplateDisplayed_AndEmptyViewString
  • ValidateEmptyViewTemplateDisplayed_AndGroupedListSetFirst
  • ValidateEmptyViewTemplateDisplayedSetFirst_AndBaicItemTemplate

Hi @jsuarezruiz It looks like all tests passed in the last run link: https://dev.azure.com/xamarin/public/_build/results?buildId=139258&view=ms.vss-test-web.build-test-results-tab

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the nafeela-CollectionView1 branch from fcbb99e to 992d237 Compare April 8, 2025 07:32
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/rebase

@github-actions github-actions bot force-pushed the nafeela-CollectionView1 branch from 992d237 to bd6c6d1 Compare April 14, 2025 13:30
@PureWeen
Copy link
Member

/azp run MAUI-UITests-public

@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen moved this from Approved to Ready To Review in MAUI SDK Ongoing Apr 18, 2025
rmarinho
rmarinho previously approved these changes Apr 21, 2025
@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Apr 21, 2025
@PureWeen PureWeen changed the base branch from main to inflight/candidate April 22, 2025 20:26
@PureWeen PureWeen changed the base branch from inflight/candidate to main April 22, 2025 20:26
@PureWeen PureWeen dismissed rmarinho’s stale review April 22, 2025 20:26

The base branch was changed.

@PureWeen PureWeen changed the base branch from main to inflight/candidate April 22, 2025 20:27
@PureWeen PureWeen merged commit b1c026c into dotnet:inflight/candidate Apr 22, 2025
128 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Apr 22, 2025
PureWeen added a commit that referenced this pull request Apr 23, 2025
### Description of Change

## .NET MAUI Release Notes - Inflight/Candidate

## What's Changed

### MAUI Product Fixes
* Fix CarouselView layout SR6 regressions by @albyrock87 in
#29035
* Revert "[Android] picker - focus/unfocus events (#28122)" by @PureWeen
in https://github.com/dotnet/maui/pull/1fb5164929
* [Windows] Fixed the flyout content width not being set correctly after
updating to WinUI SDK 1.7 by @Tamilarasan-Paranthaman in
#28996
* [Android] picker - focus/unfocus events by @kubaflo in
#28122
* [XC] add IRootObjectProvider by @StephaneDelcroix in
#28310
* [iOS] Fix for the File.ContentType from MediaPicker not being in valid
MIME format by @SyedAbdulAzeemSF4852 in
#28842
* [Android] Fixed the Incorrect Text Color Applied to Selected Tab in
TabbedPage by @Ahamed-Ali in #28844
* [iOS] Fix FlyoutPage does not respond to changes in the
FlyoutLayoutBehavior property by @devanathan-vaithiyanathan in
#28884
* [Android] Fixed ScalingCanvas.SetBlur not working by
@NirmalKumarYuvaraj in #28911
* [iOS] - Resolved Proper Rendering of Dynamic Header/Footer Updates in
CV2 by @prakashKannanSf3972 in #28641
* [iOS] Fixed the TargetInvocationException Occurs When Selecting
Header/Footer After Changing ItemsLayout in CV2 by @Ahamed-Ali in
#28890
* [Windows] - Fix Visual State Issue with Picker TextColor After
Navigation by @prakashKannanSf3972 in
#28746

### Dependency Updates
* [Windows] Upgrade to Windows App SDK 1.7 by @MartyIX in
#28499

### Testing
* [Testing] Feature Matrix UITest Cases for CollectionView EmptyView
Feature by @NafeelaNazhir in #28679
* Fixed Test case failure in PR 29037 - [2025/04/21] Candidate by
@HarishKumarSF4517 in #29049

**Full Changelog**:
main...inflight/candidate


For more information about inflight process check
https://github.com/dotnet/maui/wiki/Inflight-Branch-Process
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2025
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
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants