From d04fde5fd7fbb8b2ec6b62cee5cd4c5fb4b934de Mon Sep 17 00:00:00 2001 From: Dan Graham Date: Thu, 23 Mar 2017 14:56:47 -0700 Subject: [PATCH 1/4] Add toggleTouchIdEnrollment --- docs/android_docs.md | 4 ++-- docs/ios_docs.md | 2 +- ios_tests/lib/ios/specs/common/command.rb | 1 + lib/appium_lib/common/command.rb | 1 + lib/appium_lib/device/device.rb | 10 ++++++++++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/android_docs.md b/docs/android_docs.md index bf51da56..f309c1f2 100644 --- a/docs/android_docs.md +++ b/docs/android_docs.md @@ -963,7 +963,7 @@ __Parameters:__ > def touch_id -iOS only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. +iOS Simulator only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. ```ruby touch_id true #=> Simulate valid fingerprint touch_id false #=> Simulate invalid fingerprint @@ -976,7 +976,7 @@ Defaults to true. -- -##### [end_coverage](https://github.com/appium/ruby_lib/blob/11cdf97bf9c4a90ac4e7c7dcf518cfb3fcd99ef2/lib/appium_lib/device/device.rb#L117) +##### [end_coverage](https://github.com/appium/ruby_lib/blob/11cdf97bf9c4a90ac4e7c7dcf518cfb3fcd99ef2/lib/appium_lib/device/device.rb#L117) > def end_coverage diff --git a/docs/ios_docs.md b/docs/ios_docs.md index 03bb81ca..283d52a3 100644 --- a/docs/ios_docs.md +++ b/docs/ios_docs.md @@ -963,7 +963,7 @@ __Parameters:__ > def touch_id -iOS only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. +iOS Simulator only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. ```ruby touch_id true #=> Simulate valid fingerprint touch_id false #=> Simulate invalid fingerprint diff --git a/ios_tests/lib/ios/specs/common/command.rb b/ios_tests/lib/ios/specs/common/command.rb index 2f79f791..367419ef 100644 --- a/ios_tests/lib/ios/specs/common/command.rb +++ b/ios_tests/lib/ios/specs/common/command.rb @@ -36,6 +36,7 @@ def before_first Selenium::WebDriver::Remote::Bridge.method_defined?(:pull_file).must_equal true Selenium::WebDriver::Remote::Bridge.method_defined?(:pull_folder).must_equal true Selenium::WebDriver::Remote::Bridge.method_defined?(:touch_id).must_equal true + Selenium::WebDriver::Remote::Bridge.method_defined?(:toggle_touch_id_enrollment).must_equal true Selenium::WebDriver::Remote::Bridge.method_defined?(:get_settings).must_equal true Selenium::WebDriver::Remote::Bridge.method_defined?(:update_settings).must_equal true Selenium::WebDriver::Remote::Bridge.method_defined?(:touch_actions).must_equal true diff --git a/lib/appium_lib/common/command.rb b/lib/appium_lib/common/command.rb index 20694eba..e0c182cf 100644 --- a/lib/appium_lib/common/command.rb +++ b/lib/appium_lib/common/command.rb @@ -54,6 +54,7 @@ module Commands # iOS touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'.freeze] + touch_id: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment'.freeze] }.merge(COMMAND_NO_ARG).merge(::Selenium::WebDriver::Remote::Bridge::COMMANDS).freeze end end diff --git a/lib/appium_lib/device/device.rb b/lib/appium_lib/device/device.rb index 66861044..e0093f20 100644 --- a/lib/appium_lib/device/device.rb +++ b/lib/appium_lib/device/device.rb @@ -114,6 +114,9 @@ module Device # touch_id false #=> Simulate invalid fingerprint # ``` + # @!method toggle_touch_id_enrollment + # iOS Simulator only: Toggle touch id enrollment on an iOS Simulator. + # @!method end_coverage # Android only; Ends the test coverage and writes the results to the given path on device. # @param [String] path Path on the device to write too. @@ -339,6 +342,13 @@ def touch_id(match = true) end end + # TODO: TEST ME + add_endpoint_method(:toggle_touch_id_enrollment) do + def toggle_touch_id_enrollment() + execute :toggle_touch_id_enrollment, {} + end + end + # TODO: TEST ME add_endpoint_method(:end_coverage) do def end_coverage(path, intent) From ff9fcde6092ceaf79a9f4ccb3880e635150caa8d Mon Sep 17 00:00:00 2001 From: Dan Graham Date: Mon, 27 Mar 2017 11:35:02 -0700 Subject: [PATCH 2/4] PR fixes --- docs/android_docs.md | 4 ++-- docs/ios_docs.md | 2 +- lib/appium_lib/common/command.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/android_docs.md b/docs/android_docs.md index f309c1f2..bf51da56 100644 --- a/docs/android_docs.md +++ b/docs/android_docs.md @@ -963,7 +963,7 @@ __Parameters:__ > def touch_id -iOS Simulator only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. +iOS only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. ```ruby touch_id true #=> Simulate valid fingerprint touch_id false #=> Simulate invalid fingerprint @@ -976,7 +976,7 @@ Defaults to true. -- -##### [end_coverage](https://github.com/appium/ruby_lib/blob/11cdf97bf9c4a90ac4e7c7dcf518cfb3fcd99ef2/lib/appium_lib/device/device.rb#L117) +##### [end_coverage](https://github.com/appium/ruby_lib/blob/11cdf97bf9c4a90ac4e7c7dcf518cfb3fcd99ef2/lib/appium_lib/device/device.rb#L117) > def end_coverage diff --git a/docs/ios_docs.md b/docs/ios_docs.md index 283d52a3..03bb81ca 100644 --- a/docs/ios_docs.md +++ b/docs/ios_docs.md @@ -963,7 +963,7 @@ __Parameters:__ > def touch_id -iOS Simulator only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. +iOS only; Simulate Touch ID with either valid (match == true) or invalid (match == false) fingerprint. ```ruby touch_id true #=> Simulate valid fingerprint touch_id false #=> Simulate invalid fingerprint diff --git a/lib/appium_lib/common/command.rb b/lib/appium_lib/common/command.rb index e0c182cf..75a84217 100644 --- a/lib/appium_lib/common/command.rb +++ b/lib/appium_lib/common/command.rb @@ -54,7 +54,7 @@ module Commands # iOS touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'.freeze] - touch_id: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment'.freeze] + toggle_touch_id_enrollment: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment'.freeze] }.merge(COMMAND_NO_ARG).merge(::Selenium::WebDriver::Remote::Bridge::COMMANDS).freeze end end From ba1960efaebb1c3a3a82ab367247f83b65d9d9b6 Mon Sep 17 00:00:00 2001 From: Dan Graham Date: Mon, 27 Mar 2017 17:16:55 -0700 Subject: [PATCH 3/4] PR fix --- lib/appium_lib/device/device.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appium_lib/device/device.rb b/lib/appium_lib/device/device.rb index e0093f20..b45035c7 100644 --- a/lib/appium_lib/device/device.rb +++ b/lib/appium_lib/device/device.rb @@ -344,7 +344,7 @@ def touch_id(match = true) # TODO: TEST ME add_endpoint_method(:toggle_touch_id_enrollment) do - def toggle_touch_id_enrollment() + def toggle_touch_id_enrollment execute :toggle_touch_id_enrollment, {} end end From eecb9d6357dc97dcba9e5b999b8e7d0c8251b4c2 Mon Sep 17 00:00:00 2001 From: Dan Graham Date: Mon, 27 Mar 2017 17:17:34 -0700 Subject: [PATCH 4/4] PR fix --- lib/appium_lib/common/command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appium_lib/common/command.rb b/lib/appium_lib/common/command.rb index 75a84217..58724630 100644 --- a/lib/appium_lib/common/command.rb +++ b/lib/appium_lib/common/command.rb @@ -53,7 +53,7 @@ module Commands get_performance_data: [:post, 'session/:session_id/appium/getPerformanceData'.freeze], # iOS - touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'.freeze] + touch_id: [:post, 'session/:session_id/appium/simulator/touch_id'.freeze], toggle_touch_id_enrollment: [:post, 'session/:session_id/appium/simulator/toggle_touch_id_enrollment'.freeze] }.merge(COMMAND_NO_ARG).merge(::Selenium::WebDriver::Remote::Bridge::COMMANDS).freeze end