diff --git a/CHANGELOG.md b/CHANGELOG.md index 76bf8454..cf398365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ Release tags are https://github.com/appium/ruby_lib/releases . ## Unreleased ### 1. Enhancements +- add `mobile: installCertificate` shortcut for XCUITest +- add `mobile: getContexts` shortcut for XCUITest ### 2. Bug fixes diff --git a/lib/appium_lib/ios/xcuitest/command/certificate.rb b/lib/appium_lib/ios/xcuitest/command/certificate.rb new file mode 100644 index 00000000..796c95e6 --- /dev/null +++ b/lib/appium_lib/ios/xcuitest/command/certificate.rb @@ -0,0 +1,26 @@ +require 'base64' + +module Appium + module Ios + module Xcuitest + module Certificate + # Generates Apple's over-the-air configuration profile for certificate deployment + # based on the given PEM certificate content. + # https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/Introduction/Introduction.html + # https://github.com/appium/appium-xcuitest-driver/pull/652 + # + # @param [string] cer_file The content of the certificate file. + # + # @example + # + # install_certificate cer_file: "path/to/cert.cer" + # + def install_certificate(cer_file:) + args = { content: Base64.encode64(cer_file) } + + @driver.execute_script 'mobile: installCertificate', args + end + end + end # module Xcuitest + end # module Ios +end # module Appium