diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml index c8472d1ce15f..cdbb69ac5b7f 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml @@ -12,6 +12,11 @@ HorizontalOptions="Center" AutomationId="EmptyViewButton" WidthRequest="400"/> + <Button Text="CollectionViewGrouping" + Clicked="OnGroupingButtonClicked" + HorizontalOptions="Center" + AutomationId="GroupingButton" + WidthRequest="400"/> <Button Text="Header/FooterViewTemplate" Clicked="OnHeaderFooterViewButtonClicked" HorizontalOptions="Center" diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml.cs index f3dfa8106bbd..0d9da9d7a925 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewFeaturePage.xaml.cs @@ -1,31 +1,35 @@ using System; using Microsoft.Maui.Controls; -namespace Maui.Controls.Sample +namespace Maui.Controls.Sample; +public class CollectionViewFeaturePage : NavigationPage { - public class CollectionViewFeaturePage : NavigationPage + public CollectionViewFeaturePage() { - public CollectionViewFeaturePage() - { - PushAsync(new CollectionViewFeatureMainPage()); - } + PushAsync(new CollectionViewFeatureMainPage()); } +} - public partial class CollectionViewFeatureMainPage : ContentPage +public partial class CollectionViewFeatureMainPage : ContentPage +{ + public CollectionViewFeatureMainPage() { - public CollectionViewFeatureMainPage() - { - InitializeComponent(); - } + InitializeComponent(); + } - private async void OnEmptyViewButtonClicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new CollectionViewEmptyViewPage()); - } + private async void OnEmptyViewButtonClicked(object sender, EventArgs e) + { + await Navigation.PushAsync(new CollectionViewEmptyViewPage()); + } - private async void OnHeaderFooterViewButtonClicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new CollectionViewHeaderPage()); - } + private async void OnHeaderFooterViewButtonClicked(object sender, EventArgs e) + { + await Navigation.PushAsync(new CollectionViewHeaderPage()); } + + private async void OnGroupingButtonClicked(object sender, EventArgs e) + { + await Navigation.PushAsync(new CollectionViewGroupingPage()); + } + } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/CollectionViewGroupingPage.xaml b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/CollectionViewGroupingPage.xaml new file mode 100644 index 000000000000..01cc8eb8c28f --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/CollectionViewGroupingPage.xaml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" ?> +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + xmlns:local="clr-namespace:Maui.Controls.Sample" + x:Class="Maui.Controls.Sample.CollectionViewGroupingPage" + Title="CollectionViewControlPage"> + <ContentPage.ToolbarItems> + <ToolbarItem Text="Options" + Clicked="NavigateToOptionsPage_Clicked" + AutomationId="Options"/> + </ContentPage.ToolbarItems> + + <local:CollectionView2 + x:Name="collectionView" + ItemsSource="{Binding ItemsSource}" + Header="{Binding Header}" + Footer="{Binding Footer}" + GroupHeaderTemplate="{Binding GroupHeaderTemplate}" + GroupFooterTemplate="{Binding GroupFooterTemplate}" + ItemTemplate="{Binding ItemTemplate}" + IsGrouped="{Binding IsGrouped}" + CanMixGroups="{Binding CanMixGroups}" + CanReorderItems="{Binding CanReorderItems}" + ItemsLayout="{Binding ItemsLayout}" + AutomationId="CollectionViewControl"> + </local:CollectionView2> + +</ContentPage> \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/CollectionViewGroupingPage.xaml.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/CollectionViewGroupingPage.xaml.cs new file mode 100644 index 000000000000..dfa2f131fc22 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/CollectionViewGroupingPage.xaml.cs @@ -0,0 +1,25 @@ +using System; +using Microsoft.Maui.Controls; +using System.Collections.ObjectModel; + +namespace Maui.Controls.Sample; + +public partial class CollectionViewGroupingPage : ContentPage +{ + private CollectionViewViewModel _viewModel; + + public CollectionViewGroupingPage() + { + InitializeComponent(); + _viewModel = new CollectionViewViewModel(); + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollectionT; + BindingContext = _viewModel; + } + + private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) + { + BindingContext = _viewModel = new CollectionViewViewModel(); + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollectionT; + await Navigation.PushAsync(new GroupingOptionsPage(_viewModel)); + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/GroupingOptionsPage.xaml b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/GroupingOptionsPage.xaml new file mode 100644 index 000000000000..fca7d1567d6d --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/GroupingOptionsPage.xaml @@ -0,0 +1,240 @@ +<?xml version="1.0" encoding="utf-8" ?> +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + xmlns:local="clr-namespace:Maui.Controls.Sample" + x:Class="Maui.Controls.Sample.GroupingOptionsPage" + Title="CollectionViewOptionsPage"> + <ContentPage.ToolbarItems> + <ToolbarItem Text="Apply" + Clicked="ApplyButton_Clicked" + AutomationId="Apply"/> + </ContentPage.ToolbarItems> + <ScrollView> + <Grid Padding="1" + RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto"> + <StackLayout Grid.Row="1" + Padding="1"> + <!--IsGrouped--> + <Label Text="IsGrouped:" + FontSize="12" + FontAttributes="Bold"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="IsGroupedFalse" + Content="False" + IsChecked="True" + CheckedChanged="OnIsGroupedChanged" + FontSize="11" + AutomationId="IsGroupedFalse"/> + <RadioButton x:Name="IsGroupedTrue" + Content="True" + CheckedChanged="OnIsGroupedChanged" + FontSize="11" + AutomationId="IsGroupedTrue"/> + </StackLayout> + <!-- Can Mix Groups --> + <Label Text="Can Mix Groups:" + FontAttributes="Bold" + FontSize="12"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="CanMixGroupsFalse" + Content="False" + IsChecked="True" + CheckedChanged="OnCanMixGroupsChanged" + FontSize="11" + GroupName="CanMixGroupsGroup" + AutomationId="CanMixGroupsFalse"/> + <RadioButton x:Name="CanMixGroupsTrue" + Content="True" + CheckedChanged="OnCanMixGroupsChanged" + FontSize="11" + GroupName="CanMixGroupsGroup" + AutomationId="CanMixGroupsTrue"/> + </StackLayout> + + <!-- Can Reorder Items --> + <Label Text="Can Reorder Items:" + FontAttributes="Bold" + FontSize="12"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="CanReorderItemsFalse" + Content="False" + IsChecked="True" + CheckedChanged="OnCanReorderItemsChanged" + FontSize="11" + GroupName="CanReorderItemsGroup" + AutomationId="CanReorderItemsFalse"/> + <RadioButton x:Name="CanReorderItemsTrue" + Content="True" + CheckedChanged="OnCanReorderItemsChanged" + FontSize="11" + GroupName="CanReorderItemsGroup" + AutomationId="CanReorderItemsTrue"/> + </StackLayout> + <!-- GroupHeaderTemplate --> + <Label Text="GroupHeaderTemplate:" + FontAttributes="Bold" + FontSize="12"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="GroupHeaderTemplateNone" + IsChecked="True" + CheckedChanged="OnGroupHeaderTemplateChanged" + Content="None" + FontSize="11" + GroupName="GroupHeaderTemplateGroup" + AutomationId="GroupHeaderTemplateNone"/> + <RadioButton x:Name="GroupHeaderTemplateGrid" + CheckedChanged="OnGroupHeaderTemplateChanged" + Content="View" + FontSize="11" + GroupName="GroupHeaderTemplateGroup" + AutomationId="GroupHeaderTemplateGrid"/> + </StackLayout> + <!-- GroupFooterTemplate --> + <Label Text="GroupFooterTemplate:" + FontAttributes="Bold" + FontSize="12"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="GroupFooterTemplateNone" + IsChecked="True" + CheckedChanged="OnGroupFooterTemplateChanged" + Content="None" + FontSize="11" + GroupName="GroupFooterTemplateGroup" + AutomationId="GroupFooterTemplateNone"/> + <RadioButton x:Name="GroupFooterTemplateGrid" + CheckedChanged="OnGroupFooterTemplateChanged" + Content="View" + FontSize="11" + GroupName="GroupFooterTemplateGroup" + AutomationId="GroupFooterTemplateGrid"/> + </StackLayout> + + <!-- Header--> + <Label Text="Header:" + FontSize="12" + FontAttributes="Bold"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="HeaderNone" + Content="None" + GroupName="HeaderOptions" + IsChecked="True" + CheckedChanged="OnHeaderChanged" + FontSize="11" + AutomationId="HeaderNone"/> + <RadioButton x:Name="HeaderString" + Content="String" + GroupName="HeaderOptions" + CheckedChanged="OnHeaderChanged" + FontSize="11" + AutomationId="HeaderString"/> + </StackLayout> + <!-- Footer--> + <Label Text="Footer:" + FontSize="12" + FontAttributes="Bold"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="FooterNone" + Content="None" + IsChecked="True" + GroupName="FooterOptions" + CheckedChanged="OnFooterChanged" + FontSize="11" + AutomationId="FooterNone"/> + <RadioButton x:Name="FooterString" + Content="String" + GroupName="FooterOptions" + CheckedChanged="OnFooterChanged" + FontSize="11" + AutomationId="FooterString"/> + + </StackLayout> + <!-- ItemTemplate --> + <Label Text="Item Template:" + FontSize="12" + FontAttributes="Bold"/> + <StackLayout Orientation="Horizontal"> + <RadioButton x:Name="ItemTemplateNone" + Content="None" + FontSize="11" + IsChecked="True" + GroupName="ItemTemplateGroup" + CheckedChanged="OnItemTemplateChanged" + AutomationId="ItemTemplateNone"/> + <RadioButton x:Name="ItemTemplateBasic" + Content="Basic" + FontSize="11" + GroupName="ItemTemplateGroup" + CheckedChanged="OnItemTemplateChanged" + AutomationId="ItemTemplateBasic"/> + </StackLayout> + <Label Text="ItemsLayout:" + FontAttributes="Bold" + FontSize="12"/> + <VerticalStackLayout> + <!-- First Row --> + <HorizontalStackLayout Spacing="10"> + <RadioButton x:Name="ItemsLayoutVerticalList" + IsChecked="True" + CheckedChanged="OnItemsLayoutChanged" + Content="Vertical List" + FontSize="11" + GroupName="ItemsLayoutGroup" + AutomationId="ItemsLayoutVerticalList"/> + <RadioButton x:Name="ItemsLayoutHorizontalList" + CheckedChanged="OnItemsLayoutChanged" + Content="Horizontal List" + FontSize="11" + GroupName="ItemsLayoutGroup" + AutomationId="ItemsLayoutHorizontalList"/> + </HorizontalStackLayout> + <!-- Second Row --> + <HorizontalStackLayout Spacing="10"> + <RadioButton x:Name="ItemsLayoutVerticalGrid" + CheckedChanged="OnItemsLayoutChanged" + Content="Vertical Grid" + FontSize="11" + GroupName="ItemsLayoutGroup" + AutomationId="ItemsLayoutVerticalGrid"/> + <RadioButton x:Name="ItemsLayoutHorizontalGrid" + CheckedChanged="OnItemsLayoutChanged" + Content="Horizontal Grid" + FontSize="11" + GroupName="ItemsLayoutGroup" + AutomationId="ItemsLayoutHorizontalGrid"/> + </HorizontalStackLayout> + </VerticalStackLayout> + <!-- ItemsSource Selection --> + <Label Text="ItemsSource:" + FontAttributes="Bold" + FontSize="11"/> + <VerticalStackLayout> + <!-- First Row --> + <HorizontalStackLayout Spacing="10"> + <RadioButton x:Name="ItemsSourceObservableCollection" + Content="ObservableCollection" + FontSize="10" + IsChecked="True" + GroupName="ItemsSourceGroup" + CheckedChanged="OnItemsSourceChanged" + AutomationId="ItemsSourceObservableCollection"/> + <RadioButton x:Name="ItemsSourceGroupedList" + Content="Grouped List" + FontSize="10" + GroupName="ItemsSourceGroup" + CheckedChanged="OnItemsSourceChanged" + AutomationId="ItemsSourceGroupedList"/> + </HorizontalStackLayout> + <!-- Second Row --> + <HorizontalStackLayout Spacing="10"> + <RadioButton x:Name="ItemsSourceNone" + Content="None" + FontSize="10" + GroupName="ItemsSourceGroup" + CheckedChanged="OnItemsSourceChanged" + AutomationId="ItemsSourceNone"/> + </HorizontalStackLayout> + </VerticalStackLayout> + </StackLayout> + </Grid> + </ScrollView> +</ContentPage> \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/GroupingOptionsPage.xaml.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/GroupingOptionsPage.xaml.cs new file mode 100644 index 000000000000..a1fc4ba83060 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewGrouping/GroupingOptionsPage.xaml.cs @@ -0,0 +1,188 @@ +using System; +using Microsoft.Maui.Controls; +using System.Collections.ObjectModel; +using Maui.Controls.Sample.CollectionViewGalleries; + +namespace Maui.Controls.Sample; + +public partial class GroupingOptionsPage : ContentPage +{ + private CollectionViewViewModel _viewModel; + public GroupingOptionsPage(CollectionViewViewModel viewModel) + { + InitializeComponent(); + _viewModel = viewModel; + BindingContext = _viewModel; + } + private void ApplyButton_Clicked(object sender, EventArgs e) + { + Navigation.PopAsync(); + } + + private void OnHeaderChanged(object sender, CheckedChangedEventArgs e) + { + if (HeaderNone.IsChecked) + { + _viewModel.Header = null; + } + else if (HeaderString.IsChecked) + { + _viewModel.Header = "CollectionView Header(String)"; + } + } + + private void OnFooterChanged(object sender, CheckedChangedEventArgs e) + { + if (FooterNone.IsChecked) + { + _viewModel.Footer = null; + } + else if (FooterString.IsChecked) + { + _viewModel.Footer = "CollectionView Footer(String)"; + } + } + + private void OnGroupHeaderTemplateChanged(object sender, CheckedChangedEventArgs e) + { + if (GroupHeaderTemplateNone.IsChecked) + { + _viewModel.GroupHeaderTemplate = null; + } + else if (GroupHeaderTemplateGrid.IsChecked) + { + _viewModel.GroupHeaderTemplate = new DataTemplate(() => + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + grid.Children.Add(new Label + { + Text = "GroupHeaderTemplate", + FontSize = 18, + FontAttributes = FontAttributes.Bold, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Green + }); + return grid; + }); + } + } + + private void OnGroupFooterTemplateChanged(object sender, CheckedChangedEventArgs e) + { + if (GroupFooterTemplateNone.IsChecked) + { + _viewModel.GroupFooterTemplate = null; + } + else if (GroupFooterTemplateGrid.IsChecked) + { + _viewModel.GroupFooterTemplate = new DataTemplate(() => + { + Grid grid = new Grid + { + BackgroundColor = Colors.LightGray, + Padding = new Thickness(10) + }; + grid.Children.Add(new Label + { + Text = "GroupFooterTemplate", + FontSize = 18, + FontAttributes = FontAttributes.Bold, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + TextColor = Colors.Red + }); + return grid; + }); + } + } + + private void OnIsGroupedChanged(object sender, CheckedChangedEventArgs e) + { + if (IsGroupedFalse.IsChecked) + { + _viewModel.IsGrouped = false; + } + else if (IsGroupedTrue.IsChecked) + { + _viewModel.IsGrouped = true; + } + } + + private void OnItemTemplateChanged(object sender, CheckedChangedEventArgs e) + { + if (ItemTemplateNone.IsChecked) + { + _viewModel.ItemTemplate = null; + } + else if (ItemTemplateBasic.IsChecked) + { + _viewModel.ItemTemplate = new DataTemplate(() => + { + var label = new Label(); + label.SetBinding(Label.TextProperty, new Binding("Caption")); + return label; + }); + } + } + + private void OnItemsSourceChanged(object sender, CheckedChangedEventArgs e) + { + if (!(sender is RadioButton radioButton) || !e.Value) + return; + if (radioButton == ItemsSourceObservableCollection) + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollectionT; + else if (radioButton == ItemsSourceGroupedList) + _viewModel.ItemsSourceType = ItemsSourceType.GroupedListT; + else if (radioButton == ItemsSourceNone) + _viewModel.ItemsSourceType = ItemsSourceType.None; + } + + private void OnCanMixGroupsChanged(object sender, CheckedChangedEventArgs e) + { + if (CanMixGroupsTrue.IsChecked) + { + _viewModel.CanMixGroups = true; + } + else if (CanMixGroupsFalse.IsChecked) + { + _viewModel.CanMixGroups = false; + } + } + + private void OnCanReorderItemsChanged(object sender, CheckedChangedEventArgs e) + { + if (CanReorderItemsTrue.IsChecked) + { + _viewModel.CanReorderItems = true; + } + else if (CanReorderItemsFalse.IsChecked) + { + _viewModel.CanReorderItems = false; + } + } + + private void OnItemsLayoutChanged(object sender, CheckedChangedEventArgs e) + { + if (ItemsLayoutVerticalList.IsChecked) + { + _viewModel.ItemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Vertical); + } + else if (ItemsLayoutHorizontalList.IsChecked) + { + _viewModel.ItemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Horizontal); + } + else if (ItemsLayoutVerticalGrid.IsChecked) + { + _viewModel.ItemsLayout = new GridItemsLayout(2, ItemsLayoutOrientation.Vertical); // 2 columns + } + else if (ItemsLayoutHorizontalGrid.IsChecked) + { + _viewModel.ItemsLayout = new GridItemsLayout(2, ItemsLayoutOrientation.Horizontal); // 2 rows + } + } +} \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs index 76d61f1ed6f3..cbb6649d1f82 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/CollectionViewViewModel.cs @@ -8,226 +8,256 @@ using Microsoft.Maui.Graphics; using Maui.Controls.Sample.CollectionViewGalleries; -namespace Maui.Controls.Sample +namespace Maui.Controls.Sample; +public class Grouping<TKey, TItem> : ObservableCollection<TItem> { - public class Grouping<TKey, TItem> : ObservableCollection<TItem> + public TKey Key { get; } + + public Grouping(TKey key, IEnumerable<TItem> items) : base(items) { - public TKey Key { get; } + Key = key; + } +} - public Grouping(TKey key, IEnumerable<TItem> items) : base(items) +public enum ItemsSourceType +{ + None, + ObservableCollectionT, + ObservableCollection25T, + ObservableCollection5T, + GroupedListT, + EmptyGroupedListT, + EmptyObservableCollectionT +} +public class CollectionViewViewModel : INotifyPropertyChanged +{ + private object _emptyView; + private object _header; + private object _footer; + private DataTemplate _emptyViewTemplate; + private DataTemplate _headerTemplate; + private DataTemplate _footerTemplate; + private DataTemplate _groupHeaderTemplate; + private DataTemplate _groupFooterTemplate; + private DataTemplate _itemTemplate; + private IItemsLayout _itemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Vertical); + private ItemsSourceType _itemsSourceType = ItemsSourceType.None; + private bool _isGrouped = false; + private bool _canReorderItems = false; + private bool _canMixGroups = false; + private ObservableCollection<CollectionViewTestItem> _observableCollection; + private ObservableCollection<CollectionViewTestItem> _observableCollection25; + private ObservableCollection<CollectionViewTestItem> _observableCollection5; + private ObservableCollection<CollectionViewTestItem> _emptyObservableCollection; + private List<Grouping<string, CollectionViewTestItem>> _groupedList; + private List<Grouping<string, CollectionViewTestItem>> _emptyGroupedList; + public event PropertyChangedEventHandler PropertyChanged; + + public CollectionViewViewModel() + { + LoadItems(); + ItemTemplate = new DataTemplate(() => + { + var stackLayout = new StackLayout + { + Padding = new Thickness(10), + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + }; + + var label = new Label + { + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.Center + }; + label.SetBinding(Label.TextProperty, "Caption"); + stackLayout.Children.Add(label); + return stackLayout; + }); + + GroupHeaderTemplate = new DataTemplate(() => { - Key = key; - } + var stackLayout = new StackLayout + { + BackgroundColor = Colors.LightGray + }; + var label = new Label + { + FontAttributes = FontAttributes.Bold, + FontSize = 18 + }; + label.SetBinding(Label.TextProperty, "Key"); + stackLayout.Children.Add(label); + return stackLayout; + }); } - public enum ItemsSourceType + public object EmptyView { - None, - ObservableCollection25T, - ObservableCollection5T, - GroupedListT, - EmptyGroupedListT, - EmptyObservableCollectionT + get => _emptyView; + set { _emptyView = value; OnPropertyChanged(); } } - public class CollectionViewViewModel : INotifyPropertyChanged - { - private object _emptyView; - private object _header; - private object _footer; - private DataTemplate _emptyViewTemplate; - private DataTemplate _headerTemplate; - private DataTemplate _footerTemplate; - private DataTemplate _groupHeaderTemplate; - private DataTemplate _groupFooterTemplate; - private DataTemplate _itemTemplate; - private IItemsLayout _itemsLayout = new LinearItemsLayout(ItemsLayoutOrientation.Vertical); - private ItemsSourceType _itemsSourceType = ItemsSourceType.None; - private bool _isGrouped = false; - private ObservableCollection<CollectionViewTestItem> _observableCollection25; - private ObservableCollection<CollectionViewTestItem> _observableCollection5; - private ObservableCollection<CollectionViewTestItem> _emptyObservableCollection; - private List<Grouping<string, CollectionViewTestItem>> _groupedList; - private List<Grouping<string, CollectionViewTestItem>> _emptyGroupedList; - public event PropertyChangedEventHandler PropertyChanged; - - public CollectionViewViewModel() - { - LoadItems(); - ItemTemplate = new DataTemplate(() => - { - var stackLayout = new StackLayout - { - Padding = new Thickness(10), - HorizontalOptions = LayoutOptions.Center, - VerticalOptions = LayoutOptions.Center - }; - - var label = new Label - { - VerticalOptions = LayoutOptions.Center, - HorizontalOptions = LayoutOptions.Center - }; - label.SetBinding(Label.TextProperty, "Caption"); - stackLayout.Children.Add(label); - return stackLayout; - }); - - GroupHeaderTemplate = new DataTemplate(() => - { - var stackLayout = new StackLayout - { - BackgroundColor = Colors.LightGray - }; - var label = new Label - { - FontAttributes = FontAttributes.Bold, - FontSize = 18 - }; - label.SetBinding(Label.TextProperty, "Key"); - stackLayout.Children.Add(label); - return stackLayout; - }); - } - public object EmptyView - { - get => _emptyView; - set { _emptyView = value; OnPropertyChanged(); } - } + public object Header + { + get => _header; + set { _header = value; OnPropertyChanged(); } + } - public object Header - { - get => _header; - set { _header = value; OnPropertyChanged(); } - } + public object Footer + { + get => _footer; + set { _footer = value; OnPropertyChanged(); } + } - public object Footer - { - get => _footer; - set { _footer = value; OnPropertyChanged(); } - } + public DataTemplate EmptyViewTemplate + { + get => _emptyViewTemplate; + set { _emptyViewTemplate = value; OnPropertyChanged(); } + } - public DataTemplate EmptyViewTemplate - { - get => _emptyViewTemplate; - set { _emptyViewTemplate = value; OnPropertyChanged(); } - } + public DataTemplate HeaderTemplate + { + get => _headerTemplate; + set { _headerTemplate = value; OnPropertyChanged(); } + } - public DataTemplate HeaderTemplate - { - get => _headerTemplate; - set { _headerTemplate = value; OnPropertyChanged(); } - } + public DataTemplate FooterTemplate + { + get => _footerTemplate; + set { _footerTemplate = value; OnPropertyChanged(); } + } - public DataTemplate FooterTemplate - { - get => _footerTemplate; - set { _footerTemplate = value; OnPropertyChanged(); } - } + public DataTemplate GroupHeaderTemplate + { + get => _groupHeaderTemplate; + set { _groupHeaderTemplate = value; OnPropertyChanged(); } + } - public DataTemplate GroupHeaderTemplate - { - get => _groupHeaderTemplate; - set { _groupHeaderTemplate = value; OnPropertyChanged(); } - } + public DataTemplate GroupFooterTemplate + { + get => _groupFooterTemplate; + set { _groupFooterTemplate = value; OnPropertyChanged(); } + } - public DataTemplate GroupFooterTemplate - { - get => _groupFooterTemplate; - set { _groupFooterTemplate = value; OnPropertyChanged(); } - } + public DataTemplate ItemTemplate + { + get => _itemTemplate; + set { _itemTemplate = value; OnPropertyChanged(); } + } - public DataTemplate ItemTemplate + public IItemsLayout ItemsLayout + { + get => _itemsLayout; + set { - get => _itemTemplate; - set { _itemTemplate = value; OnPropertyChanged(); } + if (_itemsLayout != value) + { + _itemsLayout = value; + OnPropertyChanged(); + } } + } - public IItemsLayout ItemsLayout + public ItemsSourceType ItemsSourceType + { + get => _itemsSourceType; + set { - get => _itemsLayout; - set + if (_itemsSourceType != value) { - if (_itemsLayout != value) - { - _itemsLayout = value; - OnPropertyChanged(); - } + _itemsSourceType = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(ItemsSource)); } } + } - public ItemsSourceType ItemsSourceType + public bool IsGrouped + { + get => _isGrouped; + set { - get => _itemsSourceType; - set + if (_isGrouped != value) { - if (_itemsSourceType != value) - { - _itemsSourceType = value; - OnPropertyChanged(); - OnPropertyChanged(nameof(ItemsSource)); - } + _isGrouped = value; + OnPropertyChanged(); } } - - public bool IsGrouped + } + public bool CanReorderItems + { + get => _canReorderItems; + set { - get => _isGrouped; - set + if (_canReorderItems != value) { - if (_isGrouped != value) - { - _isGrouped = value; - OnPropertyChanged(); - } + _canReorderItems = value; + OnPropertyChanged(); } } - - public object ItemsSource + } + public bool CanMixGroups + { + get => _canMixGroups; + set { - get + if (_canMixGroups != value) { - return ItemsSourceType switch - { - ItemsSourceType.ObservableCollection25T => _observableCollection25, - ItemsSourceType.ObservableCollection5T => _observableCollection5, - ItemsSourceType.GroupedListT => _groupedList, - ItemsSourceType.EmptyGroupedListT => _emptyGroupedList, - ItemsSourceType.EmptyObservableCollectionT => _emptyObservableCollection, - ItemsSourceType.None => null, - _ => null - }; + _canMixGroups = value; + OnPropertyChanged(); } } - - - private void LoadItems() + } + public object ItemsSource + { + get { - _observableCollection25 = new ObservableCollection<CollectionViewTestItem>(); - _observableCollection5 = new ObservableCollection<CollectionViewTestItem>(); - AddItems(_observableCollection5, 5, "Fruits"); - AddItems(_observableCollection25, 10, "Fruits"); - AddItems(_observableCollection25, 10, "Vegetables"); + return ItemsSourceType switch + { + ItemsSourceType.ObservableCollectionT => _observableCollection, + ItemsSourceType.ObservableCollection25T => _observableCollection25, + ItemsSourceType.ObservableCollection5T => _observableCollection5, + ItemsSourceType.GroupedListT => _groupedList, + ItemsSourceType.EmptyGroupedListT => _emptyGroupedList, + ItemsSourceType.EmptyObservableCollectionT => _emptyObservableCollection, + ItemsSourceType.None => null, + _ => null + }; + } + } - _emptyObservableCollection = new ObservableCollection<CollectionViewTestItem>(); - _groupedList = new List<Grouping<string, CollectionViewTestItem>> + private void LoadItems() + { + _observableCollection = new ObservableCollection<CollectionViewTestItem>(); + AddItems(_observableCollection, 7, "Fruits"); + AddItems(_observableCollection, 7, "Vegetables"); + _observableCollection25 = new ObservableCollection<CollectionViewTestItem>(); + _observableCollection5 = new ObservableCollection<CollectionViewTestItem>(); + AddItems(_observableCollection5, 5, "Fruits"); + AddItems(_observableCollection25, 10, "Fruits"); + AddItems(_observableCollection25, 10, "Vegetables"); + + _emptyObservableCollection = new ObservableCollection<CollectionViewTestItem>(); + + _groupedList = new List<Grouping<string, CollectionViewTestItem>> { new Grouping<string, CollectionViewTestItem>("Fruits", new List<CollectionViewTestItem>()), new Grouping<string, CollectionViewTestItem>("Vegetables", new List<CollectionViewTestItem>()) }; - AddItems(_groupedList[0], 4, "Fruits"); - AddItems(_groupedList[1], 4, "Vegetables"); + AddItems(_groupedList[0], 4, "Fruits"); + AddItems(_groupedList[1], 4, "Vegetables"); - _emptyGroupedList = new List<Grouping<string, CollectionViewTestItem>>(); - } + _emptyGroupedList = new List<Grouping<string, CollectionViewTestItem>>(); + } - private void AddItems(IList<CollectionViewTestItem> list, int count, string category) + private void AddItems(IList<CollectionViewTestItem> list, int count, string category) + { + string[] fruits = { - string[] fruits = - { "Apple", "Banana", "Orange", "Grapes", "Mango", "Pineapple", "Strawberry", "Blueberry", "Peach", "Cherry", "Watermelon", "Papaya", "Kiwi", "Pear", "Plum", @@ -235,8 +265,8 @@ private void AddItems(IList<CollectionViewTestItem> list, int count, string cate "Lime", "Lemon", "Coconut", "Apricot", "Blackberry" }; - string[] vegetables = - { + string[] vegetables = + { "Carrot", "Broccoli", "Spinach", "Potato", "Tomato", "Cucumber", "Lettuce", "Onion", "Garlic", "Pepper", "Zucchini", "Pumpkin", "Radish", "Beetroot", "Cabbage", @@ -244,50 +274,49 @@ private void AddItems(IList<CollectionViewTestItem> list, int count, string cate "Eggplant", "Chili", "Corn", "Peas", "Mushroom" }; - string[] items = category == "Fruits" ? fruits : vegetables; + string[] items = category == "Fruits" ? fruits : vegetables; - for (int n = 0; n < count; n++) - { - list.Add(new CollectionViewTestItem(items[n % items.Length], n)); // Pass the index - } + for (int n = 0; n < count; n++) + { + list.Add(new CollectionViewTestItem(items[n % items.Length], n)); // Pass the index } + } - protected void OnPropertyChanged([CallerMemberName] string propertyName = null) + protected void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + if (propertyName == nameof(IsGrouped)) { - if (propertyName == nameof(IsGrouped)) - { - OnPropertyChanged(nameof(ItemsSource)); - } - - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + OnPropertyChanged(nameof(ItemsSource)); } - public class CustomDataTemplateSelector : DataTemplateSelector - { - public DataTemplate Template1 { get; set; } - public DataTemplate Template2 { get; set; } + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } - protected override DataTemplate OnSelectTemplate(object item, BindableObject container) - { - if (item is CollectionViewTestItem testItem) - { - return testItem.Index % 2 == 0 ? Template1 : Template2; - } + public class CustomDataTemplateSelector : DataTemplateSelector + { + public DataTemplate Template1 { get; set; } + public DataTemplate Template2 { get; set; } - return Template1; + protected override DataTemplate OnSelectTemplate(object item, BindableObject container) + { + if (item is CollectionViewTestItem testItem) + { + return testItem.Index % 2 == 0 ? Template1 : Template2; } + + return Template1; } + } - public class CollectionViewTestItem - { - public string Caption { get; set; } - public int Index { get; set; } + public class CollectionViewTestItem + { + public string Caption { get; set; } + public int Index { get; set; } - public CollectionViewTestItem(string caption, int index) - { - Caption = caption; - Index = index; - } + public CollectionViewTestItem(string caption, int index) + { + Caption = caption; + Index = index; } } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/HeaderFooter/CollectionViewHeaderPage.xaml.cs b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/HeaderFooter/CollectionViewHeaderPage.xaml.cs index 379e3ab406c5..aafbd2ab27c9 100644 --- a/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/HeaderFooter/CollectionViewHeaderPage.xaml.cs +++ b/src/Controls/tests/TestCases.HostApp/FeatureMatrix/CollectionView/HeaderFooter/CollectionViewHeaderPage.xaml.cs @@ -2,25 +2,23 @@ using Microsoft.Maui.Controls; using System.Collections.ObjectModel; -namespace Maui.Controls.Sample +namespace Maui.Controls.Sample; +public partial class CollectionViewHeaderPage : ContentPage { - public partial class CollectionViewHeaderPage : ContentPage - { - private CollectionViewViewModel _viewModel; + private CollectionViewViewModel _viewModel; - public CollectionViewHeaderPage() - { - InitializeComponent(); - _viewModel = new CollectionViewViewModel(); - _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; - BindingContext = _viewModel; - } + public CollectionViewHeaderPage() + { + InitializeComponent(); + _viewModel = new CollectionViewViewModel(); + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; + BindingContext = _viewModel; + } - private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) - { - BindingContext = _viewModel = new CollectionViewViewModel(); - _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; - await Navigation.PushAsync(new HeaderFooterOptionsPage(_viewModel)); - } + private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e) + { + BindingContext = _viewModel = new CollectionViewViewModel(); + _viewModel.ItemsSourceType = ItemsSourceType.ObservableCollection5T; + await Navigation.PushAsync(new HeaderFooterOptionsPage(_viewModel)); } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_HeaderFooterFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_HeaderFooterFeatureTests.cs index 5a1e132ac128..9a2268e06fe7 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_HeaderFooterFeatureTests.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_HeaderFooterFeatureTests.cs @@ -2,250 +2,270 @@ using UITest.Appium; using UITest.Core; - -namespace Microsoft.Maui.TestCases.Tests +namespace Microsoft.Maui.TestCases.Tests; +public class CollectionView_HeaderFooterFeatureTests : UITest { - public class CollectionView_HeaderFooterFeatureTests : UITest + public const string HeaderFooterFeatureMatrix = "CollectionView Feature Matrix"; + public const string Options = "Options"; + public const string Apply = "Apply"; + public const string EmptyViewString = "EmptyViewString"; + public const string HeaderString = "HeaderString"; + public const string HeaderGrid = "HeaderGrid"; + public const string FooterString = "FooterString"; + public const string FooterGrid = "FooterGrid"; + public const string HeaderTemplateGrid = "HeaderTemplateGrid"; + public const string FooterTemplateGrid = "FooterTemplateGrid"; + public const string ItemsSourceGroupedList = "ItemsSourceGroupedList"; + public const string ItemsSourceObservableCollection5 = "ItemsSourceObservableCollection5"; + public const string ItemsSourceObservableCollection25 = "ItemsSourceObservableCollection25"; + public const string ItemsSourceNone = "ItemsSourceNone"; + public const string IsGroupedTrue = "IsGroupedTrue"; + public const string IsGroupedFalse = "IsGroupedFalse"; + public const string ItemTemplateBasic = "ItemTemplateBasic"; + public const string ItemsLayoutHorizontalList = "ItemsLayoutHorizontalList"; + public const string ItemsLayoutHorizontalGrid = "ItemsLayoutHorizontalGrid"; + public const string ItemsLayoutVerticalGrid = "ItemsLayoutVerticalGrid"; + public const string GroupHeaderTemplateGrid = "GroupHeaderTemplateGrid"; + public const string GroupFooterTemplateGrid = "GroupFooterTemplateGrid"; + + + public CollectionView_HeaderFooterFeatureTests(TestDevice device) + : base(device) { - public const string HeaderFooterFeatureMatrix = "CollectionView Feature Matrix"; - - public CollectionView_HeaderFooterFeatureTests(TestDevice device) - : base(device) - { - } + } - protected override void FixtureSetup() - { - base.FixtureSetup(); - App.NavigateToGallery(HeaderFooterFeatureMatrix); - } + protected override void FixtureSetup() + { + base.FixtureSetup(); + App.NavigateToGallery(HeaderFooterFeatureMatrix); + } #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST //In CV2, unintended synchronization between the HeaderTemplate/FooterTemplate and Header/Footer views, related issue: https://github.com/dotnet/maui/issues/28504 - [Test, Order(1)] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithItemsSourceObservableCollection25() - { - App.WaitForElementTillPageNavigationSettled("HeaderFooterViewButton"); - App.Tap("HeaderFooterViewButton"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection25"); - App.Tap("ItemsSourceObservableCollection25"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Pepper"); - App.WaitForNoElement("CollectionView Header(String)"); - } + [Test, Order(1)] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithItemsSourceObservableCollection25() + { + App.WaitForElementTillPageNavigationSettled("HeaderFooterViewButton"); + App.Tap("HeaderFooterViewButton"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection25); + App.Tap(ItemsSourceObservableCollection25); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Pepper"); + App.WaitForNoElement("CollectionView Header(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithItemsSourceObservableCollection5() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithItemsSourceObservableCollection5() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithItemsSourceNone() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithItemsSourceNone() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithItemsSourceObservableCollection25() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection25"); - App.Tap("ItemsSourceObservableCollection25"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollDown("CollectionViewControl",ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Pepper"); - App.WaitForNoElement("CollectionView Header(Grid View)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithItemsSourceObservableCollection25() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection25); + App.Tap(ItemsSourceObservableCollection25); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Pepper"); + App.WaitForNoElement("CollectionView Header(Grid View)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithItemsSourceObservableCollection5() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection5"); - App.Tap("ItemsSourceObservableCollection5"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithItemsSourceObservableCollection5() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection5); + App.Tap(ItemsSourceObservableCollection5); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithItemsSourceNone() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithItemsSourceNone() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + } #if TEST_FAILS_ON_WINDOWS //related issues:https://github.com/dotnet/maui/issues/28022 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithEmptyViewString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("EmptyViewString"); - App.Tap("EmptyViewString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithEmptyViewString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(EmptyViewString); + App.Tap(EmptyViewString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithEmptyViewString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("EmptyViewString"); - App.Tap("EmptyViewString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithEmptyViewString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(EmptyViewString); + App.Tap(EmptyViewString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); + } #endif - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithFooterString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithFooterString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithFooterView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithFooterView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithFooterView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithFooterView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithFooterString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithFooterString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } #if TEST_FAILS_ON_ANDROID //related issue: https://github.com/dotnet/maui/issues/28334 [Test] [Category(UITestCategories.CollectionView)] public void VerifyHeaderStringWhenFooterTemplateView() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -256,14 +276,14 @@ public void VerifyHeaderStringWhenFooterTemplateView() [Category(UITestCategories.CollectionView)] public void VerifyHeaderViewWhenFooterTemplateView() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -272,131 +292,131 @@ public void VerifyHeaderViewWhenFooterTemplateView() #endif #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In CV2 related issue: https://github.com/dotnet/maui/issues/28509, In windows related issue: https://github.com/dotnet/maui/issues/28824 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWhenGroupHeaderTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Potato"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWhenGroupHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Potato"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWhenGroupHeaderTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWhenGroupHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWhenGroupFooterTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateGrid"); - App.Tap("GroupFooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWhenGroupFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWhenGroupFooterTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateGrid"); - App.Tap("GroupFooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWhenGroupFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + } #endif #if TEST_FAILS_ON_WINDOWS //related issue: https://github.com/dotnet/maui/issues/28337 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWhenHeaderTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWhenHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWhenHeaderTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWhenHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } #endif #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //relate issue: https://github.com/dotnet/maui/issues/28824 @@ -404,24 +424,24 @@ public void VerifyHeaderViewWhenHeaderTemplateView() [Category(UITestCategories.CollectionView)] public void VerifyHeaderStringWhenIsGroupedTrueOrFalse() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedFalse"); - App.Tap("IsGroupedFalse"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(IsGroupedFalse); + App.Tap(IsGroupedFalse); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); App.WaitForElementTillPageNavigationSettled("Apple"); } @@ -430,169 +450,169 @@ public void VerifyHeaderStringWhenIsGroupedTrueOrFalse() [Category(UITestCategories.CollectionView)] public void VerifyHeaderViewWhenIsGroupedTrueOrFalse() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedFalse"); - App.Tap("IsGroupedFalse"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedFalse); + App.Tap(IsGroupedFalse); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); } #endif - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWhenBasicDataTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemTemplateBasic"); - App.Tap("ItemTemplateBasic"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWhenBasicDataTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWhenBasicDataTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemTemplateBasic"); - App.Tap("ItemTemplateBasic"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWhenBasicDataTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + } -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST &&TEST_FAILS_ON_IOS //In windows, related issue: https://github.com/dotnet/maui/issues/27946 and In CV2, related issue: https://github.com/dotnet/maui/issues/28678 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithItemsLayoutVerticalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutVerticalGrid"); - App.Tap("ItemsLayoutVerticalGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In windows, related issue: https://github.com/dotnet/maui/issues/27946 and In CV2, related issue: https://github.com/dotnet/maui/issues/28678 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithItemsLayoutVerticalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithItemsLayoutVerticalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutVerticalGrid"); - App.Tap("ItemsLayoutVerticalGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithItemsLayoutVerticalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithItemsLayoutHorizontalList() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalList"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithItemsLayoutHorizontalList() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithItemsLayoutHorizontalList() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalList"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithItemsLayoutHorizontalList() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderViewWithItemsLayoutHorizontalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalGrid"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderViewWithItemsLayoutHorizontalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderStringWithItemsLayoutHorizontalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalGrid"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderStringWithItemsLayoutHorizontalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + } #endif @@ -601,12 +621,12 @@ public void VerifyHeaderStringWithItemsLayoutHorizontalGrid() [Category(UITestCategories.CollectionView)] public void VerifyHeaderTemplateWithItemsSourceObserableCollection5() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -616,14 +636,14 @@ public void VerifyHeaderTemplateWithItemsSourceObserableCollection5() [Category(UITestCategories.CollectionView)] public void VerifyHeaderTemplateWithItemsSourceObserableCollection25() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection25"); - App.Tap("ItemsSourceObservableCollection25"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection25); + App.Tap(ItemsSourceObservableCollection25); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); @@ -635,595 +655,595 @@ public void VerifyHeaderTemplateWithItemsSourceObserableCollection25() [Category(UITestCategories.CollectionView)] public void VerifyHeaderTemplateWithItemsSourceNone() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - } -#endif - -#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS //In windows related issue:https://github.com/dotnet/maui/issues/28022, In related issue: https://github.com/dotnet/maui/issues/28337 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenEmptyViewString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("EmptyViewString"); - App.Tap("EmptyViewString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); - } -#endif - -#if TEST_FAILS_ON_ANDROID //related issue: https://github.com/dotnet/maui/issues/28337 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTempalteWhenFooterTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - } -#endif - -#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS //In CV2: related issue: https://github.com/dotnet/maui/issues/28824 and In windows: https://github.com/dotnet/maui/issues/28824 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenGroupFooterTemplate() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateGrid"); - App.Tap("GroupFooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenGroupHeaderTemplate() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - } -#endif -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //In CV2, unintended synchronization between the HeaderTemplate/FooterTemplate and Header/Footer views, related issue: https://github.com/dotnet/maui/issues/28504 -//In windows, related issue: https://github.com/dotnet/maui/issues/28337 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenHeaderString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("CollectionView Header(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenHeaderView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForNoElement("HeaderViewLabel"); - } -#endif - -#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS //In all platforms, issue related: https://github.com/dotnet/maui/issues/28824 and CV2, related issues:https://github.com/dotnet/maui/issues/28504 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenIsGroupedTrueOrFalse() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedFalse"); - App.Tap("IsGroupedFalse"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - } -#endif - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWhenBasicDataTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemTemplateBasic"); - App.Tap("ItemTemplateBasic"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } - -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST &&TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID //In windows, related issue: https://github.com/dotnet/maui/issues/27946, In CV2, related issue: https://github.com/dotnet/maui/issues/28678 and In android related issue:https://github.com/dotnet/maui/issues/28337 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWithItemsLayoutVerticalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutVerticalGrid"); - App.Tap("ItemsLayoutVerticalGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWithItemsLayoutHorizontalList() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalList"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyHeaderTemplateWithItemsLayoutHorizontalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalGrid"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - } -#endif - -#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST //In CV2, unintended synchronization between the HeaderTemplate/FooterTemplate and Header/Footer views, related issue: https://github.com/dotnet/maui/issues/28504 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWithItemsSourceObservableCollection5() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWithItemsSourceNone() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - } - - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWithItemsSourceObservableCollection25() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection25"); - App.Tap("ItemsSourceObservableCollection25"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Pepper"); - App.WaitForElement("CollectionView Footer(String)"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWithItemsSourceObservableCollection5() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWithItemsSourceObservableCollection25() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection25"); - App.Tap("ItemsSourceObservableCollection25"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("CollectionView Footer(Grid View)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Pepper"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(Grid View)"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWithItemsSourceNone() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - } - -#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In android related issue:https://github.com/dotnet/maui/issues/28622, In windows related issue:https://github.com/dotnet/maui/issues/28022 and In CV2, related issue: https://github.com/dotnet/maui/issues/28604 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenEmptyViewString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("EmptyViewString"); - App.Tap("EmptyViewString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenEmptyViewString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("EmptyViewString"); - App.Tap("EmptyViewString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); - } -#endif - -#if TEST_FAILS_ON_WINDOWS //In Windows related issue: https://github.com/dotnet/maui/issues/28337 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenFooterTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - } - - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenFooterTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); } #endif -#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS//In CV2 related issues:https://github.com/dotnet/maui/issues/28509 +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS //In windows related issue:https://github.com/dotnet/maui/issues/28022, In related issue: https://github.com/dotnet/maui/issues/28337 [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenGroupFooterTemplateView() + public void VerifyHeaderTemplateWhenEmptyViewString() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateGrid"); - App.Tap("GroupFooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Fruits"); - App.WaitForElementTillPageNavigationSettled("Vegetables"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(EmptyViewString); + App.Tap(EmptyViewString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); } +#endif +#if TEST_FAILS_ON_ANDROID //related issue: https://github.com/dotnet/maui/issues/28337 [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenGroupFooterTemplateView() + public void VerifyHeaderTempalteWhenFooterTemplateView() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateGrid"); - App.Tap("GroupFooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Fruits"); - App.WaitForElementTillPageNavigationSettled("Vegetables"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); } +#endif + +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS //In CV2: related issue: https://github.com/dotnet/maui/issues/28824 and In windows: https://github.com/dotnet/maui/issues/28824 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderTemplateWhenGroupFooterTemplate() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderTemplateWhenGroupHeaderTemplate() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + } +#endif +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //In CV2, unintended synchronization between the HeaderTemplate/FooterTemplate and Header/Footer views, related issue: https://github.com/dotnet/maui/issues/28504 + //In windows, related issue: https://github.com/dotnet/maui/issues/28337 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderTemplateWhenHeaderString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderTemplateWhenHeaderView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForNoElement("HeaderViewLabel"); + } +#endif +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS //In all platforms, issue related: https://github.com/dotnet/maui/issues/28824 and CV2, related issues:https://github.com/dotnet/maui/issues/28504 [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenGroupHeaderTemplateView() + public void VerifyHeaderTemplateWhenIsGroupedTrueOrFalse() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedFalse); + App.Tap(IsGroupedFalse); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); } +#endif + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyHeaderTemplateWhenBasicDataTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID //In windows, related issue: https://github.com/dotnet/maui/issues/27946, In CV2, related issue: https://github.com/dotnet/maui/issues/28678 and In android related issue:https://github.com/dotnet/maui/issues/28337 [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenGroupHeaderTemplateView() + public void VerifyHeaderTemplateWithItemsLayoutVerticalGrid() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Mango"); } -#endif [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenHeaderString() + public void VerifyHeaderTemplateWithItemsLayoutHorizontalList() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); } [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenHeaderString() + public void VerifyHeaderTemplateWithItemsLayoutHorizontalGrid() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); } +#endif + +#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST //In CV2, unintended synchronization between the HeaderTemplate/FooterTemplate and Header/Footer views, related issue: https://github.com/dotnet/maui/issues/28504 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWithItemsSourceObservableCollection5() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWithItemsSourceNone() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } + + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWithItemsSourceObservableCollection25() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection25); + App.Tap(ItemsSourceObservableCollection25); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Pepper"); + App.WaitForElement("CollectionView Footer(String)"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWithItemsSourceObservableCollection5() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWithItemsSourceObservableCollection25() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection25); + App.Tap(ItemsSourceObservableCollection25); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("CollectionView Footer(Grid View)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Pepper"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(Grid View)"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWithItemsSourceNone() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } + +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In android related issue:https://github.com/dotnet/maui/issues/28622, In windows related issue:https://github.com/dotnet/maui/issues/28022 and In CV2, related issue: https://github.com/dotnet/maui/issues/28604 [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenHeaderView() + public void VerifyFooterStringWhenEmptyViewString() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(EmptyViewString); + App.Tap(EmptyViewString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); } [Test] [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenHeaderView() + public void VerifyFooterViewWhenEmptyViewString() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(EmptyViewString); + App.Tap(EmptyViewString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); } +#endif + +#if TEST_FAILS_ON_WINDOWS //In Windows related issue: https://github.com/dotnet/maui/issues/28337 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWhenFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWhenFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + } +#endif + +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_WINDOWS//In CV2 related issues:https://github.com/dotnet/maui/issues/28509 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWhenGroupFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Fruits"); + App.WaitForElementTillPageNavigationSettled("Vegetables"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWhenGroupFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Fruits"); + App.WaitForElementTillPageNavigationSettled("Vegetables"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWhenGroupHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWhenGroupHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + } +#endif + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWhenHeaderString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWhenHeaderString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWhenHeaderView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWhenHeaderView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } #if TEST_FAILS_ON_ANDROID //related issue: https://github.com/dotnet/maui/issues/28337 [Test] [Category(UITestCategories.CollectionView)] public void VerifyFooterStringWhenHeaderTemplate() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1234,14 +1254,14 @@ public void VerifyFooterStringWhenHeaderTemplate() [Category(UITestCategories.CollectionView)] public void VerifyFooterViewWhenHeaderTemplate() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1254,25 +1274,25 @@ public void VerifyFooterViewWhenHeaderTemplate() [Category(UITestCategories.CollectionView)] public void VerifyFooterStringWhenIsGroupedTrueOrFalse() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("IsGroupedFalse"); - App.Tap("IsGroupedFalse"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(IsGroupedFalse); + App.Tap(IsGroupedFalse); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); @@ -1282,166 +1302,166 @@ public void VerifyFooterStringWhenIsGroupedTrueOrFalse() [Category(UITestCategories.CollectionView)] public void VerifyFooterViewWhenIsGroupedTrueOrFalse() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedFalse"); - App.Tap("IsGroupedFalse"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedFalse); + App.Tap(IsGroupedFalse); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); } #endif - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWhenBasicDataTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemTemplateBasic"); - App.Tap("ItemTemplateBasic"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWhenBasicDataTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWhenBasicDataTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemTemplateBasic"); - App.Tap("ItemTemplateBasic"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWhenBasicDataTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + } -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST &&TEST_FAILS_ON_IOS //In windows, related issue: https://github.com/dotnet/maui/issues/27946 and In CV2, related issue: https://github.com/dotnet/maui/issues/28678 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWithItemsLayoutVerticalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutVerticalGrid"); - App.Tap("ItemsLayoutVerticalGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - } +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In windows, related issue: https://github.com/dotnet/maui/issues/27946 and In CV2, related issue: https://github.com/dotnet/maui/issues/28678 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWithItemsLayoutVerticalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWithItemsLayoutVerticalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutVerticalGrid"); - App.Tap("ItemsLayoutVerticalGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWithItemsLayoutVerticalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWithItemsLayoutHorizontalList() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalList"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWithItemsLayoutHorizontalList() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWithItemsLayoutHorizontalList() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalList"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWithItemsLayoutHorizontalList() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterStringWithItemsLayoutHorizontalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalGrid"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterStringWithItemsLayoutHorizontalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("CollectionView Footer(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterViewWithItemsLayoutHorizontalGrid() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalGrid"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterViewWithItemsLayoutHorizontalGrid() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterViewLabel"); + } #endif #endif @@ -1450,48 +1470,48 @@ public void VerifyFooterViewWithItemsLayoutHorizontalGrid() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWithItemsSourceObservableCollections5() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); } #endif - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWithItemsSourceObservableCollections25() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceObservableCollection25"); - App.Tap("ItemsSourceObservableCollection25"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("Footer Template(Grid View)"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); - App.WaitForElementTillPageNavigationSettled("Pepper"); - App.WaitForElementTillPageNavigationSettled("Footer Template(Grid View)"); - } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWithItemsSourceNone() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWithItemsSourceObservableCollections25() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceObservableCollection25); + App.Tap(ItemsSourceObservableCollection25); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("Footer Template(Grid View)"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.ScrollDown("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElementTillPageNavigationSettled("Pepper"); + App.WaitForElementTillPageNavigationSettled("Footer Template(Grid View)"); + } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWithItemsSourceNone() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + } #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In windows related issue:https://github.com/dotnet/maui/issues/28022, In android: https://github.com/dotnet/maui/issues/28101 and In CV2, related issue: https://github.com/dotnet/maui/issues/28604 and https://github.com/dotnet/maui/issues/28504 @@ -1499,104 +1519,104 @@ public void VerifyFooterTemplateWithItemsSourceNone() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWhenEmptyViewString() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceNone"); - App.Tap("ItemsSourceNone"); - App.WaitForElementTillPageNavigationSettled("EmptyViewString"); - App.Tap("EmptyViewString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsSourceNone); + App.Tap(ItemsSourceNone); + App.WaitForElementTillPageNavigationSettled(EmptyViewString); + App.Tap(EmptyViewString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("No Items Available(String)"); App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); } #endif #if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In Windows, related issue: https://github.com/dotnet/maui/issues/28337 and In CV2, related issue: https://github.com/dotnet/maui/issues/28504 - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWhenFooterString() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("FooterString"); - App.Tap("FooterString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForNoElement("CollectionView Footer(String)"); - } + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWhenFooterString() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(FooterString); + App.Tap(FooterString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForNoElement("CollectionView Footer(String)"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWhenFooterView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("FooterGrid"); - App.Tap("FooterGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForNoElement("FooterViewLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWhenFooterView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(FooterGrid); + App.Tap(FooterGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForNoElement("FooterViewLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Mango"); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + } #endif #if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //In CV2 related issues: https://github.com/dotnet/maui/issues/28509 and In windows, related issue: https://github.com/dotnet/maui/issues/28824 - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWhenGroupFooterTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateGrid"); - App.Tap("GroupFooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Fruits"); - App.WaitForElementTillPageNavigationSettled("Vegetables"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWhenGroupFooterTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Fruits"); + App.WaitForElementTillPageNavigationSettled("Vegetables"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + App.WaitForElementTillPageNavigationSettled("GroupFooterTemplateLabel"); + } - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWhenGroupHeaderTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("ItemsSourceGroupedList"); - App.Tap("ItemsSourceGroupedList"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateGrid"); - App.Tap("GroupHeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - App.WaitForElementTillPageNavigationSettled("Potato"); - App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWhenGroupHeaderTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElementTillPageNavigationSettled(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + App.WaitForElementTillPageNavigationSettled("Potato"); + App.WaitForElementTillPageNavigationSettled("GroupHeaderTemplateLabel"); + } #endif #if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS //In android,related issue: https://github.com/dotnet/maui/issues/28337 and In CV2, reltaed issue:https://github.com/dotnet/maui/issues/28504 @@ -1604,14 +1624,14 @@ public void VerifyFooterTemplateWhenGroupHeaderTemplateView() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWhenHeaderString() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderString"); - App.Tap("HeaderString"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(HeaderString); + App.Tap(HeaderString); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("CollectionView Header(String)"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1622,14 +1642,14 @@ public void VerifyFooterTemplateWhenHeaderString() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWhenHeaderView() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderGrid"); - App.Tap("HeaderGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(HeaderGrid); + App.Tap(HeaderGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderViewLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1642,14 +1662,14 @@ public void VerifyFooterTemplateWhenHeaderView() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWhenHeaderTemplate() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("HeaderTemplateGrid"); - App.Tap("HeaderTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(HeaderTemplateGrid); + App.Tap(HeaderTemplateGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("HeaderTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1662,60 +1682,60 @@ public void VerifyFooterTemplateWhenHeaderTemplate() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWhenIsGroupedTrueOrFalse() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedTrue"); - App.Tap("IsGroupedTrue"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("IsGroupedFalse"); - App.Tap("IsGroupedFalse"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(IsGroupedFalse); + App.Tap(IsGroupedFalse); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("Mango"); } #endif - [Test] - [Category(UITestCategories.CollectionView)] - public void VerifyFooterTemplateWhenBasicDataTemplateView() - { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemTemplateBasic"); - App.Tap("ItemTemplateBasic"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); - App.WaitForElementTillPageNavigationSettled("Apple"); - } + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyFooterTemplateWhenBasicDataTemplateView() + { + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); + App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); + App.WaitForElementTillPageNavigationSettled("Apple"); + } -#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST &&TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID //In windows, related issue: https://github.com/dotnet/maui/issues/27946, In CV2, related issue: https://github.com/dotnet/maui/issues/28678, In android related issue: https://github.com/dotnet/maui/issues/28337 +#if TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS && TEST_FAILS_ON_ANDROID //In windows, related issue: https://github.com/dotnet/maui/issues/27946, In CV2, related issue: https://github.com/dotnet/maui/issues/28678, In android related issue: https://github.com/dotnet/maui/issues/28337 [Test] [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWithItemsLayoutVerticalGrid() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutVerticalGrid"); - App.Tap("ItemsLayoutVerticalGrid"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.WaitForElementTillPageNavigationSettled("FooterTemplateLabel"); } @@ -1724,14 +1744,14 @@ public void VerifyFooterTemplateWithItemsLayoutVerticalGrid() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWithItemsLayoutHorizontalList() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalList"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1742,14 +1762,14 @@ public void VerifyFooterTemplateWithItemsLayoutHorizontalList() [Category(UITestCategories.CollectionView)] public void VerifyFooterTemplateWithItemsLayoutHorizontalGrid() { - App.WaitForElementTillPageNavigationSettled("Options"); - App.Tap("Options"); - App.WaitForElementTillPageNavigationSettled("FooterTemplateGrid"); - App.Tap("FooterTemplateGrid"); - App.WaitForElementTillPageNavigationSettled("ItemsLayoutHorizontalGrid"); - App.Tap("ItemsLayoutHorizontalList"); - App.WaitForElementTillPageNavigationSettled("Apply"); - App.Tap("Apply"); + App.WaitForElementTillPageNavigationSettled(Options); + App.Tap(Options); + App.WaitForElementTillPageNavigationSettled(FooterTemplateGrid); + App.Tap(FooterTemplateGrid); + App.WaitForElementTillPageNavigationSettled(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElementTillPageNavigationSettled(Apply); + App.Tap(Apply); App.WaitForElementTillPageNavigationSettled("Apple"); App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); App.WaitForElementTillPageNavigationSettled("Mango"); @@ -1758,5 +1778,4 @@ public void VerifyFooterTemplateWithItemsLayoutHorizontalGrid() } #endif #endif - } } \ No newline at end of file diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GroupingFeatureTests.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GroupingFeatureTests.cs new file mode 100644 index 000000000000..c50e80417451 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/GroupingFeatureTests.cs @@ -0,0 +1,825 @@ +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests; +public class GroupingFeatureTests : UITest +{ + public const string GroupingFeatureMatrix = "CollectionView Feature Matrix"; + public const string Options = "Options"; + public const string Apply = "Apply"; + public const string GroupHeaderTemplateGrid = "GroupHeaderTemplateGrid"; + public const string GroupFooterTemplateGrid = "GroupFooterTemplateGrid"; + public const string IsGroupedTrue = "IsGroupedTrue"; + public const string ItemsSourceGroupedList = "ItemsSourceGroupedList"; + public const string FooterString = "FooterString"; + public const string HeaderString = "HeaderString"; + public const string ItemTemplateBasic = "ItemTemplateBasic"; + public const string ItemsLayoutHorizontalList = "ItemsLayoutHorizontalList"; + public const string ItemsLayoutHorizontalGrid = "ItemsLayoutHorizontalGrid"; + public const string ItemsLayoutVerticalGrid = "ItemsLayoutVerticalGrid"; + + + public GroupingFeatureTests(TestDevice device) + : base(device) + { + } + protected override void FixtureSetup() + { + base.FixtureSetup(); + App.NavigateToGallery(GroupingFeatureMatrix); + } + + [Test, Order(1)] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupFooterTemplate_WithFooterString() + { + App.WaitForElement("GroupingButton"); + App.Tap("GroupingButton"); + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(FooterString); + App.Tap(FooterString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Footer(String)"); + App.WaitForNoElement("GroupFooterTemplate"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupFooterTemplate_WithHeaderString() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(HeaderString); + App.Tap(HeaderString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Header(String)"); + App.WaitForNoElement("GroupFooterTemplate"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupFooterTemplate_WithBasicItemTemplate() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + App.WaitForNoElement("GroupFooterTemplate"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderTemplate_WithFooterString() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(FooterString); + App.Tap(FooterString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Footer(String)"); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForNoElement("GroupHeaderTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderTemplate_WithHeaderString() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(HeaderString); + App.Tap(HeaderString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Header(String)"); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForNoElement("GroupHeaderTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderTemplate_WithBasicItemTemplate() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForNoElement("GroupHeaderTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForNoElement("GroupHeaderTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithItemSourceNull() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement("ItemsSourceNone"); + App.Tap("ItemsSourceNone"); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedFalse_WithItemSourceObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + App.WaitForNoElement("Fruits"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedFalse_WithHeaderAndFooterString() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(HeaderString); + App.Tap(HeaderString); + App.WaitForElement(FooterString); + App.Tap(FooterString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Header(String)"); + App.WaitForElement("CollectionView Footer(String)"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedFalse_WithBasicItemTemplate() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + } + +#if TEST_FAILS_ON_WINDOWS // [Windows] NullReferenceException thrown When Toggling IsGrouped to True in ObservableCollection Binding Issue Link: https://github.com/dotnet/maui/issues/28824 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithFooterString() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(FooterString); + App.Tap(FooterString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Footer(String)"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithHeaderString() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(HeaderString); + App.Tap(HeaderString); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("CollectionView Header(String)"); + } +#endif + +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS +//Test fails on CV2 , GroupHeader and GroupFooter template is not visible Issue Link: https://github.com/dotnet/maui/issues/28509 +//Test fails on CV2 , ItemsLayout does not change Issue Link: https://github.com/dotnet/maui/issues/28656 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithVerticalListAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithGroupHeaderAndGroupFooterTemplate() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("GroupFooterTemplate"); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedTrue_WithItemSourceGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Fruits"); + App.WaitForElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithVerticalListAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Fruits"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedTrue_WithBasicTemplateWhenGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + App.WaitForElement("Fruits"); + App.WaitForElement("Vegetables"); + } + +#if TEST_FAILS_ON_WINDOWS +//ItemsLayout does not change its default value on windows Issue Link: https://github.com/dotnet/maui/issues/27946 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithHorizontalListAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithHorizontalGridAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalGrid); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithVerticalGridAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithVerticalListAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithHorizontalListAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Fruits"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl"); + App.WaitForElement("Carrot"); + App.WaitForElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithHorizontalGridAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalGrid); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Fruits"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl"); + App.WaitForElement("Carrot"); + App.WaitForElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithHorizontalListAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElement("Carrot"); + App.WaitForElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithHorizontalGridAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalGrid); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.ScrollRight("CollectionViewControl", ScrollStrategy.Gesture, 0.9, 500); + App.WaitForElement("Carrot"); + App.WaitForElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyGroupHeaderAndFooterTemplate_WithVerticalGridAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("GroupHeaderTemplate"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForElement("GroupFooterTemplate"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithVerticalGridAndGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Fruits"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForElement("Vegetables"); + } +#endif +#endif + +#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS +//CollectionView Displays Blank UI When Changing IsGrouped and ItemsSourceType Issue Link: https://github.com/dotnet/maui/issues/28826 +//[Windows] NullReferenceException thrown When Toggling IsGrouped to True in ObservableCollection Binding: https://github.com/dotnet/maui/issues/28824 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedTrue_WithItemSourceObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + App.WaitForNoElement("Fruits"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedFalse_WithItemSourceGroupedList() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("Fruits"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGroupedTrue_WithBasicTemplateWhenObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(ItemTemplateBasic); + App.Tap(ItemTemplateBasic); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForElement("Apple"); + App.WaitForElement("Banana"); + App.WaitForNoElement("Fruits"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithHorizontalListAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsLayoutHorizontalList); + App.Tap(ItemsLayoutHorizontalList); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("Fruits"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithHorizontalGridAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsLayoutHorizontalGrid); + App.Tap(ItemsLayoutHorizontalGrid); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("Fruits"); + App.WaitForElement("Apple"); + App.ScrollRight("CollectionViewControl"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithVerticalGridAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(ItemsLayoutVerticalGrid); + App.Tap(ItemsLayoutVerticalGrid); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("Fruits"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("Vegetables"); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithVerticalListAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("Fruits"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + App.WaitForNoElement("Vegetables"); + } + +// [Android] Group Header/Footer Repeated for All Items When IsGrouped is True for ObservableCollection Issue Link: https://github.com/dotnet/maui/issues/28827 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyIsGrouped_WithGroupHeaderAndFooterTemplateAndObservableCollection() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(GroupHeaderTemplateGrid); + App.Tap(GroupHeaderTemplateGrid); + App.WaitForElement(GroupFooterTemplateGrid); + App.Tap(GroupFooterTemplateGrid); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + App.WaitForNoElement("GroupHeaderTemplate"); + App.WaitForNoElement("GroupFooterTemplate"); + App.WaitForElement("Apple"); + App.WaitForElement("Carrot"); + } +#endif + +#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_IOS +//CanMixGroups Set to False Still Allows Reordering Between Groups in CollectionView on Catalyst Issue Link : https://github.com/dotnet/maui/issues/28530 +//Test fails on CV2 . GroupHeader and GroupFooter template is not visible Issue Link: https://github.com/dotnet/maui/issues/28509 +//.NET MAUI CollectionView does not reorder when grouped on windows Issue Link: https://github.com/dotnet/maui/issues/13027 + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyCanMixGroupsFalseWithCanReorderItems() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement("CanReorderItemsTrue"); + App.Tap("CanReorderItemsTrue"); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + var initialY = App.WaitForElement("Apple").GetRect().Y; + App.DragAndDrop("Apple", "Potato"); + var newY = App.WaitForElement("Carrot").GetRect().Y; + Assert.That(newY, Is.GreaterThan(initialY), "The Y position of 'Carrot' should be greater than Apple after the drag-and-drop operation."); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyCanMixGroupsTrueWithCanReorderItems() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement("CanMixGroupsTrue"); + App.Tap("CanMixGroupsTrue"); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement("CanReorderItemsTrue"); + App.Tap("CanReorderItemsTrue"); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + var initialY = App.WaitForElement("Apple").GetRect().Y; + App.DragAndDrop("Apple", "Potato"); + var newY = App.WaitForElement("Apple").GetRect().Y; + Assert.That(newY, Is.GreaterThan(initialY), "The Y position of 'Apple' should be greater after the drag-and-drop operation."); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyCanReorderItemsTrueWithCanMixGroups() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement("CanReorderItemsTrue"); + App.Tap("CanReorderItemsTrue"); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement("CanMixGroupsTrue"); + App.Tap("CanMixGroupsTrue"); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + var initialY = App.WaitForElement("Apple").GetRect().Y; + App.DragAndDrop("Apple", "Potato"); + var newY = App.WaitForElement("Apple").GetRect().Y; + Assert.That(newY, Is.GreaterThan(initialY), "The Y position of 'Apple' should be greater after the drag-and-drop operation."); + } + + [Test] + [Category(UITestCategories.CollectionView)] + public void VerifyCanReorderItemsFalseWithCanMixGroups() + { + App.WaitForElement(Options); + App.Tap(Options); + App.WaitForElement(ItemsSourceGroupedList); + App.Tap(ItemsSourceGroupedList); + App.WaitForElement("CanMixGroupsTrue"); + App.Tap("CanMixGroupsTrue"); + App.WaitForElement(IsGroupedTrue); + App.Tap(IsGroupedTrue); + App.WaitForElement(Apply); + App.Tap(Apply); + var initialY = App.WaitForElement("Apple").GetRect().Y; + App.DragAndDrop("Apple", "Potato"); + var newY = App.WaitForElement("Apple").GetRect().Y; + Assert.That(newY, Is.EqualTo(initialY), "The Y position of 'Apple' should be Same Value after the drag-and-drop operation."); + } +#endif +} \ No newline at end of file