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

chore: Remove deprecated LaunchApp #766

Merged
merged 1 commit into from
Mar 30, 2024
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
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,

Choose a reason for hiding this comment

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

close has also been removed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will be removed on a separate PR.

"/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