How to use the appium-xcode.getAutomationTraceTemplatePath function in appium-xcode

To help you get started, we’ve selected a few appium-xcode 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-boneyard / appium-instruments / lib / utils.js View on Github external
async function quickLaunch (udid, appPath = path.resolve(__dirname, '..', '..', 'assets', 'TestApp.app')) {
  let traceTemplatePath = await xcode.getAutomationTraceTemplatePath();
  let scriptPath = path.resolve(__dirname, '..', '..', 'assets', 'blank_instruments_test.js');
  let traceDocument = path.resolve('/', 'tmp', 'testTrace.trace');
  let resultsPath = path.resolve('/', 'tmp');

  // the trace document can be in a weird state
  // but we never do anything with it, so delete
  await fs.rimraf(traceDocument);

  let args = ['instruments',
              '-D', traceDocument,
               '-t', traceTemplatePath,
               '-w', udid,
               appPath,
               '-e', 'UIASCRIPT', scriptPath,
               '-e', 'UIARESULTSPATH', resultsPath];
  log.debug(`Running command: 'xcrun ${args.join(' ')}'`);
github appium / appium-ios-driver / lib / instruments / utils.js View on Github external
async function quickLaunch (udid, appPath = path.resolve(__dirname, '..', '..', 'assets', 'TestApp.app')) {
  let traceTemplatePath = await xcode.getAutomationTraceTemplatePath();
  let scriptPath = path.resolve(__dirname, '..', '..', 'assets', 'blank_instruments_test.js');
  let traceDocument = path.resolve('/', 'tmp', 'testTrace.trace');
  let resultsPath = path.resolve('/', 'tmp');

  // the trace document can be in a weird state
  // but we never do anything with it, so delete
  await fs.rimraf(traceDocument);

  let args = [
    'instruments',
    '-D', traceDocument,
    '-t', traceTemplatePath,
    '-w', udid,
    appPath,
    '-e', 'UIASCRIPT', scriptPath,
    '-e', 'UIARESULTSPATH', resultsPath];
github appium-boneyard / appium-instruments / lib / instruments.js View on Github external
async configure () {
    if (!this.xcodeVersion) {
      this.xcodeVersion = await xcode.getVersion(true);
    }
    if (this.xcodeVersion.versionFloat === 6.0 && this.withoutDelay) {
      log.info('In xcode 6.0, instruments-without-delay does not work. ' +
               'If using Appium, you can disable instruments-without-delay ' +
               'with the --native-instruments-lib server flag');
    }
    if (this.xcodeVersion.versionString === '5.0.1') {
      throw new Error('Xcode 5.0.1 ships with a broken version of ' +
                      'Instruments. please upgrade to 5.0.2');
    }

    if (!this.template) {
      this.template = await xcode.getAutomationTraceTemplatePath();
    }

    if (!this.instrumentsPath) {
      this.instrumentsPath = await getInstrumentsPath();
    }
  }
github appium-boneyard / appium-instruments / lib / utils.js View on Github external
async function quickInstruments (opts = {}) {
  opts = _.cloneDeep(opts);
  let xcodeTraceTemplatePath = opts.xcodeTraceTemplatePath ||
      await xcode.getAutomationTraceTemplatePath();
  _.defaults(opts, {
    launchTimeout: 60000,
    template: xcodeTraceTemplatePath,
    withoutDelay: true,
    xcodeVersion: '8.1',
    webSocket: null,
    flakeyRetries: true,
    logNoColors: false,
  });
  return new Instruments(opts);
}
github appium / appium-ios-driver / lib / instruments / instruments.js View on Github external
log.info('In xcode 6.0, instruments-without-delay does not work. ' +
               'If using Appium, you can disable instruments-without-delay ' +
               'with the --native-instruments-lib server flag');
    }
    if (this.xcodeVersion.versionString === '5.0.1') {
      throw new Error('Xcode 5.0.1 ships with a broken version of ' +
                      'Instruments. please upgrade to 5.0.2');
    }
    if (this.xcodeVersion.major > 7) {
      throw new Error(`Instruments-based automation was removed in Xcode 8. ` +
                      `Xcode ${this.xcodeVersion.versionString} is not supported. ` +
                      `Please try the XCUItest driver.`);
    }

    if (!this.template) {
      this.template = await xcode.getAutomationTraceTemplatePath();
    }

    if (!this.instrumentsPath) {
      this.instrumentsPath = await getInstrumentsPath();
    }
  }
github appium-boneyard / appium-instruments / lib / instruments.js View on Github external
static async quickInstruments (opts) {
    opts = _.clone(opts);
    let xcodeTraceTemplatePath = await xcode.getAutomationTraceTemplatePath();
    _.defaults(opts, {
      launchTimeout: 60000,
      template: xcodeTraceTemplatePath,
      withoutDelay: true,
      xcodeVersion: '8.1',
      webSocket: null,
      flakeyRetries: 2
    });
    return new Instruments(opts);
  }
github appium / appium-ios-driver / lib / instruments / instruments.js View on Github external
static async quickInstruments (opts) {
    opts = _.clone(opts);
    let xcodeTraceTemplatePath = await xcode.getAutomationTraceTemplatePath();
    _.defaults(opts, {
      launchTimeout: 60000,
      template: xcodeTraceTemplatePath,
      withoutDelay: true,
      xcodeVersion: '8.1',
      webSocket: null,
      flakeyRetries: 2
    });
    return new Instruments(opts);
  }
github appium / appium-ios-driver / lib / instruments / utils.js View on Github external
async function quickInstruments (opts = {}) {
  opts = _.cloneDeep(opts);
  let xcodeTraceTemplatePath = opts.xcodeTraceTemplatePath ||
      await xcode.getAutomationTraceTemplatePath();
  _.defaults(opts, {
    launchTimeout: 60000,
    template: xcodeTraceTemplatePath,
    withoutDelay: true,
    xcodeVersion: '8.1',
    webSocket: null,
    flakeyRetries: true,
    logNoColors: false,
  });
  return new Instruments(opts);
}