Skip to content

Commit a89df8c

Browse files
kubaflormarinho
authored andcommitted
[Testing] Implemented InteractivePopGesture (#28577)
* Support for Android * Added a UI Test
1 parent 2fef448 commit a89df8c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28485.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if IOS
1+
#if ANDROID || IOS
22
using NUnit.Framework;
33
using UITest.Appium;
44
using UITest.Core;
@@ -22,6 +22,7 @@ public void SwipeBackGestureShouldNavigateOnce()
2222
App.Click("GotoPage2");
2323
App.WaitForElement("GotoPage3");
2424
App.Click("GotoPage3");
25+
App.WaitForElement("Page3Label");
2526
App.Click("Page3Label");
2627
App.InteractivePopGesture();
2728
App.WaitForElement("Page2Label");

src/TestUtils/src/UITest.Appium/HelperExtensions.cs

+13-6
Original file line numberDiff line numberDiff line change
@@ -1764,18 +1764,25 @@ public static void Shake(this IApp app)
17641764
}
17651765

17661766
/// <summary>
1767-
/// Triggers the interactive pop gesture on an iOS device, simulating the default swipe-back navigation.
1767+
/// Triggers the interactive pop gesture, simulating the default swipe-back navigation.
17681768
/// </summary>
1769-
/// <param name="app">The application instance used to execute the gesture.</param>
1770-
/// <exception cref="InvalidOperationException">Thrown if the method is called on a non-iOS Appium instance.</exception>
1769+
/// <param name="app">Represents the main gateway to interact with an app.</param>
1770+
/// /// <exception cref="InvalidOperationException">InteractivePopGesture is only supported on <see cref="AppiumIOSApp"/> and <see cref="AppiumAndroidApp"/>.</exception>
17711771
public static void InteractivePopGesture(this IApp app)
17721772
{
1773-
if (app is not AppiumIOSApp)
1773+
if (app is not AppiumIOSApp && app is not AppiumAndroidApp)
17741774
{
1775-
throw new InvalidOperationException($"Interactive Pop Gesture is only supported on AppiumIOSAppp");
1775+
throw new InvalidOperationException($"Interactive Pop Gesture is only supported on AppiumIOSAppp and AppiumAndroidApp");
17761776
}
17771777

1778-
app.CommandExecutor.Execute("interactivePopGesture", ImmutableDictionary<string, object>.Empty);
1778+
if (app is AppiumIOSApp)
1779+
{
1780+
app.CommandExecutor.Execute("interactivePopGesture", ImmutableDictionary<string, object>.Empty);
1781+
}
1782+
else if (app is AppiumAndroidApp)
1783+
{
1784+
SwipeLeftToRight(app);
1785+
}
17791786
}
17801787

17811788
/// <summary>

0 commit comments

Comments
 (0)