Skip to content

Commit

Permalink
chore: Remove deprecated LaunchApp (appium#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dor-bl authored Mar 30, 2024
1 parent 12e87ac commit 264bb2b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 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 @@ -115,8 +115,6 @@ public class AppiumCommand

#region (Deprecated) legacy app management

new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.LaunchApp,
"/session/{sessionId}/appium/app/launch"),
new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.CloseApp,
"/session/{sessionId}/appium/app/close"),

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 @@ -182,8 +182,6 @@ public void PushFile(string pathOnDevice, byte[] base64Data) =>
public void PushFile(string pathOnDevice, FileInfo file) =>
AppiumCommandExecutionHelper.PushFile(this, pathOnDevice, file);

[Obsolete("The LaunchApp API is deprecated and will be removed in future versions. Please use ActivateApp instead \r\n See https://github.com/appium/appium/issues/15807")]
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);

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 @@ -140,11 +140,6 @@ public class AppiumDriverCommand

#region (Deprecated) legacy app management

/// <summary>
/// Launch App Command.
/// </summary>
public const string LaunchApp = "launchApp";

/// <summary>
/// Close App Command.
/// </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 @@ -25,11 +25,6 @@ public interface IInteractsWithApps : IExecuteMethod
/// <param name="appPath">a string containing the file path or url of the app.</param>
void InstallApp(string appPath);

/// <summary>
/// Launches the current app.
/// </summary>
void LaunchApp();

/// <summary>
/// Checks If an App Is Installed.
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions src/Appium.Net/Appium/Windows/WindowsDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ public void LongPressKeyCode(int keyCode, int metastate = -1) =>

#region App management

public new void LaunchApp()
{
((IExecuteMethod)this).Execute(AppiumDriverCommand.LaunchApp);
}

public new void CloseApp()
{
((IExecuteMethod)this).Execute(AppiumDriverCommand.CloseApp);
Expand Down
8 changes: 5 additions & 3 deletions test/integration/Android/Device/AuthenticationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ namespace Appium.Net.Integration.Tests.Android.Device
public class AuthenticationTest
{
private AndroidDriver _driver;
private readonly string appID = Apps.androidApiDemos;

[OneTimeSetUp]
public void BeforeAll()
{
var capabilities = Caps.GetAndroidUIAutomatorCaps(Apps.Get("androidApiDemos"));

var capabilities = Caps.GetAndroidUIAutomatorCaps(Apps.Get(appID));
capabilities.AddAdditionalAppiumOption(MobileCapabilityType.FullReset, true);
var serverUri = Env.ServerIsRemote() ? AppiumServers.RemoteServerUri : AppiumServers.LocalServiceUri;
_driver = new AndroidDriver(serverUri, capabilities, Env.InitTimeoutSec);
Expand All @@ -22,13 +24,13 @@ public void BeforeAll()
[SetUp]
public void SetUp()
{
_driver?.LaunchApp();
_driver?.ActivateApp(Apps.GetId(appID));
}

[OneTimeTearDown]
public void OneTimeTearDown()
{
_driver?.CloseApp();
_ = (_driver?.TerminateApp(Apps.GetId(appID)));
_driver?.Quit();
}

Expand Down

0 comments on commit 264bb2b

Please sign in to comment.