Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// There are 2 CommandTimeout (FlutterDriver and proxy)
// Only FlutterDriver CommandTimeout is used; Proxy is disabled
// All proxy commands needs to reset the FlutterDriver CommandTimeout
// Here we manually reset the FlutterDriver CommandTimeout for commands that goe to proxy.
this.clearNewCommandTimeout();
const result = this.proxydriver.executeCommand(cmd, ...args);
this.startNewCommandTimeout(cmd);
return result;
} else {
logger.debug(`Executing Flutter driver command '${cmd}'`);
return super.executeCommand(cmd, ...args);
}
} else {
logger.debug(`Command Error '${cmd}'`);
throw new errors.NoSuchDriverError(
`Driver is not ready, cannot execute ${cmd}.`,
);
}
}
async executeCommand (cmd, ...args) {
logger.debug(`Executing iOS command '${cmd}'`);
if (cmd === 'receiveAsyncResponse') {
return await this.receiveAsyncResponse(...args);
} else if (this.ready || _.includes(['launchApp'], cmd)) {
return await super.executeCommand(cmd, ...args);
}
throw new errors.NoSuchDriverError(`Driver is not ready, cannot execute ${cmd}.`);
}