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.
3 changes: 2 additions & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue19152.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue19152"
xmlns:local="clr-namespace:Maui.Controls.Sample"
Title="Issue19152">
<ScrollView>
<VerticalStackLayout
Padding="30,0"
Spacing="25">
<Entry Background="White" AutomationId="entry" x:Name="entry" TextColor="Blue" Text="Entry Text" ClearButtonVisibility="WhileEditing"/>
<local:UITestEntry Background="White" AutomationId="entry" x:Name="entry" TextColor="Blue" Text="Entry Text" ClearButtonVisibility="WhileEditing" IsSpellCheckEnabled="False" IsCursorVisible="False"/>
<Button AutomationId="button"
x:Name="button"
Text="Click me"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ public class CarouselViewUITests : UITest
{
const string CarouselViewGallery = "CarouselView Gallery";

public CarouselViewUITests(TestDevice device)
: base(device)
public CarouselViewUITests(TestDevice device): base(device)
{
}

Expand All @@ -25,19 +24,18 @@ public override void TestSetup()

[Test]
[Category(UITestCategories.CarouselView)]
public async Task CarouselViewSetPosition()
public void CarouselViewSetPosition()
{
await Task.Delay(2000);

App.WaitForElement("lblPosition");
await Task.Delay(3000);

CheckLabelValue("lblPosition", "3");
}

[Test]
[Category(UITestCategories.CarouselView)]
public async Task CarouselViewGoToNextCurrentItem()
public void CarouselViewGoToNextCurrentItem()
{
await Task.Delay(2000);
int indexToTest = 3;
var index = indexToTest.ToString();
var nextIndex = (indexToTest + 1).ToString();
Expand All @@ -55,9 +53,8 @@ public async Task CarouselViewGoToNextCurrentItem()

[Test]
[Category(UITestCategories.CarouselView)]
public async Task CarouselViewGoToPreviousCurrentItem()
public void CarouselViewGoToPreviousCurrentItem()
{
await Task.Delay(2000);
int indexToTest = 3;
var index = indexToTest.ToString();
var previousIndex = (indexToTest - 1).ToString();
Expand All @@ -72,13 +69,13 @@ public async Task CarouselViewGoToPreviousCurrentItem()
CheckLabelValue("lblSelected", previousIndex);
}

// Catalyst doesn't support orientation changes
// Catalyst doesn't support orientation changes
#if !MACCATALYST
[Test]
[Category(UITestCategories.CarouselView)]
public async Task CarouselViewKeepPositionChangingOrientation()
public void CarouselViewKeepPositionChangingOrientation()
{
await Task.Delay(2000);

int indexToTest = 3;
var index = indexToTest.ToString();

Expand All @@ -87,9 +84,11 @@ public async Task CarouselViewKeepPositionChangingOrientation()
App.WaitForElement($"CarouselItem{index}");

App.SetOrientationLandscape();
App.WaitForElement($"CarouselItem{index}");
App.SetOrientationPortrait();
App.WaitForElement($"CarouselItem{index}");


await Task.Delay(3000);

CheckLabelValue("lblPosition", index);
CheckLabelValue("lblCurrentItem", index);
Expand All @@ -101,38 +100,38 @@ public async Task CarouselViewKeepPositionChangingOrientation()
[Category(UITestCategories.CarouselView)]
public void NavigateBackWhenLooped()
{
int index = 3;

for (int i = 0; i < 10; i++)
{
if (index < 0)
{
index = 4;
}
App.WaitForElement($"CarouselItem{index}");
App.ScrollLeft("TheCarouselView");
index--;
}
int index = 3;

for (int i = 0; i < 10; i++)
{
if (index < 0)
{
index = 4;
}

App.WaitForElement($"CarouselItem{index}");
App.ScrollLeft("TheCarouselView");
index--;
}
}

[Test]
[Category(UITestCategories.CarouselView)]
public void NavigateForwardWhenLooped()
{
int index = 3;

for (int i = 0; i < 10; i++)
{
if (index > 4)
{
index = 0;
}
App.WaitForElement($"CarouselItem{index}");
App.ScrollRight("TheCarouselView");
index++;
}
int index = 3;

for (int i = 0; i < 10; i++)
{
if (index > 4)
{
index = 0;
}

App.WaitForElement($"CarouselItem{index}");
App.ScrollRight("TheCarouselView");
index++;
}
}
#endif

Expand All @@ -143,4 +142,4 @@ void CheckLabelValue(string labelAutomationId, string value)
}
}
}
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public void EntryClearButtonColorShouldMatchTextColor()
App.WaitForElement("entry");
App.Tap("button");
#if ANDROID // Skip keyboard on Android to address CI flakiness, Keyboard is not needed validation.
Thread.Sleep(500); // Wait for the keyboard to appear
if (App.IsKeyboardShown())
App.DismissKeyboard();
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ public void TapThenDoubleTap()
App.WaitForElement("Single");

App.DoubleTap("TapLabel");

#if ANDROID
// In CI Double tap does not effective sometimes so retry once before failing to resolve the flakiness.
try
{
App.WaitForElement("Double");
}
catch(TimeoutException)
{
App.WaitForElement("Single");
App.DoubleTap("TapLabel");
}
#endif
App.WaitForElement("Double");
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if TEST_FAILS_ON_CATALYST // TimePicker not opens the dialog, issue: https://github.com/dotnet/maui/issues/10827
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // TimePicker not opens the dialog, issue: https://github.com/dotnet/maui/issues/10827
Copy link

Copilot AI Feb 20, 2025

Choose a reason for hiding this comment

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

Ensure that the updated conditional directive for iOS accurately targets devices with inconsistent picker popup layouts and that associated documentation is updated to reflect this change.

Copilot uses AI. Check for mistakes.
// Picker popup layout is inconsistent on IOS , issue: https://github.com/dotnet/maui/issues/27898
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms Android and iOS.
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS && TEST_FAILS_ON_ANDROID //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms Android and iOS.
Copy link

Copilot AI Feb 20, 2025

Choose a reason for hiding this comment

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

Ensure that the inclusion of the TEST_FAILS_ON_ANDROID flag is documented either in the test case or related docs to clarify its purpose for addressing the cancel button display issue.

Copilot uses AI. Check for mistakes.
// Cancel button is not displayed after orientation changes on Android issue: https://github.com/dotnet/maui/issues/27900
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;
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