Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appium-uiautomator2-driver

Package Overview
Dependencies
Maintainers
0
Versions
344
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium-uiautomator2-driver - npm Package Compare versions

Comparing version 3.9.3 to 3.9.4

2

build/lib/commands/keyboard.js

@@ -66,3 +66,3 @@ "use strict";

if (lodash_1.default.isUndefined(text)) {
throw this.log.errorAndThrow(`The 'text' argument is mandatory`);
throw this.log.errorWithException(`The 'text' argument is mandatory`);
}

@@ -69,0 +69,0 @@ return await this.settingsApp.typeUnicode(String(text));

@@ -391,3 +391,3 @@ "use strict";

if ((await (0, portscanner_1.checkPortStatus)(localPort, LOCALHOST_IP4)) === 'open') {
throw this.log.errorAndThrow(`UiAutomator2 Server cannot start because the local port #${localPort} is busy. ` +
throw this.log.errorWithException(`UiAutomator2 Server cannot start because the local port #${localPort} is busy. ` +
`Make sure the port you provide via 'systemPort' capability is not occupied. ` +

@@ -409,3 +409,3 @@ `This situation might often be a result of an inaccurate sessions management, e.g. ` +

catch (e) {
throw this.log.errorAndThrow(`Cannot find any free port in range ${startPort}..${endPort}}. ` +
throw this.log.errorWithException(`Cannot find any free port in range ${startPort}..${endPort}}. ` +
`Please set the available port number by providing the systemPort capability or ` +

@@ -446,3 +446,3 @@ `double check the processes that are locking ports within this range and terminate ` +

if (apiLevel < 21) {
throw this.log.errorAndThrow('UIAutomator2 is only supported since Android 5.0 (Lollipop). ' +
throw this.log.errorWithException('UIAutomator2 is only supported since Android 5.0 (Lollipop). ' +
'You could still use other supported backends in order to automate older Android versions.');

@@ -459,3 +459,3 @@ }

catch (err) {
throw this.log.errorAndThrow('Hidden API policy (https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces) cannot be enabled. ' +
throw this.log.errorWithException('Hidden API policy (https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces) cannot be enabled. ' +
'This might be happening because the device under test is not configured properly. ' +

@@ -600,6 +600,3 @@ 'Please check https://github.com/appium/appium/issues/13802 for more details. ' +

adb: this.adb,
apk: this.opts.app,
tmpDir: this.opts.tmpDir,
appPackage: this.opts.appPackage,
appActivity: this.opts.appActivity,
disableWindowAnimation: !!this.opts.disableWindowAnimation,

@@ -642,3 +639,3 @@ disableSuppressAccessibilityService: this.opts.disableSuppressAccessibilityService,

catch (e) {
throw this.log.errorAndThrow(`Could not parse "otherApps" capability: ${e.message}`);
throw this.log.errorWithException(`Could not parse "otherApps" capability: ${e.message}`);
}

@@ -668,3 +665,3 @@ otherApps = await bluebird_1.default.all(otherApps.map((app) => this.helpers.configureApp(app, [extensions_1.APK_EXTENSION, extensions_1.APKS_EXTENSION])));

if (this.opts.fullReset) {
throw this.log.errorAndThrow('Full reset requires an app capability, use fastReset if app is not provided');
throw this.log.errorWithException('Full reset requires an app capability, use fastReset if app is not provided');
}

@@ -814,3 +811,3 @@ this.log.debug('No app capability. Assuming it is already on the device');

if (!this.opts.app || !(await support_1.fs.exists(this.opts.app))) {
throw this.log.errorAndThrow(`Could not find app apk at '${this.opts.app}'`);
throw this.log.errorWithException(`Could not find app apk at '${this.opts.app}'`);
}

@@ -817,0 +814,0 @@ }

export default UiAutomator2Server;
export type UiAutomator2ServerOptions = {
adb: import("appium-adb").ADB;
tmpDir: string;
host: string;
systemPort: number;
devicePort: number;
disableWindowAnimation: boolean;
readTimeout?: number | undefined;
disableSuppressAccessibilityService?: boolean | undefined;
apk?: string | undefined;
};
export class UiAutomator2Server {
constructor(log: any, opts?: {});
/**
*
* @param {import('@appium/types').AppiumLogger} log
* @param {UiAutomator2ServerOptions} opts
*/
constructor(log: import("@appium/types").AppiumLogger, opts: UiAutomator2ServerOptions);
/** @type {string} */

@@ -16,3 +32,3 @@ host: string;

instrumentationProcess: import("teen_process").SubProcess | null;
log: any;
log: import("@appium/types").AppiumLogger;
jwproxy: UIA2Proxy;

@@ -87,5 +103,8 @@ proxyReqRes: any;

didInstrumentationExit: boolean;
proxyCommand(url: any, method: any, body?: null): Promise<any>;
/**
* @override
*/
override proxyCommand(url: any, method: any, body?: null): Promise<any>;
}
import { JWProxy } from 'appium/driver';
//# sourceMappingURL=uiautomator2.d.ts.map

@@ -25,2 +25,5 @@ "use strict";

class UIA2Proxy extends driver_1.JWProxy {
/**
* @override
*/
async proxyCommand(url, method, body = null) {

@@ -36,3 +39,8 @@ if (this.didInstrumentationExit) {

class UiAutomator2Server {
constructor(log, opts = {}) {
/**
*
* @param {import('@appium/types').AppiumLogger} log
* @param {UiAutomator2ServerOptions} opts
*/
constructor(log, opts) {
for (let req of REQD_PARAMS) {

@@ -257,3 +265,3 @@ if (!opts || !support_1.util.hasValue(opts[req])) {

catch (err) {
this.log.errorAndThrow(`The instrumentation process cannot be initialized within ${timeout}ms timeout. `
throw this.log.errorWithException(`The instrumentation process cannot be initialized within ${timeout}ms timeout. `
+ 'Make sure the application under test does not crash and investigate the logcat output. '

@@ -268,3 +276,3 @@ + `You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability`);

if (retries >= maxRetries) {
this.log.errorAndThrow('The instrumentation process cannot be initialized. '
throw this.log.errorWithException('The instrumentation process cannot be initialized. '
+ 'Make sure the application under test does not crash and investigate the logcat output.');

@@ -408,2 +416,14 @@ }

exports.default = UiAutomator2Server;
/**
* @typedef {Object} UiAutomator2ServerOptions
* @property {import('appium-adb').ADB} adb
* @property {string} tmpDir
* @property {string} host
* @property {number} systemPort
* @property {number} devicePort
* @property {boolean} disableWindowAnimation
* @property {number} [readTimeout]
* @property {boolean} [disableSuppressAccessibilityService]
* @property {string} [apk]
*/
//# sourceMappingURL=uiautomator2.js.map

@@ -0,1 +1,7 @@

## [3.9.4](https://github.com/appium/appium-uiautomator2-driver/compare/v3.9.3...v3.9.4) (2024-12-13)
### Miscellaneous Chores
* Replace occurrences of the deprecated errorAndThrow API ([#849](https://github.com/appium/appium-uiautomator2-driver/issues/849)) ([c562ca5](https://github.com/appium/appium-uiautomator2-driver/commit/c562ca58897e4df84e78a199b40a552b5659e026))
## [3.9.3](https://github.com/appium/appium-uiautomator2-driver/compare/v3.9.2...v3.9.3) (2024-12-11)

@@ -2,0 +8,0 @@

@@ -72,3 +72,3 @@ import _ from 'lodash';

if (_.isUndefined(text)) {
throw this.log.errorAndThrow(`The 'text' argument is mandatory`);
throw this.log.errorWithException(`The 'text' argument is mandatory`);
}

@@ -75,0 +75,0 @@ return await this.settingsApp.typeUnicode(String(text));

@@ -465,3 +465,3 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */

if ((await checkPortStatus(localPort, LOCALHOST_IP4)) === 'open') {
throw this.log.errorAndThrow(
throw this.log.errorWithException(
`UiAutomator2 Server cannot start because the local port #${localPort} is busy. ` +

@@ -486,3 +486,3 @@ `Make sure the port you provide via 'systemPort' capability is not occupied. ` +

} catch (e) {
throw this.log.errorAndThrow(
throw this.log.errorWithException(
`Cannot find any free port in range ${startPort}..${endPort}}. ` +

@@ -533,3 +533,3 @@ `Please set the available port number by providing the systemPort capability or ` +

if (apiLevel < 21) {
throw this.log.errorAndThrow(
throw this.log.errorWithException(
'UIAutomator2 is only supported since Android 5.0 (Lollipop). ' +

@@ -548,3 +548,3 @@ 'You could still use other supported backends in order to automate older Android versions.'

} catch (err) {
throw this.log.errorAndThrow(
throw this.log.errorWithException(
'Hidden API policy (https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces) cannot be enabled. ' +

@@ -704,9 +704,6 @@ 'This might be happening because the device under test is not configured properly. ' +

host: this.opts.remoteAdbHost || this.opts.host || LOCALHOST_IP4,
systemPort: this.systemPort,
systemPort: this.systemPort as number,
devicePort: DEVICE_PORT,
adb: this.adb,
apk: this.opts.app,
tmpDir: this.opts.tmpDir,
appPackage: this.opts.appPackage,
appActivity: this.opts.appActivity,
tmpDir: this.opts.tmpDir as string,
disableWindowAnimation: !!this.opts.disableWindowAnimation,

@@ -761,3 +758,5 @@ disableSuppressAccessibilityService: this.opts.disableSuppressAccessibilityService,

} catch (e) {
throw this.log.errorAndThrow(`Could not parse "otherApps" capability: ${(e as Error).message}`);
throw this.log.errorWithException(
`Could not parse "otherApps" capability: ${(e as Error).message}`
);
}

@@ -794,3 +793,3 @@ otherApps = await B.all(

if (this.opts.fullReset) {
throw this.log.errorAndThrow(
throw this.log.errorWithException(
'Full reset requires an app capability, use fastReset if app is not provided'

@@ -956,3 +955,3 @@ );

if (!this.opts.app || !(await fs.exists(this.opts.app))) {
throw this.log.errorAndThrow(`Could not find app apk at '${this.opts.app}'`);
throw this.log.errorWithException(`Could not find app apk at '${this.opts.app}'`);
}

@@ -959,0 +958,0 @@ }

@@ -25,2 +25,5 @@ import _ from 'lodash';

/**
* @override
*/
async proxyCommand (url, method, body = null) {

@@ -56,3 +59,8 @@ if (this.didInstrumentationExit) {

constructor (log, opts = {}) {
/**
*
* @param {import('@appium/types').AppiumLogger} log
* @param {UiAutomator2ServerOptions} opts
*/
constructor (log, opts) {
for (let req of REQD_PARAMS) {

@@ -282,5 +290,7 @@ if (!opts || !util.hasValue(opts[req])) {

} catch (err) {
this.log.errorAndThrow(`The instrumentation process cannot be initialized within ${timeout}ms timeout. `
throw this.log.errorWithException(
`The instrumentation process cannot be initialized within ${timeout}ms timeout. `
+ 'Make sure the application under test does not crash and investigate the logcat output. '
+ `You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability`);
+ `You could also try to increase the value of 'uiautomator2ServerLaunchTimeout' capability`
);
}

@@ -294,4 +304,6 @@ }

if (retries >= maxRetries) {
this.log.errorAndThrow('The instrumentation process cannot be initialized. '
+ 'Make sure the application under test does not crash and investigate the logcat output.');
throw this.log.errorWithException(
'The instrumentation process cannot be initialized. '
+ 'Make sure the application under test does not crash and investigate the logcat output.'
);
}

@@ -437,1 +449,14 @@ this.log.warn(`The instrumentation process has been unexpectedly terminated. `

export default UiAutomator2Server;
/**
* @typedef {Object} UiAutomator2ServerOptions
* @property {import('appium-adb').ADB} adb
* @property {string} tmpDir
* @property {string} host
* @property {number} systemPort
* @property {number} devicePort
* @property {boolean} disableWindowAnimation
* @property {number} [readTimeout]
* @property {boolean} [disableSuppressAccessibilityService]
* @property {string} [apk]
*/

@@ -10,3 +10,3 @@ {

],
"version": "3.9.3",
"version": "3.9.4",
"bugs": {

@@ -13,0 +13,0 @@ "url": "https://github.com/appium/appium-uiautomator2-driver/issues"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc