How to use the appium-ios-simulator.hasSSLCert function in appium-ios-simulator

To help you get started, we’ve selected a few appium-ios-simulator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-xcuitest-driver / lib / driver.js View on Github external
}
      }

      this.localConfig = await iosSettings.setLocaleAndPreferences(this.opts.device, this.opts, this.isSafari(), async (sim) => {
        await shutdownSimulator(sim);

        // we don't know if there needs to be changes a priori, so change first.
        // sometimes the shutdown process changes the settings, so reset them,
        // knowing that the sim is already shut
        await iosSettings.setLocaleAndPreferences(sim, this.opts, this.isSafari());
      });

      await this.startSim();

      if (this.opts.customSSLCert) {
        if (await hasSSLCert(this.opts.customSSLCert, this.opts.udid)) {
          log.info(`SSL cert '${_.truncate(this.opts.customSSLCert, {length: 20})}' already installed`);
        } else {
          log.info(`Installing ssl cert '${_.truncate(this.opts.customSSLCert, {length: 20})}'`);
          await shutdownSimulator(this.opts.device);
          await installSSLCert(this.opts.customSSLCert, this.opts.udid);
          log.info(`Restarting Simulator so that SSL certificate installation takes effect`);
          await this.startSim();
          this.logEvent('customCertInstalled');
        }
      }
      if (this.opts.launchWithIDB && this.isSimulator()) {
        try {
          const idb = new IDB({udid});
          await idb.connect();
          this.opts.device.idb = idb;
        } catch (e) {