File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff 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'
Original file line number Diff line number Diff 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 ] = \
Original file line number Diff line number Diff 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 ()
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments