Skip to content

Commit

Permalink
Merge pull request #13 from 2gis/add-quit-command
Browse files Browse the repository at this point in the history
Add quit command
  • Loading branch information
skyline-gleb committed Mar 4, 2015
2 parents 73efc27 + 93027a9 commit 8d84fbe
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ internal class CloseExecutor : CommandExecutorBase

protected override string DoImpl()
{
this.Automator.Deployer.Uninstall();
if (!this.Automator.ActualCapabilities.DebugConnectToRunningApp)
{
// TODO close should only close app, not uninstall
this.Automator.Deployer.Uninstall();
}

return this.JsonResponse();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace WindowsUniversalAppDriver.CommandExecutors
{
internal class QuitExecutor : CommandExecutorBase
{
#region Methods

protected override string DoImpl()
{
if (!this.Automator.ActualCapabilities.DebugConnectToRunningApp)
{
// TODO quit should close all open windows (apps) and possible close the emulator
this.Automator.Deployer.Uninstall();
}


return this.JsonResponse();
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,14 @@ public void Terminate()

public void Uninstall()
{
if (this.application == null)
{
Logger.Debug("Could not uninstall application that is already uninstalled.");
return;
}

this.application.Uninstall();
this.application = null;
}

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<Compile Include="CommandExecutors\MouseMoveToExecutor.cs" />
<Compile Include="CommandExecutors\MouseUpExecutor.cs" />
<Compile Include="CommandExecutors\NewSessionExecutor.cs" />
<Compile Include="CommandExecutors\QuitExecuter.cs" />
<Compile Include="CommandExecutors\ScreenshotExecutor.cs" />
<Compile Include="CommandExecutors\SendKeysToElementExecutor.cs" />
<Compile Include="CommandExecutors\TouchFlickExecutor.cs" />
Expand Down

0 comments on commit 8d84fbe

Please sign in to comment.