-
-
Notifications
You must be signed in to change notification settings - Fork 422
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 all XCTest gestures available for "mobile:" interface #393
Conversation
@sergey-plevako-badoo this is not exactly what you wanted to implement in #170, but should work as well. |
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.
a style comment but otherwise looks good. sad, but good :-)
lib/commands/gesture.js
Outdated
scale: parseFloatParameter('scale', opts.scale, 'pinch'), | ||
velocity: parseFloatParameter('velocity', opts.velocity, 'pinch') | ||
}; | ||
const el = opts.element.ELEMENT ? opts.element.ELEMENT : opts.element; |
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 pattern can be more succinctly written as:
const el = opts.element.ELEMENT || opts.element;
a739b24
to
4753d3a
Compare
Fixed review comments and squashed the stuff |
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.
Seems good. Tests would be nice, at some point.
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.
LGTM now, one question about return
lib/commands/execute.js
Outdated
} | ||
await mobileCommandsMapping[mobileCommand](opts); |
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.
wonder whether this actually needs to be return await
in order to ensure that if WDA has any kind of return value it is passed back to the client?
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 know the current behavior also doesn't have return
but it seems like that could be missing. however none of the proxy commands have return
so we'd have to make this change everywhere if we cared about it.
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.
piece of cake :)
Added return
lib/commands/gesture.js
Outdated
velocity: parseFloatParameter('velocity', opts.velocity, 'pinch') | ||
}; | ||
const el = opts.element.ELEMENT || opts.element; | ||
await this.proxyCommand(`/wda/element/${el}/pinch`, 'POST', params); |
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.
awesome, however what i was subsequently reflecting on is that we'd need to have a return
here, and in each other instance of proxyCommand
inside a mobile
method as well, if we want the outer return
you just added to mean anything :-)
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.
still simple ;)
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.
you are a gentlehuman and a scholar 🎩
That's the spirit! 🙇 May we find some way to cultivate more contributors like you :-) |
c2cf01d
to
9d4732f
Compare
Looks good! |
This PR makes all XCTest gestures available for calling via mobile: interface, so one can use them even without specialised wrappers in top-level drivers. This is just a POC, so I didn't create any tests yet. Please kindly check the basic implementation first.