From 2faee2edf7e6ba6c40cf1bd756c13add2add48c1 Mon Sep 17 00:00:00 2001 From: TamilarasanSF4853 Date: Mon, 28 Apr 2025 13:23:02 +0530 Subject: [PATCH 1/2] enabled the test case for android --- .../TestCases.HostApp/Issues/Issue10222.cs | 18 +++++++++--------- .../Tests/Issues/Issue10222.cs | 7 +++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs index 70c66126c1372..58fbed4bfd482 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs @@ -27,6 +27,7 @@ public MainPage() class CarouselViewTestPage : ContentPage { CollectionView cv; + List items; public CarouselViewTestPage() { cv = new CollectionView @@ -42,25 +43,24 @@ public CarouselViewTestPage() }; label.SetBinding(Label.TextProperty, new Binding(".")); label.SetBinding(Label.AutomationIdProperty, new Binding(".")); + var tapGestureRecognizer = new TapGestureRecognizer(); + tapGestureRecognizer.Tapped += (sender, e) => LabelTapped(); + label.GestureRecognizers.Add(tapGestureRecognizer); return label; }) }; - Content = cv; - InitCV(); - } - async void InitCV() - { - var items = new List(); + items = new List(); for (int i = 0; i < 10; i++) { items.Add($"items{i}"); } - cv.ItemsSource = items; + Content = cv; + } - //give the cv time to draw the items - await Task.Delay(1000); + async void LabelTapped() + { cv.ScrollTo(items.Count - 1); diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs index 34b94d7f2f14f..c2aa0b2c5a117 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10222.cs @@ -1,4 +1,3 @@ -#if TEST_FAILS_ON_ANDROID // More information: https://github.com/dotnet/maui/issues/28640 using NUnit.Framework; using UITest.Appium; using UITest.Core; @@ -18,8 +17,8 @@ public void Issue10222Test() { App.WaitForElement("goTo"); App.Tap("goTo"); - App.WaitForElement("items1", timeout: TimeSpan.FromSeconds(1)); + App.WaitForElement("items1"); + App.Tap("items1"); App.WaitForElement("goTo", timeout: TimeSpan.FromSeconds(2)); } -} -#endif \ No newline at end of file +} \ No newline at end of file From 02a9f52e95f182d90053ce3221ee3c465ce374b7 Mon Sep 17 00:00:00 2001 From: TamilarasanSF4853 Date: Mon, 28 Apr 2025 17:31:03 +0530 Subject: [PATCH 2/2] added comment --- src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs index 58fbed4bfd482..4d7d5850ffa31 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs @@ -58,7 +58,8 @@ public CarouselViewTestPage() cv.ItemsSource = items; Content = cv; } - + + // Scrolls to last item then pops the page async void LabelTapped() {