Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ stages:
platform: 'iOS'
artifactName: 'uitest-snapshot-results-ios-$(System.StageName)-$(System.JobName)-$(System.JobAttempt)'

- stage: ios_ui_tests_mono_cv2
displayName: iOS UITests Mono CollectionView2
- stage: ios_ui_tests_mono_cv1
displayName: iOS UITests Mono CollectionView1
dependsOn: build_ui_tests
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.ios, '') }}:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: CV2_ios_ui_tests_mono_${{ project.name }}_${{ replace(version, '.', '_') }}
- job: CV1_ios_ui_tests_mono_${{ project.name }}_${{ replace(version, '.', '_') }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }} # how long to run the job before automatically cancelling
workspace:
clean: all
Expand All @@ -288,24 +288,24 @@ stages:
runtimeVariant : "Mono"
testFilter: "CollectionView"
headless: ${{ parameters.headless }}
testConfigurationArgs: "CollectionView2"
testConfigurationArgs: "CollectionView1"
skipProvisioning: ${{ parameters.skipProvisioning }}

# Collect and publish iOS CV2 snapshot diffs
# Collect and publish iOS CV1 snapshot diffs
- template: ui-tests-collect-snapshot-diffs.yml
parameters:
platform: 'iOS CV2'
platform: 'iOS CV1'
artifactName: 'uitest-snapshot-results-ios-cv2-$(System.StageName)-$(System.JobName)-$(System.JobAttempt)'

- stage: ios_ui_tests_mono_carv2
displayName: iOS UITests Mono CarouselView2
- stage: ios_ui_tests_mono_carv1
displayName: iOS UITests Mono CarouselView1
dependsOn: build_ui_tests
jobs:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.ios, '') }}:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: CARV2_ios_ui_tests_mono_${{ project.name }}_${{ replace(version, '.', '_') }}
- job: CARV1_ios_ui_tests_mono_${{ project.name }}_${{ replace(version, '.', '_') }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }} # how long to run the job before automatically cancelling
workspace:
clean: all
Expand All @@ -331,7 +331,7 @@ stages:
provisionatorChannel: ${{ parameters.provisionatorChannel }}
runtimeVariant : "Mono"
testFilter: "CarouselView"
testConfigurationArgs: "CollectionView2"
testConfigurationArgs: "CollectionView1"
skipProvisioning: ${{ parameters.skipProvisioning }}

# Collect and publish iOS CARV2 snapshot diffs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ public static MauiAppBuilder ConfigureCollectionViewHandlers(this MauiAppBuilder
#if IOS || MACCATALYST
builder.ConfigureMauiHandlers(handlers =>
{
bool cv2Handlers = false;
bool cv2Handlers = true;
foreach (var en in NSProcessInfo.ProcessInfo.Environment)
{
if ($"{en.Key}" == "TEST_CONFIGURATION_ARGS")
{
cv2Handlers = $"{en.Value}".Contains("CollectionView2", StringComparison.OrdinalIgnoreCase);
// If TEST_CONFIGURATION_ARGS contains "CollectionView1", use legacy CV1 handlers
// Otherwise, use CV2 handlers (default)
cv2Handlers = !$"{en.Value}".Contains("CollectionView1", StringComparison.OrdinalIgnoreCase);
break;
}
}

if (cv2Handlers)
{
Console.WriteLine($"Using CollectionView2 handlers");
Expand Down
115 changes: 65 additions & 50 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue20294.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,69 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Issue 20294"
x:Class="Maui.Controls.Sample.Issues.Issue20294">
<CollectionView SelectionMode="Single" Margin="10.0" AutomationId="theCollectionView">
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>ONE</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>LAST</x:String>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemsLayout>
<LinearItemsLayout
Orientation="Vertical"
ItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Footer>
<Label HeightRequest="45" Text="FOOTER" AutomationId="FOOTER"/>
</CollectionView.Footer>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="x:String">
<Border AutomationId="{Binding}" StrokeThickness="0.2">
<Label Text="{Binding}" FontSize="20"/>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<Grid RowDefinitions="Auto,*">
<Button Text="Scroll To Footer"
VerticalOptions="Center"
Clicked="OnButtonClicked"
AutomationId="ScrollToFooterButton"
HorizontalOptions="Center"/>
<CollectionView SelectionMode="Single"
Grid.Row="1"
Margin="10.0"
x:Name="collectionView"
AutomationId="theCollectionView">
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>ONE</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>asdf</x:String>
<x:String>LAST</x:String>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemsLayout>
<LinearItemsLayout
Orientation="Vertical"
ItemSpacing="15"/>
</CollectionView.ItemsLayout>
<CollectionView.Footer>
<Label HeightRequest="45"
Text="FOOTER"
AutomationId="FOOTER"/>
</CollectionView.Footer>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="x:String">
<Border AutomationId="{Binding}"
StrokeThickness="0.2">
<Label Text="{Binding}"
FontSize="20"/>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ public Issue20294()
{
InitializeComponent();
}

private void OnButtonClicked(object sender, EventArgs e)
{
collectionView.ScrollTo("LAST", position: ScrollToPosition.End, animate: true);
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public Issue20294(TestDevice device) : base(device) { }
[Category(UITestCategories.CollectionView)]
public void ScrollToEndDoesntCrash()
{
App.ScrollTo("FOOTER");
App.WaitForElement("ScrollToFooterButton");
App.Tap("ScrollToFooterButton");
App.ScrollUp("theCollectionView", ScrollStrategy.Gesture, 0.5);
App.ScrollDown("theCollectionView", ScrollStrategy.Gesture, 0.5);
App.ScrollDown("theCollectionView", ScrollStrategy.Gesture, 0.5);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if TEST_FAILS_ON_ANDROID
#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST
//In iOS and Mac , https://github.com/dotnet/maui/issues/33201 takes large horizonal spacing on collectionView2.
// This test started failing on the safe area edges changes because the safe area edges changes
// cause a second measure pass which exposes a bug that already existed in CollectionView on Android.
// You can replicate this bug on NET10 by rotating the device and rotating back, and then you will see that the
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading