How to use the appium-remote-debugger.RemoteDebugger.EVENT_PAGE_CHANGE function in appium-remote-debugger

To help you get started, we’ve selected a few appium-remote-debugger 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-ios-driver / lib / commands / context.js View on Github external
'ios-webkit-debug-proxy. If you expect to find webviews, please ensure ' +
                  'that the proxy is running and accessible');
      this.remote = null;
      pageArray = [];
    }
  } else {
    // simulator, and not connected
    this.remote = await this.getNewRemoteDebugger();

    let appInfo = await this.remote.connect();
    if (!appInfo) {
      logger.debug('Unable to connect to the remote debugger.');
      return [];
    }
    pageArray = await this.remote.selectApp(currentUrl, this.opts.webviewConnectRetries, this.opts.ignoreAboutBlankUrl);
    this.remote.on(RemoteDebugger.EVENT_PAGE_CHANGE, this.onPageChange.bind(this));
    this.remote.on(RemoteDebugger.EVENT_FRAMES_DETACHED, () => {
      if (!_.isEmpty(this.curWebFrames)) {
        logger.debug(`Clearing ${this.curWebFrames.length} frames: ${this.curWebFrames.join(', ')}`);
      }
      this.curWebFrames = [];
    });

    let tryClosingAlert = async () => {
      let didDismiss = await this.closeAlertBeforeTest();
      if (!didDismiss) {
        throw new Error('Close alert failed. Retry.');
      }
    };
    try {
      await retryInterval(3, 4000, tryClosingAlert);
    } catch (err) {
github appium / appium-xcuitest-driver / lib / commands / context.js View on Github external
extensions.connectToRemoteDebugger = async function connectToRemoteDebugger () {
  this.remote = await this.getNewRemoteDebugger();
  await this.remote.connect();

  this.remote.on(RemoteDebugger.EVENT_PAGE_CHANGE, this.onPageChange.bind(this));
  this.remote.on(RemoteDebugger.EVENT_FRAMES_DETACHED, () => {
    if (!_.isEmpty(this.curWebFrames)) {
      log.debug(`Clearing ${this.curWebFrames.length} frames: ${this.curWebFrames.join(', ')}`);
    }
    this.curWebFrames = [];
  });
};