admc / wd

A node.js client for webdriver/selenium 2.
Other
1.53k stars 402 forks source link

toggleTouchIdEnrollmentCommand does not toggle to disabled state #486

Open chickenbeef opened 6 years ago

chickenbeef commented 6 years ago

Hi,

Is there any chance you'll be including the toggleTouchIdEnrollmentCommand from Appium?

It's currently in beta and I noticed it was added to the java client.

https://github.com/appium/java-client/blob/6f3351dfa0b77ec7d3997ef5ac935f26e4b63e10/src/main/java/io/appium/java_client/ios/IOSMobileCommandHelper.java

chickenbeef commented 6 years ago

Okay, got it working to enable touchID enrollment with 1.4.1 but it doesn't toggle it to the "off" state.

I think it should pass in a boolean parameter?

https://github.com/appium/java-client/commit/6f3351dfa0b77ec7d3997ef5ac935f26e4b63e10

chickenbeef commented 6 years ago

I made the following change to command.js but the data is not being POSTed to the Appium server (Only the session ID is being sent through). Something tells me there is a bit more to it and I'm missing something small, any pointers? Then I can submit a PR and be off your case 😄

commands.toggleTouchIdEnrollment = function(){
  var fargs = utils.varargs(arguments);
  var cb = fargs.callback;
  enabled = fargs.all[0];
  this._jsonWireCall({
    method: 'POST'
    , relPath: '/appium/simulator/toggle_touch_id_enrollment'
    , cb: callbackWithData(cb, this)
    , data: { enabled: enabled }
  });
};