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
21 changes: 11 additions & 10 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue10222.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public MainPage()
class CarouselViewTestPage : ContentPage
{
CollectionView cv;
List<string> items;
public CarouselViewTestPage()
{
cv = new CollectionView
Expand All @@ -42,25 +43,25 @@ 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<string>();
items = new List<string>();
for (int i = 0; i < 10; i++)
{
items.Add($"items{i}");
}

cv.ItemsSource = items;

//give the cv time to draw the items
await Task.Delay(1000);
Content = cv;
}

// Scrolls to last item then pops the page
async void LabelTapped()

Copilot AI Apr 28, 2025

Copy link

Choose a reason for hiding this comment

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

The comment indicates that tapping the label should scroll to the last item and then pop the page, but the implementation only scrolls to the last item without executing any pop operation. Please add the necessary navigation pop action to match the intended behavior.

Copilot uses AI. Check for mistakes.
{

cv.ScrollTo(items.Count - 1);

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
}