appium-xcuitest-driver
Version:
Appium driver for iOS using XCUITest for backend
45 lines • 3.04 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.
*
* This only works _if and only if_ `py-ios-device` is installed on the same machine Appium is running on.
*
* @see https://github.com/YueChen-C/py-ios-device
* @since 4.19.2
* @param name - Name of the profile
* @returns Status acknowledgment if
* the certificate is successfully removed or 'None' (forwards pyidevice output)
* @throws {Error} If attempting to remove certificates for a simulated device or if `py-ios-device` is not installed
* @group Real Device Only
*/
export declare function mobileRemoveCertificate(this: XCUITestDriver, name: string): Promise<string>;
/**
* Returns map of certificates installed on the real device.
*
* This only works _if and only if_ `py-ios-device` is installed on the same machine Appium is running on.
* @since 4.10.0
* @see https://github.com/YueChen-C/py-ios-device
* @returns An object describing the certificates installed on the real device.
* @throws {Error} If attempting to list certificates for a simulated device or if `py-ios-device` is not installed
*/
export declare function mobileListCertificates(this: XCUITestDriver): Promise<CertificateList>;
//# sourceMappingURL=certificate.d.ts.map