Skip to content

Commit 4ae0815

Browse files
authored
Add toggle touch id enrollment (#521)
1 parent c652bb3 commit 4ae0815

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

ios_tests/lib/ios/specs/common/command.rb

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def before_first
3636
Selenium::WebDriver::Remote::Bridge.method_defined?(:pull_file).must_equal true
3737
Selenium::WebDriver::Remote::Bridge.method_defined?(:pull_folder).must_equal true
3838
Selenium::WebDriver::Remote::Bridge.method_defined?(:touch_id).must_equal true
39+
Selenium::WebDriver::Remote::Bridge.method_defined?(:toggle_touch_id_enrollment).must_equal true
3940
Selenium::WebDriver::Remote::Bridge.method_defined?(:get_settings).must_equal true
4041
Selenium::WebDriver::Remote::Bridge.method_defined?(:update_settings).must_equal true
4142
Selenium::WebDriver::Remote::Bridge.method_defined?(:touch_actions).must_equal true

lib/appium_lib/common/command.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ module Commands
5353
get_performance_data: [:post, 'session/:session_id/appium/getPerformanceData'.freeze],
5454

5555
# iOS
56-
touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'.freeze]
56+
touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'.freeze],
57+
toggle_touch_id_enrollment: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment'.freeze]
5758
}.merge(COMMAND_NO_ARG).merge(::Selenium::WebDriver::Remote::Bridge::COMMANDS).freeze
5859
end
5960
end

lib/appium_lib/device/device.rb

+10
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ module Device
114114
# touch_id false #=> Simulate invalid fingerprint
115115
# ```
116116

117+
# @!method toggle_touch_id_enrollment
118+
# iOS Simulator only: Toggle touch id enrollment on an iOS Simulator.
119+
117120
# @!method end_coverage
118121
# Android only; Ends the test coverage and writes the results to the given path on device.
119122
# @param [String] path Path on the device to write too.
@@ -339,6 +342,13 @@ def touch_id(match = true)
339342
end
340343
end
341344

345+
# TODO: TEST ME
346+
add_endpoint_method(:toggle_touch_id_enrollment) do
347+
def toggle_touch_id_enrollment
348+
execute :toggle_touch_id_enrollment, {}
349+
end
350+
end
351+
342352
# TODO: TEST ME
343353
add_endpoint_method(:end_coverage) do
344354
def end_coverage(path, intent)

0 commit comments

Comments
 (0)