appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
49 lines • 3.35 kB
TypeScript
import type { XCUITestDriver } from '../driver';
import type { CertificateList } from './types';
/**
* Parses the common name of the certificate from the given string.
*/
export declare function parseCommonName(stringCertificate: string): string;
/**
* Installs a custom certificate onto the device.
*
* Since Xcode SDK 11.4, Apple has added a dedicated `simctl` subcommand to quickly handle
* certificates on Simulator over CLI.
*
* On real devices (or simulators before Xcode SDK 11.4), Apple provides no "official" way to do this via the command line. In such a case (and also as a fallback if CLI setup fails), this method tries to wrap the certificate into `.mobileconfig` format, then deploys the wrapped file to the internal HTTP server so that it can be opened via mobile Safari. This command then goes through the profile installation procedure by clicking the necessary buttons using WebDriverAgent.
* @param content - Base64-encoded content of the public certificate in [PEM](https://knowledge.digicert.com/quovadis/ssl-certificates/ssl-general-topics/what-is-pem-format.html) format
* @param commonName - Common name of the certificate. If this is not set, the command will try to parse it from the provided `content`.
* @param isRoot - Defines where the certificate should be installed; either the Trusted Root Store (`true`) or the Keychain (`false`). On environments other than Xcode 11.4+ Simulator, this option is ignored.
* @returns The content of the generated `.mobileconfig` file as
* a base64-encoded string. This config might be useful for debugging purposes. If the certificate has been successfully set via CLI, then nothing is returned.
*/
export declare function mobileInstallCertificate(this: XCUITestDriver, content: string, commonName?: string, isRoot?: boolean): Promise<string | void>;
/**
* Removes installed certificates.
*
* Requires a real device running iOS/tvOS 18+ with the optional appium-ios-remotexpc package.
*
* @since 4.19.2
* @param name - Name of the profile
* @returns Status acknowledgment when the certificate is successfully removed
* @throws {Error} If attempting to remove certificates for a simulated device or if RemoteXPC setup fails
* @group Real Device Only
*/
export declare function mobileRemoveCertificate(this: XCUITestDriver, name: string): Promise<string>;
/**
* Returns map of certificates installed on the real device.
*
* Requires a real device running iOS/tvOS 18+ with the optional appium-ios-remotexpc package.
* @since 4.10.0
* @returns An object describing the certificates installed on the real device.
* @throws {Error} If attempting to list certificates for a simulated device or if RemoteXPC setup fails
*/
export declare function mobileListCertificates(this: XCUITestDriver): Promise<CertificateList>;
/**
* Installs PEM content from `appium:customSSLCert` on the paired real device (session startup).
* On iOS/tvOS 18+ this requires `appium-ios-remotexpc` (same RemoteXPC certificate client as mobile
* certificate commands); setup throws if RemoteXPC is unavailable or iOS version is less than 18.
* `start()` has already set `platformVersion` from the device when the capability was omitted.
*/
export declare function installCustomSslCertFromCapability(this: XCUITestDriver): Promise<void>;
//# sourceMappingURL=certificate.d.ts.map