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):
50
50
LOCK = 'lock'
51
51
SHAKE = 'shake'
52
52
TOUCH_ID = 'touchId'
53
+ TOGGLE_TOUCH_ID_ENROLLMENT = 'toggleTouchIdEnrollment'
53
54
RESET = 'reset'
54
55
HIDE_KEYBOARD = 'hideKeyboard'
55
56
REPLACE_KEYS = 'replaceKeys'
Original file line number Diff line number Diff line change @@ -630,14 +630,20 @@ def shake(self):
630
630
return self
631
631
632
632
def touch_id (self , match ):
633
- """Do a fingerprint scan
633
+ """Simulate touchId on iOS Simulator
634
634
"""
635
635
data = {
636
636
'match' : match
637
637
}
638
638
self .execute (Command .TOUCH_ID , data )
639
639
return self
640
640
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
+
641
647
def open_notifications (self ):
642
648
"""Open notification shade in Android (API Level 18 and above)
643
649
"""
@@ -818,6 +824,8 @@ def _addCommands(self):
818
824
('POST' , '/session/$sessionId/appium/device/shake' )
819
825
self .command_executor ._commands [Command .TOUCH_ID ] = \
820
826
('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' )
821
829
self .command_executor ._commands [Command .RESET ] = \
822
830
('POST' , '/session/$sessionId/appium/app/reset' )
823
831
self .command_executor ._commands [Command .HIDE_KEYBOARD ] = \
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ def setUp(self):
28
28
29
29
def tearDown (self ):
30
30
self .driver .quit ()
31
+
31
32
def test_lock (self ):
32
33
el = self .driver .find_element_by_id ('ButtonsExplain' )
33
34
self .assertIsNotNone (el )
@@ -43,12 +44,15 @@ def test_shake(self):
43
44
# what can we assert about this?
44
45
self .driver .shake ()
45
46
46
-
47
47
def test_touch_id (self ):
48
48
# nothing to assert, just verify that it doesn't blow up
49
49
self .driver .touch_id (True )
50
50
self .driver .touch_id (False )
51
51
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
+
52
56
def test_hide_keyboard (self ):
53
57
el = self .driver .find_element_by_name ('TextFields, Uses of UITextField' )
54
58
el .click ()
Original file line number Diff line number Diff line change @@ -23,9 +23,10 @@ def get_desired_capabilities(app):
23
23
desired_caps = {
24
24
'deviceName' : 'iPhone 5s' ,
25
25
'platformName' : 'iOS' ,
26
- 'platformVersion' : '10.1 ' ,
26
+ 'platformVersion' : '10.2 ' ,
27
27
'app' : PATH ('../../apps/' + app ),
28
- 'automationName' : 'XCUITest'
28
+ 'automationName' : 'XCUITest' ,
29
+ 'allowTouchIdEnroll' : True
29
30
}
30
31
31
32
return desired_caps
You can’t perform that action at this time.
0 commit comments