Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] Enabling more UI Tests by removing platform specific condition - 3 #27501

Merged
merged 16 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
<Label
x:Name="TestLabel"
AutomationId="TestLabel" />
<!-- Set the RowHeight to enable scrolling on the Windows platform -->
<ListView
AutomationId="TestListView"
Grid.Row="1"
Grid.Row="1" RowHeight="40"
Scrolled="OnListViewScrolled">
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public Issue21173(TestDevice device)
: base(device)
{ }

#if ANDROID
[Test]
[Category(UITestCategories.Border)]
public void BorderWithRoundRectangleShouldRoundCornersOfContentWithinIt()
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is failing on Windows:

   at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2311
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2326
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 663
   at Microsoft.Maui.TestCases.Tests.Issues.Issue21173.BorderWithRoundRectangleShouldRoundCornersOfContentWithinIt() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue21173.cs:line 19
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified the test to ensure it runs on Windows and committed the code changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! The snapshot on Windows is pending and available on the latest build.

Expand All @@ -22,5 +21,4 @@ public void BorderWithRoundRectangleShouldRoundCornersOfContentWithinIt()
// The test passes if corners of borders' contents' have proper corner radiuses
VerifyScreenshot();
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -22,5 +21,4 @@ public void Issue21202Test()
VerifyScreenshot();
}
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if IOS
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
Expand All @@ -22,5 +21,4 @@ public void ImageShouldBePortrait()
ClassicAssert.Greater(image.Height, image.Width);
}
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -24,5 +23,4 @@ public void Issue21394Test()
VerifyScreenshot();
}
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ANDROID
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -17,10 +16,10 @@ public Issue21437(TestDevice device)
[Category(UITestCategories.Gestures)]
public void ExceptionShouldNotBeThrown()
{
_ = App.WaitForElement("Item2");
App.DoubleClick("Item2");
App.WaitForElement("Item2");
App.DoubleTap("Item2");
App.WaitForNoElement("Item2");

//The test passes if no exception is thrown
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -23,5 +22,4 @@ public async Task ImageButtonStuckAfterRightClick()
VerifyScreenshot();
}
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -20,5 +19,4 @@ public void LabelTextDecorationsWorks()

VerifyScreenshot();
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if !MACCATALYST
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand Down Expand Up @@ -29,4 +28,3 @@ public void BorderColorShouldChange()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if IOS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending snapshots. Already available on the latest build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have committed this snapshot in the latest changes.

using UITest.Core;

Expand Down Expand Up @@ -29,4 +28,3 @@ public void RadioButtonWithValueChangeSelected()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if IOS
#if IOS || 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 iOS and Android.
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
Expand All @@ -19,12 +19,11 @@ public Issue2241(TestDevice testDevice) : base(testDevice)
[Category(UITestCategories.Compatibility)]
public void ChangeOrientationCheckScroll()
{
var grid1 = App.FindElement("MainGrid").GetRect();
var grid1 = App.WaitForElement("MainGrid").GetRect();
App.SetOrientationLandscape();
App.ScrollDown("TestScrollView", ScrollStrategy.Programmatically);
App.SetOrientationPortrait();
var grid2 = App.FindElement("MainGrid").GetRect();
App.Screenshot("Did it resize ok? Do you see some white on the bottom?");
var grid2 = App.WaitForElement("MainGrid").GetRect();

ClassicAssert.AreEqual(grid1.CenterY(), grid2.CenterY());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public Issue22606(TestDevice device) : base(device) { }

public override string Issue => "Border does not expand on Content size changed";

#if !MACCATALYST
[Test]
public void BorderBackgroundExpandsOnContentSizeChanged()
{
Expand All @@ -22,9 +21,8 @@ public void BorderBackgroundExpandsOnContentSizeChanged()
App.Tap("SetHeightTo500");
VerifyScreenshot("Issue22606_SetHeightTo500");
}
#endif

#if ANDROID || IOS
#if ANDROID || IOS //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 iOS and Android.
[Test]
public void BorderBackgroundSizeUpdatesWhenRotatingScreen()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if IOS
using NUnit.Framework;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using UITest.Appium;
using UITest.Core;
Expand All @@ -20,8 +19,7 @@ public void ListViewScrolled()
{
App.WaitForElement("TestListView");
App.ScrollDown("TestListView", ScrollStrategy.Gesture, swipeSpeed: 1000);
var result = App.FindElement("TestLabel").GetText();
var result = App.WaitForElement("TestLabel").GetText();
ClassicAssert.AreEqual("Success", result);
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ANDROID
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand Down Expand Up @@ -28,5 +27,4 @@ public void RadioButtonUpdateValueInsideBorder()
VerifyScreenshot("RadioButtonUpdateValueInsideBorderYes");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending snapshot on macOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The images generated for Mac from this CI have not proper, Could we attempt to retrigger the CI for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Build failing because the test is pending:
image
Attached it.

}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#if ANDROID || WINDOWS
using NUnit.Framework;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -23,5 +22,4 @@ public void ToolbarItemFontColorDynamicUpdate()
VerifyScreenshot();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending snapshot on Mac.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The images generated for Mac from this CI have not proper, Could we attempt to retrigger the CI for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Better wait to #27531

}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if ANDROID
#if ANDROID || IOS //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 iOS and Android.
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
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