-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make WebdriverIO to support native app testing on Windows with WinAppDriver #4369
Conversation
A workaround for WinAppDriver. For some messages, WinAppDriver doesn't return value when status is 0.
Codecov Report
@@ Coverage Diff @@
## master #4369 +/- ##
==========================================
+ Coverage 99.32% 99.32% +<.01%
==========================================
Files 180 180
Lines 4414 4415 +1
Branches 950 951 +1
==========================================
+ Hits 4384 4385 +1
Misses 27 27
Partials 3 3
Continue to review full report at Codecov.
|
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.
Got some thoughts on it.
Can it break somehow something else? When status is 0 for other drivers except of WinApp?
@@ -22,8 +22,14 @@ export function isSuccessfulResponse (statusCode, body) { | |||
* response contains a body | |||
*/ | |||
if (!body || typeof body.value === 'undefined') { |
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.
I think overall condition can be improved to avoid nested conditions
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.
I thought about that, and my first local copy is in one line.
splitting it to nested condition would make easy to read. Otherwise I have to write test case on it to provide more context.
I have no knowledge about other drivers. |
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.
@@ -22,8 +22,14 @@ export function isSuccessfulResponse (statusCode, body) { | |||
* response contains a body | |||
*/ | |||
if (!body || typeof body.value === 'undefined') { | |||
log.debug('request failed due to missing body') | |||
return false | |||
if (body && body.status === 0) { |
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.
if (body
This will be always be true given that the parent if clause starts with
if (!body
return false | ||
if (body && body.status === 0) { | ||
/** | ||
* A workaround for WinAppDriver. For some messages, WinAppDriver doesn't return value when status is 0. |
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.
This should be fixed in WinAppDriver then. WebdriverIO follows the W3C standard and so should the driver.
Will close this as the issue should rather be fixed in WinAppDriver to follow the protocol rather than here. |
For people who have the same problem, you can workaround the problem by customized webdriver.
|
I do not recommend using this custom |
Proposed changes
WinAppDriver is a service to support Selenium-like UI Test Automation on Windows Applications.
For some message like click, the return message is
{"sessionId":"19C1CE26-1887-4DA1-AD04-521307B5445C","status":0}
which doesn't include value. then WebDriverIO consider it as failed message and will retry.This pullrequest try to consider value is optional when status=0 to workaround WinAppDriver problem.
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/technical-committee