Skip to content

Commit 23bf449

Browse files
authored
add install certificate (#789)
* add install certificate * append docstring * update changelog
1 parent 3791c86 commit 23bf449

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Release tags are https://github.com/appium/ruby_lib/releases .
55

66
## Unreleased
77
### 1. Enhancements
8+
- add `mobile: installCertificate` shortcut for XCUITest
9+
- add `mobile: getContexts` shortcut for XCUITest
810

911
### 2. Bug fixes
1012

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
require 'base64'
2+
3+
module Appium
4+
module Ios
5+
module Xcuitest
6+
module Certificate
7+
# Generates Apple's over-the-air configuration profile for certificate deployment
8+
# based on the given PEM certificate content.
9+
# https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/Introduction/Introduction.html
10+
# https://github.com/appium/appium-xcuitest-driver/pull/652
11+
#
12+
# @param [string] cer_file The content of the certificate file.
13+
#
14+
# @example
15+
#
16+
# install_certificate cer_file: "path/to/cert.cer"
17+
#
18+
def install_certificate(cer_file:)
19+
args = { content: Base64.encode64(cer_file) }
20+
21+
@driver.execute_script 'mobile: installCertificate', args
22+
end
23+
end
24+
end # module Xcuitest
25+
end # module Ios
26+
end # module Appium

0 commit comments

Comments
 (0)