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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 29 additions & 42 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue32932.cs
Original file line number Diff line number Diff line change
@@ -1,61 +1,48 @@
namespace Maui.Controls.Sample.Issues;

using System.Collections.ObjectModel;

[Issue(IssueTracker.Github, 32932, "[Android] EmptyView doesn’t display when CollectionView is placed inside a VerticalStackLayout", PlatformAffected.Android)]

public class Issue32932 : TestShell
public class Issue32932 : TestContentPage
{
protected override void Init()
{
var shellContent = new ShellContent
var collectionView = new CollectionView();

collectionView.AutomationId = "EmptyCollectionView";
collectionView.Header = new Label
{
Title = "Home",
Route = "MainPage",
Content = new Issue32932CollectionViewPage() { Title = "Home" }
Text = "CollectionView Header",
FontSize = 18,
HorizontalOptions = LayoutOptions.Center
};

Items.Add(shellContent);
}


class Issue32932CollectionViewPage : ContentPage
{
public Issue32932CollectionViewPage()
collectionView.ItemTemplate = new DataTemplate(() =>
{
Title = "Issue 32932 CollectionView Page";
var label = new Label();
label.SetBinding(Label.TextProperty, new Binding(".")); // bind to the string item
return label;
});

var collectionView = new CollectionView2
// EmptyView: ContentView -> VerticalStackLayout -> Label "No values found..."
collectionView.EmptyView = new ContentView
{
Content = new VerticalStackLayout
{
AutomationId = "EmptyView",
ItemTemplate = new DataTemplate(() =>
{
var label = new Label();
label.SetBinding(Label.TextProperty, new Binding(".")); // bind to the string item
return label;
}),

// EmptyView: ContentView -> VerticalStackLayout -> Label "No values found..."
EmptyView = new ContentView
{
Content = new VerticalStackLayout
{
Children =
Children =
{
new Label { Text = "No values found..." , AutomationId= "EmptyViewLabel"}
}
}
}
};

collectionView.ItemsSource = null; // Null collection to trigger EmptyView
}
};
collectionView.ItemsSource = new ObservableCollection<string>();

// inner stack that contains the title and the CollectionView
var innerStack = new VerticalStackLayout
{
Children = { collectionView }
};
// inner stack that contains the title and the CollectionView
var innerStack = new VerticalStackLayout
{
Children = { collectionView }
};

Content = innerStack;
}
Content = innerStack;
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //related issues: https://github.com/dotnet/maui/issues/33507, https://github.com/dotnet/maui/issues/15994
#if TEST_FAILS_ON_ANDROID && TEST_FAILS_ON_IOS && TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //related issues: https://github.com/dotnet/maui/issues/33507, https://github.com/dotnet/maui/issues/15994
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if TEST_FAILS_ON_WINDOWS //Issue - https://github.com/dotnet/maui/issues/4715. Appium does not find the AutomationID for the layout on Windows.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -23,3 +24,4 @@ public void LabelWithEndAlignmentShouldNotHaveTrailingSpace()
$"End-aligned label ({labelRect.Width}pt) should be narrower than container ({containerRect.Width}pt)");
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Issue32932(TestDevice device) : base(device)
[Category(UITestCategories.CollectionView)]
public void EmptyViewShouldDisplayWhenCollectionViewIsInsideVerticalStackLayout()
{
App.WaitForElement("EmptyView");
App.WaitForElement("EmptyCollectionView");

#if WINDOWS // EmptyView(null ItemsSource) elements Not Accessible via Automation on Windows Platform Issue Link: https://github.com/dotnet/maui/issues/28022
VerifyScreenshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void PerformGestureActionForFirstSpan(Rectangle target)
void PerformGestureActionForSecondSpan(Rectangle target)
{
#if ANDROID // Calculate points vary on Android and other platforms.
App.TapCoordinates(target.X + target.Width / 2, target.Y + 2);
App.TapCoordinates((target.X + target.Width / 2) + 5, target.Y + 2);
#else
PerformGestureAction(target.X + target.Width - 10, target.Y + 2);
#endif
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