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

feat: Bring back LaunchApp to WindowsDriver #813

Merged
merged 1 commit into from
Aug 4, 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
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