How to use the appium-ios-driver.settings.setLocaleAndPreferences function in appium-ios-driver

To help you get started, we’ve selected a few appium-ios-driver 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
if (this.isSimulator()) {
      if (this.opts.shutdownOtherSimulators) {
        this.ensureFeatureEnabled(SHUTDOWN_OTHER_FEAT_NAME);
        await shutdownOtherSimulators(this.opts.device);
      }

      // this should be done before the simulator is started
      // if it is already running, this cap won't work, which is documented
      if (this.isSafari() && this.opts.safariGlobalPreferences) {
        if (await this.opts.device.updateSafariGlobalSettings(this.opts.safariGlobalPreferences)) {
          log.debug(`Safari global preferences updated`);
        }
      }

      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);
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());
      });