Skip to content

Commit 6f52e48

Browse files
committed
Add toggleTouchIdEnrollment
1 parent b86dbbd commit 6f52e48

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

appium/webdriver/mobilecommand.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class MobileCommand(object):
5050
LOCK = 'lock'
5151
SHAKE = 'shake'
5252
TOUCH_ID = 'touchId'
53+
TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'
5354
RESET = 'reset'
5455
HIDE_KEYBOARD = 'hideKeyboard'
5556
REPLACE_KEYS = 'replaceKeys'

appium/webdriver/webdriver.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,14 +630,20 @@ def shake(self):
630630
return self
631631

632632
def touch_id(self, match):
633-
"""Do a fingerprint scan
633+
"""Simulate touchId on iOS Simulator
634634
"""
635635
data = {
636636
'match': match
637637
}
638638
self.execute(Command.TOUCH_ID, data)
639639
return self
640640

641+
def toggle_touch_id_enrollment(self):
642+
"""Toggle enroll touchId on iOS Simulator
643+
"""
644+
self.execute(Command.TOGGLE_TOUCH_ID_ENROLLMENT)
645+
return self
646+
641647
def open_notifications(self):
642648
"""Open notification shade in Android (API Level 18 and above)
643649
"""
@@ -818,6 +824,8 @@ def _addCommands(self):
818824
('POST', '/session/$sessionId/appium/device/shake')
819825
self.command_executor._commands[Command.TOUCH_ID] = \
820826
('POST', '/session/$sessionId/appium/simulator/touch_id')
827+
self.command_executor._commands[Command.TOGGLE_TOUCH_ID_ENROLLMENT] = \
828+
('POST', '/session/$sessionId/appium/simulator/toggle_touch_id_enrollment')
821829
self.command_executor._commands[Command.RESET] = \
822830
('POST', '/session/$sessionId/appium/app/reset')
823831
self.command_executor._commands[Command.HIDE_KEYBOARD] = \

test/functional/ios/appium_tests.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def setUp(self):
2828

2929
def tearDown(self):
3030
self.driver.quit()
31+
3132
def test_lock(self):
3233
el = self.driver.find_element_by_id('ButtonsExplain')
3334
self.assertIsNotNone(el)
@@ -43,12 +44,15 @@ def test_shake(self):
4344
# what can we assert about this?
4445
self.driver.shake()
4546

46-
4747
def test_touch_id(self):
4848
# nothing to assert, just verify that it doesn't blow up
4949
self.driver.touch_id(True)
5050
self.driver.touch_id(False)
5151

52+
def test_toggle_touch_id_enrollment(self):
53+
# nothing to assert, just verify that it doesn't blow up
54+
self.driver.toggle_touch_id_enrollment()
55+
5256
def test_hide_keyboard(self):
5357
el = self.driver.find_element_by_name('TextFields, Uses of UITextField')
5458
el.click()

test/functional/ios/desired_capabilities.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ def get_desired_capabilities(app):
2323
desired_caps = {
2424
'deviceName': 'iPhone 5s',
2525
'platformName': 'iOS',
26-
'platformVersion': '10.1',
26+
'platformVersion': '10.2',
2727
'app': PATH('../../apps/' + app),
28-
'automationName': 'XCUITest'
28+
'automationName': 'XCUITest',
29+
'allowTouchIdEnroll': True
2930
}
3031

3132
return desired_caps

0 commit comments

Comments
 (0)