Skip to content

Commit

Permalink
chore: Remove resetApp (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dor-bl authored Dec 5, 2023
1 parent 499530c commit 37f3b0b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
2 changes: 0 additions & 2 deletions src/Appium.Net/Appium/AppiumCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ public class AppiumCommand
"/session/{sessionId}/appium/app/launch"),
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.CloseApp,
"/session/{sessionId}/appium/app/close"),
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.ResetApp,
"/session/{sessionId}/appium/app/reset"),

#endregion (Deprecated) legacy app management

Expand Down
2 changes: 0 additions & 2 deletions src/Appium.Net/Appium/AppiumDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ public void PushFile(string pathOnDevice, FileInfo file) =>
public void LaunchApp() => ((IExecuteMethod)this).Execute(AppiumDriverCommand.LaunchApp);
[Obsolete("The CloseApp API is deprecated and will be removed in future versions. Please use TerminateApp instead \r\n See https://github.com/appium/appium/issues/15807")]
public void CloseApp() => ((IExecuteMethod)this).Execute(AppiumDriverCommand.CloseApp);
[Obsolete("The ResetApp API is deprecated and will be removed in future versions. Please use TerminateApp & ActivateApp instead \r\n See https://github.com/appium/appium/issues/15807")]
public void ResetApp() => ((IExecuteMethod)this).Execute(AppiumDriverCommand.ResetApp);

public void FingerPrint(int fingerprintId) =>
AppiumCommandExecutionHelper.FingerPrint(this, fingerprintId);
Expand Down
5 changes: 0 additions & 5 deletions src/Appium.Net/Appium/AppiumDriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ public class AppiumDriverCommand
/// </summary>
public const string CloseApp = "closeApp";

/// <summary>
/// Reset App Command.
/// </summary>
public const string ResetApp = "resetApp";

#endregion (Deprecated) legacy app management

/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions src/Appium.Net/Appium/Interfaces/IInteractsWithApps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ public interface IInteractsWithApps : IExecuteMethod
/// <return>a boolean indicating if the app is installed.</return>
bool IsAppInstalled(string bundleId);

/// <summary>
/// Resets the current app.
/// </summary>
void ResetApp();

/// <summary>
/// Deactivates app completely (as "Home" button does).
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion test/integration/Android/Device/KeyPressTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public void BeforeAll()
[SetUp]
public void SetUp()
{
_driver?.ResetApp();
string appId = Apps.GetId(Apps.androidApiDemos);
_driver.TerminateApp(appId);
_driver.ActivateApp(appId);
}

[OneTimeTearDown]
Expand Down
26 changes: 17 additions & 9 deletions test/integration/helpers/Apps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ public class Apps
{
private static bool _isInited;
private static Dictionary<string, string> _testApps;

private static string _testAppsDir = $"{AppDomain.CurrentDomain.BaseDirectory}..//..//..//apps";
private static readonly Dictionary<string, string> _testAppsIds = new Dictionary<string, string>
{
{androidApiDemos, "io.appium.android.apis"},
{iosTestApp, "io.appium.TestApp"},
{iosUICatalogApp, "com.example.apple-samplecode.UICatalog" }
};

private static void Init()
{
Expand Down Expand Up @@ -39,8 +43,6 @@ private static void Init()





_testApps = new Dictionary<string, string>
{
{iosTestApp, new FileInfo($"{Path.GetTempPath()}/TestApp.app.zip").FullName},
Expand All @@ -61,10 +63,16 @@ public static string Get(string appKey)
return _testApps[appKey];
}

public static string iosTestApp = "iosTestApp";
public static string iosWebviewApp = "iosWebviewApp";
public static string iosUICatalogApp = "iosUICatalogApp";
public static string androidApiDemos = "androidApiDemos";
public static string vodqaApp = "vodqaApp";
public static string GetId(string appKey)
{
return _testAppsIds[appKey];
}

public const string iosTestApp = "iosTestApp";
public const string iosWebviewApp = "iosWebviewApp";
public const string iosUICatalogApp = "iosUICatalogApp";
public const string androidApiDemos = "androidApiDemos";
public const string vodqaApp = "vodqaApp";

}
}

0 comments on commit 37f3b0b

Please sign in to comment.