Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion src/Controls/tests/Core.UnitTests/PageLifeCycleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task NavigationPagePushPage(bool useMaui)
var navigationPage =
new TestNavigationPage(useMaui, previousPage)
.AddToTestWindow();

await navigationPage.NavigatingTask;
await navigationPage.PushAsync(lcPage);

Assert.NotNull(previousPage.NavigatingFromArgs);
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
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.
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.
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.
Diff not rendered.
2 changes: 1 addition & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue17664.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public Issue17664()
HorizontalOptions = LayoutOptions.Center
};

_collectionView = new CollectionView
_collectionView = new CollectionView2
{
IsGrouped = true,
GroupHeaderTemplate = new DataTemplate(() =>
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue20062.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Issue20062 : TestContentPage
protected override void Init()
{

_collectionView = new CollectionView
_collectionView = new CollectionView2
{
SelectionMode = SelectionMode.Single,
ItemsLayout = new GridItemsLayout(2, ItemsLayoutOrientation.Vertical)
Expand Down
11 changes: 11 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue29261.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,19 @@ public Issue29261()
label.Text = $"CarouselView Position - {carousel.Position}";
};

var goToLastButton = new Button
{
Text = "Go to Last",
AutomationId = "goToLastButton",
};
goToLastButton.Clicked += (s, e) =>
{
carousel.Position = carouselItems.Count - 1;
};

verticalStackLayout.Children.Add(carousel);
verticalStackLayout.Children.Add(label);
verticalStackLayout.Children.Add(goToLastButton);
Content = verticalStackLayout;
}
}
2 changes: 1 addition & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue31961.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Issue31961()

protected override void OnNavigated(ShellNavigatedEventArgs args)
{
if (Current.CurrentPage?.BindingContext is INavigationAware bindingContext)
if (Current?.CurrentPage?.BindingContext is INavigationAware bindingContext)
{
bindingContext.OnShellNavigated(args);
}
Expand Down
4 changes: 4 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33287.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ protected override async void OnAppearing()
base.OnAppearing();

// Wait long enough for the user/test to navigate back
#if MACCATALYST
await Task.Delay(4000);
#else
await Task.Delay(2000);
#endif

// Without the fix this throws NullReferenceException and crashes the app
await DisplayAlertAsync("Test Alert", "This alert was delayed", "OK");
Expand Down
3 changes: 1 addition & 2 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue34518.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public Issue34518()

var webViewGreen = new WebView
{
AutomationId = "WebViewGreen",
Source = htmlSource,
BackgroundColor = Colors.Green,
HeightRequest = 150,
Expand All @@ -26,7 +25,7 @@ public Issue34518()
Spacing = 0,
Children =
{
new Label { Text = "WebView Background should be Green:", Margin = new Thickness(4) },
new Label { AutomationId = "WebViewGreen", Text = "WebView Background should be Green:", Margin = new Thickness(4) },
webViewGreen
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issues25598.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ItemsSource="{Binding Items}"
ItemsUpdatingScrollMode="KeepScrollOffset"
VerticalOptions="EndAndExpand"
HorizontalScrollBarVisibility="Never"
VerticalScrollBarVisibility="Default">
<CarouselView.ItemTemplate>
<DataTemplate>
Expand Down Expand Up @@ -87,6 +88,7 @@
ItemsSource="{Binding Items}"
ItemsUpdatingScrollMode="KeepScrollOffset"
VerticalOptions="EndAndExpand"
HorizontalScrollBarVisibility="Never"
VerticalScrollBarVisibility="Default">
<CarouselView.ItemTemplate>
<DataTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ public Issue25598()

public class Issue25598ViewModel : ViewModel
{
int _lastItemIndex = 3;

private ObservableCollection<string> _items = new() { "Item1", "Item2", "Item3" };
private ObservableCollection<string> _items = new() { "Item", "Item", "Item" };

public ObservableCollection<string> Items
{
Expand All @@ -31,7 +29,7 @@ public ObservableCollection<string> Items
}
}

public Command AddRandomItemCommand => new(() => Items.Add($"Item{++_lastItemIndex}"));
public Command AddRandomItemCommand => new(() => Items.Add($"Item"));

public Command RemoveCurrentItemCommand => new Command<int>(index =>
{
Expand Down
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ public void CollectionviewFooterHideswhenDynamicallyAddorRemoveItems()
{
App.WaitForElement("AddButton");
App.Tap("AddButton");
App.WaitForElement("AddButton");
App.Tap("AddButton");
App.WaitForElement("AddButton");
App.Tap("AddButton");
// Here we check for Footer proper visibility with proper alignment in view.
VerifyScreenshot();
Expand All @@ -30,8 +32,11 @@ public void CollectionViewHeaderBlankWhenLastItemRemoved()
{
App.WaitForElement("AddButton");
App.Tap("RemoveButton");
App.WaitForElement("RemoveButton");
App.Tap("RemoveButton");
App.WaitForElement("RemoveButton");
App.Tap("RemoveButton");
App.WaitForElement("AddButton");
App.Tap("AddButton");
// Here we check for Header and Footer proper visibility with proper alignment in view.
VerifyScreenshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void PickerShouldDismissWhenClickOnOutside()
App.TapCoordinates(600, 200);
App.WaitForElement("Button");
#elif ANDROID
App.WaitForElement("Baboon");
App.TapCoordinates(0, 100);
#elif WINDOWS
App.TapCoordinates(60, 600);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ public void TapsShouldBeCorrectlyRecognized()
_ = App.WaitForElement("label1");

for (int i = 0; i < numberOfTappableLabels; i++)
App.Click($"label{i + 1}");
{
var labelRect = App.WaitForElement($"label{i + 1}").GetRect();

// Tap near the leading text edge to avoid missing span-only hit regions
// when label width is wider than the rendered text.
App.TapCoordinates(labelRect.X + 5, labelRect.Y + 5);
}

var resultText = App.FindElement("resultLabel").GetText();
Assert.That(resultText, Is.EqualTo($"Number of recognized taps: {numberOfTappableLabels}"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ public void IndicatorWithTemplateShouldBeVisible()
App.WaitForElement("RemoveItemButton");

for (int i = 0; i < 3; i++)
{
App.WaitForElement("RemoveItemButton");
App.Click("RemoveItemButton");
}

for (int i = 0; i < 3; i++)
{
App.WaitForElement("AddItemButton");
App.Click("AddItemButton");
}

VerifyScreenshot();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#if TEST_FAILS_ON_CATALYST
// On Catalyst, Swipe actions not supported in Appium.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand All @@ -19,11 +17,16 @@ public Issue29261(TestDevice device)
public void VerifyCarouselViewBounceTest()
{
App.WaitForElement("carouselview");
App.SwipeRightToLeft("carouselview");
App.SwipeRightToLeft("carouselview");
App.SwipeRightToLeft("carouselview");

// Use button to navigate to the last position
App.Tap("goToLastButton");
App.WaitForTextToBePresentInElement("positionLabel", "CarouselView Position - 2");

// Swipe once more past the end — should bounce back to position 2
App.ScrollRight("carouselview", ScrollStrategy.Gesture, 0.9, 500);
App.ScrollRight("carouselview", ScrollStrategy.Gesture, 0.9, 500);
var text = App.FindElement("positionLabel").GetText();
Assert.That(text, Is.EqualTo("CarouselView Position - 2"));

}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if WINDOWS // Exising issue in Android, iOS and MacCatalyst : https://github.com/dotnet/maui/issues/14497
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -20,4 +21,5 @@ public void VerifySearchHandlerValues()
App.Tap("button");
VerifyScreenshot();
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public Issue29544(TestDevice device) : base(device) { }
[Category(UITestCategories.CarouselView)]
public void PreviousPositionUpdatesCorrectlyOnScrollTo()
{
if (App is AppiumIOSApp iosApp && HelperExtensions.IsIOS26OrHigher(iosApp))
{
Assert.Ignore("Ignored due to a bug issue in iOS 26"); // Issue Link: https://github.com/dotnet/maui/issues/34965
}
App.WaitForElement("ScrollTo3Button");
App.Tap("ScrollTo3Button");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void VerifyShellMenuItemsAlignedInRTL()
{
App.WaitForElement("homePageLabel");
App.Tap("FlyoutLockedButton");
App.WaitForElement("MenuItem1");
App.WaitForElement("MenuItem 1");
VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2));
}

Expand Down
Loading
Loading