Skip to content

Commit

Permalink
feat: Bring back LaunchApp to WindowsDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
Dor-bl committed Aug 3, 2024
1 parent c15a2c2 commit e2da45a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Appium.Net/Appium/AppiumCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ public class AppiumCommand
new AppiumCommand(HttpCommandInfo.PostCommand, WindowsDriverCommand.CloseApp,
"/session/{sessionId}/appium/app/close"),

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

#endregion (WinAppDriver) legacy app management

new AppiumCommand(HttpCommandInfo.PostCommand, AppiumDriverCommand.BackgroundApp,
Expand Down
11 changes: 11 additions & 0 deletions src/Appium.Net/Appium/Windows/WindowsDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,22 @@ public void LongPressKeyCode(int keyCode, int metastate = -1) =>

#region App management

/// <summary>
/// Closes the Windows application.
/// </summary>
public void CloseApp()
{
((IExecuteMethod)this).Execute(WindowsDriverCommand.CloseApp);
}

/// <summary>
/// Launches the Windows application.
/// </summary>
public void LaunchApp()
{
((IExecuteMethod)this).Execute(WindowsDriverCommand.LaunchApp);
}

#endregion App management
}
}
8 changes: 8 additions & 0 deletions src/Appium.Net/Appium/Windows/WindowsDriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace OpenQA.Selenium.Appium
{
/// <summary>
/// Provides command constants specific to Windows applications.
/// </summary>
public class WindowsDriverCommand
{

Expand All @@ -24,6 +27,11 @@ public class WindowsDriverCommand
/// </summary>
public const string CloseApp = "closeApp";

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

#endregion legacy app management

}
Expand Down

0 comments on commit e2da45a

Please sign in to comment.