appium-espresso-driver 9.0.3 → 9.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/build/lib/commands/actions.d.ts +1 -1
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/app-install.d.ts.map +1 -1
- package/build/lib/commands/app-install.js +4 -9
- package/build/lib/commands/app-install.js.map +1 -1
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/context.d.ts +1 -1
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/idling-resources.d.ts.map +1 -1
- package/build/lib/commands/idling-resources.js.map +1 -1
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +1 -1
- package/build/lib/commands/misc.js.map +1 -1
- package/build/lib/commands/screenshot.d.ts.map +1 -1
- package/build/lib/commands/screenshot.js.map +1 -1
- package/build/lib/commands/server/builder.d.ts.map +1 -1
- package/build/lib/commands/server/builder.js +8 -15
- package/build/lib/commands/server/builder.js.map +1 -1
- package/build/lib/commands/server/runner.d.ts +2 -2
- package/build/lib/commands/server/runner.d.ts.map +1 -1
- package/build/lib/commands/server/runner.js +8 -14
- package/build/lib/commands/server/runner.js.map +1 -1
- package/build/lib/commands/server/startup.d.ts.map +1 -1
- package/build/lib/commands/server/startup.js.map +1 -1
- package/build/lib/commands/services.d.ts.map +1 -1
- package/build/lib/commands/services.js.map +1 -1
- package/build/lib/doctor/required-checks.d.ts +1 -1
- package/build/lib/doctor/required-checks.d.ts.map +1 -1
- package/build/lib/doctor/required-checks.js +2 -2
- package/build/lib/doctor/required-checks.js.map +1 -1
- package/build/lib/driver.d.ts +7 -7
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +14 -18
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +1 -7
- package/build/lib/execute-method-map.js.map +1 -1
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/utils/package.d.ts.map +1 -1
- package/build/lib/utils/package.js +2 -2
- package/build/lib/utils/package.js.map +1 -1
- package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
- package/espresso-server/buildSrc/.gradle/9.6.1/executionHistory/executionHistory.bin +0 -0
- package/espresso-server/buildSrc/.gradle/9.6.1/executionHistory/executionHistory.lock +0 -0
- package/espresso-server/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/espresso-server/buildSrc/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/espresso-server/buildSrc/.gradle/file-system.probe +0 -0
- package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin +0 -0
- package/espresso-server/gradle/libs.versions.toml +1 -1
- package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt +1 -1
- package/lib/commands/actions.ts +2 -1
- package/lib/commands/app-install.ts +9 -19
- package/lib/commands/app-management.ts +2 -1
- package/lib/commands/context.ts +2 -1
- package/lib/commands/element.ts +31 -76
- package/lib/commands/idling-resources.ts +9 -26
- package/lib/commands/misc.ts +14 -36
- package/lib/commands/screenshot.ts +1 -4
- package/lib/commands/server/builder.ts +13 -28
- package/lib/commands/server/runner.ts +24 -70
- package/lib/commands/server/startup.ts +2 -8
- package/lib/commands/services.ts +1 -5
- package/lib/doctor/required-checks.ts +6 -11
- package/lib/driver.ts +24 -37
- package/lib/execute-method-map.ts +1 -7
- package/lib/method-map.ts +1 -1
- package/lib/types.ts +1 -0
- package/lib/utils/package.ts +3 -2
- package/npm-shrinkwrap.json +175 -250
- package/package.json +58 -69
- package/scripts/build-espresso.mjs +7 -10
- package/scripts/diagnose-app.mjs +8 -13
- package/scripts/lib/dependency-versions/apk-dex.mjs +2 -1
- package/scripts/lib/dependency-versions/apk-kotlin-metadata.mjs +4 -2
- package/scripts/lib/dependency-versions/apk-meta-inf.mjs +4 -3
- package/scripts/lib/dependency-versions/apk-scan.mjs +4 -3
- package/scripts/lib/dependency-versions/comparison.mjs +3 -3
- package/scripts/lib/dependency-versions/gradle-scan.mjs +9 -11
- package/scripts/lib/dependency-versions/index.mjs +2 -9
- package/scripts/lib/dependency-versions/report.mjs +2 -5
- package/scripts/lib/dependency-versions/server-versions.mjs +3 -1
- package/scripts/lib/dependency-versions/tracked-modules.mjs +3 -12
- package/scripts/lib/dependency-versions/version-utils.mjs +1 -0
- package/scripts/lib/diagnose/app-input.mjs +4 -4
- package/scripts/lib/diagnose/checks/compile-sdk.mjs +1 -0
- package/scripts/lib/diagnose/checks/internet-permission.mjs +1 -2
- package/scripts/lib/diagnose/checks/startup-provider.mjs +2 -1
- package/scripts/lib/diagnose/diagnosis.mjs +2 -2
- package/scripts/lib/diagnose/gradle-utils.mjs +1 -5
- package/scripts/lib/diagnose/index.mjs +1 -5
- package/scripts/lib/diagnose/report.mjs +12 -4
- package/scripts/print-espresso-path.mjs +1 -0
- package/scripts/sync-version.mjs +8 -13
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {doctor as doctorCommon} from 'appium-android-driver';
|
|
2
|
-
import {exec} from 'teen_process';
|
|
3
|
-
import {fs, system, doctor} from 'appium/support.js';
|
|
4
1
|
import path from 'node:path';
|
|
2
|
+
|
|
5
3
|
import type {AppiumLogger, IDoctorCheck} from '@appium/types';
|
|
4
|
+
import {doctor as doctorCommon} from 'appium-android-driver';
|
|
5
|
+
import {fs, system, doctor} from 'appium/support.js';
|
|
6
|
+
import {exec} from 'teen_process';
|
|
6
7
|
|
|
7
8
|
export const androidHomeCheck = doctorCommon.androidHomeCheck;
|
|
8
9
|
export const javaHomeCheck = doctorCommon.javaHomeCheck;
|
|
@@ -16,15 +17,9 @@ export class JavaVersionCheck implements IDoctorCheck {
|
|
|
16
17
|
|
|
17
18
|
async diagnose() {
|
|
18
19
|
const javaHome = process.env.JAVA_HOME;
|
|
19
|
-
const fullJavaPath = path.join(
|
|
20
|
-
javaHome ?? '',
|
|
21
|
-
'bin',
|
|
22
|
-
`java${system.isWindows() ? '.exe' : ''}`,
|
|
23
|
-
);
|
|
20
|
+
const fullJavaPath = path.join(javaHome ?? '', 'bin', `java${system.isWindows() ? '.exe' : ''}`);
|
|
24
21
|
if (!javaHome || !(await fs.exists(fullJavaPath))) {
|
|
25
|
-
return doctor.nok(
|
|
26
|
-
`Cannot retrieve Java version. Is Java installed and JAVA_HOME set to a proper path?`,
|
|
27
|
-
);
|
|
22
|
+
return doctor.nok(`Cannot retrieve Java version. Is Java installed and JAVA_HOME set to a proper path?`);
|
|
28
23
|
}
|
|
29
24
|
let javaVerMatch: RegExpExecArray | null;
|
|
30
25
|
try {
|
package/lib/driver.ts
CHANGED
|
@@ -8,29 +8,30 @@ import type {
|
|
|
8
8
|
SingularSessionData,
|
|
9
9
|
SessionCapabilities,
|
|
10
10
|
} from '@appium/types';
|
|
11
|
-
import
|
|
11
|
+
import {DEFAULT_ADB_PORT} from 'appium-adb';
|
|
12
|
+
import {AndroidDriver} from 'appium-android-driver';
|
|
12
13
|
import {errors, isErrorType, DeviceSettings, BaseDriver} from 'appium/driver.js';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
14
|
+
import {retryInterval} from 'asyncbox';
|
|
15
|
+
import {findAPortNotInUse} from 'portscanner';
|
|
16
|
+
|
|
17
|
+
import * as actionsCmds from './commands/actions.js';
|
|
18
|
+
import * as appInstallCmds from './commands/app-install.js';
|
|
15
19
|
import * as appManagementCmds from './commands/app-management.js';
|
|
20
|
+
import * as clipboardCmds from './commands/clipboard.js';
|
|
16
21
|
import * as contextCmds from './commands/context.js';
|
|
17
22
|
import * as elementCmds from './commands/element.js';
|
|
23
|
+
import * as idlingResourcesCmds from './commands/idling-resources.js';
|
|
18
24
|
import * as miscCmds from './commands/misc.js';
|
|
19
|
-
import * as servicesCmds from './commands/services.js';
|
|
20
25
|
import * as screenshotCmds from './commands/screenshot.js';
|
|
21
|
-
import * as
|
|
22
|
-
import
|
|
23
|
-
import * as
|
|
24
|
-
import
|
|
25
|
-
import {DEFAULT_ADB_PORT} from 'appium-adb';
|
|
26
|
-
import {AndroidDriver} from 'appium-android-driver';
|
|
26
|
+
import * as serverCmds from './commands/server/index.js';
|
|
27
|
+
import type {EspressoRunner} from './commands/server/index.js';
|
|
28
|
+
import * as servicesCmds from './commands/services.js';
|
|
29
|
+
import type {EspressoConstraints} from './constraints.js';
|
|
27
30
|
import {ESPRESSO_CONSTRAINTS} from './constraints.js';
|
|
28
|
-
import {
|
|
29
|
-
import {retryInterval} from 'asyncbox';
|
|
30
|
-
import {isEmptyValue} from './utils/index.js';
|
|
31
|
+
import {executeMethodMap} from './execute-method-map.js';
|
|
31
32
|
import {newMethodMap} from './method-map.js';
|
|
32
33
|
import type {EspressoDriverCaps, EspressoDriverOpts, W3CEspressoDriverCaps} from './types.js';
|
|
33
|
-
import {
|
|
34
|
+
import {isEmptyValue} from './utils/index.js';
|
|
34
35
|
|
|
35
36
|
// NO_PROXY contains the paths that we never want to proxy to espresso server.
|
|
36
37
|
// TODO: Add the list of paths that we never want to proxy to espresso server.
|
|
@@ -130,10 +131,7 @@ const CHROME_NO_PROXY: RouteMatcher[] = [
|
|
|
130
131
|
['POST', new RegExp('^/session/[^/]+/se/log')],
|
|
131
132
|
];
|
|
132
133
|
|
|
133
|
-
export class EspressoDriver
|
|
134
|
-
extends AndroidDriver
|
|
135
|
-
implements ExternalDriver<EspressoConstraints, string, StringRecord>
|
|
136
|
-
{
|
|
134
|
+
export class EspressoDriver extends AndroidDriver implements ExternalDriver<EspressoConstraints, string, StringRecord> {
|
|
137
135
|
static newMethodMap = newMethodMap;
|
|
138
136
|
static executeMethodMap = executeMethodMap as unknown as typeof AndroidDriver.executeMethodMap;
|
|
139
137
|
|
|
@@ -152,15 +150,12 @@ export class EspressoDriver
|
|
|
152
150
|
performActions = actionsCmds.performActions as AndroidDriver['performActions'];
|
|
153
151
|
|
|
154
152
|
startActivity = appManagementCmds.startActivity;
|
|
155
|
-
mobileStartActivity =
|
|
156
|
-
appManagementCmds.mobileStartActivity as unknown as AndroidDriver['mobileStartActivity'];
|
|
153
|
+
mobileStartActivity = appManagementCmds.mobileStartActivity as unknown as AndroidDriver['mobileStartActivity'];
|
|
157
154
|
|
|
158
155
|
mobileWebAtoms = contextCmds.mobileWebAtoms;
|
|
159
|
-
suspendChromedriverProxy =
|
|
160
|
-
contextCmds.suspendChromedriverProxy as AndroidDriver['suspendChromedriverProxy'];
|
|
156
|
+
suspendChromedriverProxy = contextCmds.suspendChromedriverProxy as AndroidDriver['suspendChromedriverProxy'];
|
|
161
157
|
|
|
162
|
-
mobilePerformEditorAction =
|
|
163
|
-
elementCmds.mobilePerformEditorAction as AndroidDriver['mobilePerformEditorAction'];
|
|
158
|
+
mobilePerformEditorAction = elementCmds.mobilePerformEditorAction as AndroidDriver['mobilePerformEditorAction'];
|
|
164
159
|
mobileSwipe = elementCmds.mobileSwipe;
|
|
165
160
|
mobileOpenDrawer = elementCmds.mobileOpenDrawer;
|
|
166
161
|
mobileCloseDrawer = elementCmds.mobileCloseDrawer;
|
|
@@ -186,10 +181,8 @@ export class EspressoDriver
|
|
|
186
181
|
mobileGetClipboard = clipboardCmds.getClipboard;
|
|
187
182
|
mobileSetClipboard = clipboardCmds.mobileSetClipboard;
|
|
188
183
|
|
|
189
|
-
mobileStartService =
|
|
190
|
-
|
|
191
|
-
mobileStopService =
|
|
192
|
-
servicesCmds.mobileStopService as unknown as AndroidDriver['mobileStopService'];
|
|
184
|
+
mobileStartService = servicesCmds.mobileStartService as unknown as AndroidDriver['mobileStartService'];
|
|
185
|
+
mobileStopService = servicesCmds.mobileStopService as unknown as AndroidDriver['mobileStopService'];
|
|
193
186
|
|
|
194
187
|
getScreenshot = screenshotCmds.getScreenshot;
|
|
195
188
|
mobileScreenshots = screenshotCmds.mobileScreenshots;
|
|
@@ -318,8 +311,7 @@ export class EspressoDriver
|
|
|
318
311
|
// the app isn't an actual app file but rather something we want to
|
|
319
312
|
// assume is on the device and just launch via the appPackage
|
|
320
313
|
this.log.info(
|
|
321
|
-
`App file was not listed, instead we're going to run
|
|
322
|
-
`${this.opts.appPackage} directly on the device`,
|
|
314
|
+
`App file was not listed, instead we're going to run ${this.opts.appPackage} directly on the device`,
|
|
323
315
|
);
|
|
324
316
|
if (!(await this.adb.isAppInstalled(this.opts.appPackage as string))) {
|
|
325
317
|
throw this.log.errorWithException(
|
|
@@ -429,9 +421,7 @@ export class EspressoDriver
|
|
|
429
421
|
await this.settingsApp.setAnimationState(false);
|
|
430
422
|
this.wasAnimationEnabled = true;
|
|
431
423
|
} else if (shouldEnableAnimation) {
|
|
432
|
-
this.log.debug(
|
|
433
|
-
'Enabling window animation as "disableWindowAnimation" capability is set to false',
|
|
434
|
-
);
|
|
424
|
+
this.log.debug('Enabling window animation as "disableWindowAnimation" capability is set to false');
|
|
435
425
|
await this.settingsApp.setAnimationState(true);
|
|
436
426
|
this.wasAnimationEnabled = false;
|
|
437
427
|
} else {
|
|
@@ -480,10 +470,7 @@ export class EspressoDriver
|
|
|
480
470
|
// and one for Espresso(NO_PROXY), based on current context will return related NO_PROXY list
|
|
481
471
|
this.jwpProxyAvoid = this.chromedriver == null ? NO_PROXY : CHROME_NO_PROXY;
|
|
482
472
|
if (this.opts.nativeWebScreenshot) {
|
|
483
|
-
this.jwpProxyAvoid = [
|
|
484
|
-
...this.jwpProxyAvoid,
|
|
485
|
-
['GET', new RegExp('^/session/[^/]+/screenshot')],
|
|
486
|
-
];
|
|
473
|
+
this.jwpProxyAvoid = [...this.jwpProxyAvoid, ['GET', new RegExp('^/session/[^/]+/screenshot')]];
|
|
487
474
|
}
|
|
488
475
|
|
|
489
476
|
return this.jwpProxyAvoid;
|
|
@@ -28,13 +28,7 @@ export const executeMethodMap = {
|
|
|
28
28
|
command: 'mobileClickAction',
|
|
29
29
|
params: {
|
|
30
30
|
required: ['elementId'],
|
|
31
|
-
optional: [
|
|
32
|
-
'tapper',
|
|
33
|
-
'coordinatesProvider',
|
|
34
|
-
'precisionDescriber',
|
|
35
|
-
'inputDevice',
|
|
36
|
-
'buttonState',
|
|
37
|
-
],
|
|
31
|
+
optional: ['tapper', 'coordinatesProvider', 'precisionDescriber', 'inputDevice', 'buttonState'],
|
|
38
32
|
},
|
|
39
33
|
},
|
|
40
34
|
|
package/lib/method-map.ts
CHANGED
package/lib/types.ts
CHANGED
package/lib/utils/package.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {fs} from 'appium/support.js';
|
|
2
|
-
import path from 'node:path';
|
|
3
1
|
import _fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
4
3
|
import {fileURLToPath} from 'node:url';
|
|
5
4
|
|
|
5
|
+
import {fs} from 'appium/support.js';
|
|
6
|
+
|
|
6
7
|
let PACKAGE_INFO: {manifestPath: string; manifestPayload: Record<string, any>} | null = null;
|
|
7
8
|
const MODULE_NAME = 'appium-espresso-driver';
|
|
8
9
|
const FILENAME = fileURLToPath(import.meta.url);
|