Conversation
|
@imurchie It's not as heavy as it looks, most of the files are assets from an ios app that was added to |
|
FYI, the Travis failure is happening because it's using a method that hasn't been published to |
|
@imurchie Do you have a chance to review this? |
imurchie
left a comment
There was a problem hiding this comment.
A couple of small style comments. Otherwise looks good.
If you don't want this to get stale, you could monkeypatch the wd object with the method, and then make a ticket to undo it when someone gets around to updating and publishing a new wd package.
| return await this.proxyCommand('/wda/touch_id', 'POST', params); | ||
| if (this.isSimulator()) { | ||
| return await this.proxyCommand('/wda/touch_id', 'POST', {match}); | ||
| } else { |
There was a problem hiding this comment.
I'd rather this be reversed, so we get out in the conditional, and then work outside of it.
if (!this.isSimulator()) {
throw new errors.UnknownError('Touch ID simulation not supported on real devices');
}
return await this.proxyCommand('/wda/touch_id', 'POST', {match});| * Toggle enrollment of touchId (Simuulator only) | ||
| */ | ||
| commands.toggleEnrollTouchId = async function () { | ||
| if (!this.opts.allowTouchIdEnroll) { |
There was a problem hiding this comment.
Same thing here. Also I'm not a big fan of the mixed conditional, if only because it makes the code harder to reason about. We have two errors conditions, and then the real deal.
if (!this.opts.allowTouchIdEnroll) {
throw new errors.UnknownError(`Must set desired capability 'allowTouchIdEnroll = true' to enroll touchId`);
}
if (!this.isSimulator()) {
throw new errors.UnknownError('Touch ID simulation not supported on real devices');
}
await this.opts.device.enrollTouchID();0453b14 to
9eb3e76
Compare
* Added unit tests that verify that enrollTouchID is called when it is a Simulator and that it is not called on real devices * Added a sample IOS app that uses TouchID to directory: `test/assets` * Added e2e tests that use the sample app to test calls to enroll/unroll and `/wda/touch_id` * Added desired cap that allows touchId enroll `allowTouchIdEnroll` * If cap is true, allow calls to toggleTouchIdEnroll * If false, calling toggleTouchIdEnroll throws exception * Added tests that check that it throws exception if `allowTouchIdEnroll` not true and tries enrolling
691ea22 to
3736e59
Compare
|
Published to v2.24.0 |
test/assets/wda/touch_idallowTouchIdEnrollallowTouchIdEnrollnot true and tries enrolling