-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Validation for response in ff58 #141
Validation for response in ff58 #141
Conversation
679b155
to
460c8ed
Compare
@dylans Yep. One commit was in the wrong email. My bad. Thanks for the help. |
Reopening as it hasn't landed in Leadfoot yet. |
Server.js
Outdated
var responseData = null; | ||
var sessionId = null; | ||
// At least geckodriver 0.19.0 returns the response data in a 'value.capabilities' | ||
// property, whereas Selenium does not. |
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.
Looks like there's a problem with the whitespace lines 369 - 375. I think this code uses spaces to indent whereas the rest of the file uses tabs.
fbd30ab
to
621a650
Compare
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.
The addition of responseData
and sessionId
variables is good, but one possible response structure is no longer handled.
@@ -363,12 +363,19 @@ Server.prototype = { | |||
desiredCapabilities: desiredCapabilities, | |||
requiredCapabilities: requiredCapabilities | |||
}).then(function (response) { | |||
// At least geckodriver 0.15.0 returns the response data in a 'value' property, whereas Selenium does not. | |||
if (response.value && response.value.sessionId) { |
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 case is no longer covered (where the structure would have response.value.sessionId && response.value.value
).
{
value: {
sessionId: 123
value: {
// ...
}
}
}
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.
@jason0x43 Fixed. I think we should be good now. Thanks for catching that.
Server.js
Outdated
var sessionId = null; | ||
// At least geckodriver 0.19.0 returns the response data in a 'value.capabilities' | ||
// property, whereas Selenium does not. | ||
if (!response.sessionId && response.value.capabilities) { |
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.
Rather than check for !response.sessionId
, consider checking for response.value.sessionId && response.value.capabilities
.
5c97ddc
to
32742bc
Compare
32742bc
to
d6a7824
Compare
@jason0x43 The edits have been made. |
Server.js
Outdated
var responseData = null; | ||
var sessionId = null; | ||
// At least geckodriver 0.19.0 returns the response data in a 'value.capabilities' | ||
// property, whereas Selenium does not. |
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.
Somehow my commit to fix the mixed use of tabs and spaces in this and the next few lines was lost with the recent push...
@dylans @jason0x43 I set webstorm up for smart tabs with 4 indentation. I hope this worked. |
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.
Thanks!
Merged in b861870. Thanks! |
Fixes #139