-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix driver responses #10
Changes from all commits
b147838
a27357a
1ecd96f
8dfcf5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ protected override string DoImpl() | |
{ | ||
this.Automator.Deployer.Uninstall(); | ||
|
||
return null; | ||
return this.JsonResponse(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Аналогично |
||
} | ||
|
||
#endregion | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,9 @@ public string Do() | |
} | ||
catch (NotImplementedException exception) | ||
{ | ||
return HttpResponseHelper.ResponseString(HttpStatusCode.NotImplemented, exception.Message); | ||
return HttpResponseHelper.ResponseString( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Надо посмотреть как это будет в тестах выглядеть, например, на питоне, т.к. до этого unimplemented там работал There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Traceback одинаков, сообщение пробрасывается одинаково |
||
HttpStatusCode.NotImplemented, | ||
this.JsonResponse(ResponseStatus.UnknownCommand, exception.Message)); | ||
} | ||
catch (Exception exception) | ||
{ | ||
|
@@ -70,6 +72,14 @@ protected virtual string DoImpl() | |
throw new InvalidOperationException("DoImpl should never be called in CommandExecutorBase"); | ||
} | ||
|
||
/// <summary> | ||
/// The JsonResponse with SUCCESS status and NULL value. | ||
/// </summary> | ||
protected string JsonResponse() | ||
{ | ||
return this.JsonResponse(ResponseStatus.Success, null); | ||
} | ||
|
||
protected string JsonResponse(ResponseStatus status, object value) | ||
{ | ||
return JsonConvert.SerializeObject(new JsonResponse(this.Automator.Session, status, value)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
namespace WindowsUniversalAppDriver.CommandExecutors | ||
{ | ||
using WindowsUniversalAppDriver.Common; | ||
|
||
internal class ScreenshotExecutor : CommandExecutorBase | ||
{ | ||
#region Methods | ||
|
||
protected override string DoImpl() | ||
{ | ||
return this.Automator.EmulatorController.TakeScreenshot(); | ||
var base64Screenshot = this.Automator.EmulatorController.TakeScreenshot(); | ||
return this.JsonResponse(ResponseStatus.Success, base64Screenshot); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Протестировать, что в питоне ничего не сломалось, до этого ведь там как-то все работало There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. все ок. питон биндинги работают видимо именно так, как ты и предполагал |
||
} | ||
|
||
#endregion | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему тут ответ без параметров, а выше всегда с параметрами Success и null?