appium-espresso-driver 2.18.0 → 2.19.0
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 +14 -0
- package/README.md +6 -0
- package/build/lib/commands/execute.js +2 -1
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/idling-resources.js +4 -1
- package/build/lib/commands/idling-resources.js.map +1 -1
- package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
- package/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/handlers/UIThreadSynchronizer.kt +36 -0
- package/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/http/Router.kt +2 -0
- package/lib/commands/execute.js +1 -0
- package/lib/commands/idling-resources.js +7 -0
- package/npm-shrinkwrap.json +8 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.19.0](https://github.com/appium/appium-espresso-driver/compare/v2.18.1...v2.19.0) (2023-03-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Expose API to Wait For UI Thread ([#864](https://github.com/appium/appium-espresso-driver/issues/864)) ([18d71f6](https://github.com/appium/appium-espresso-driver/commit/18d71f60f4c55be608f5e80ebf69e615a900e9f5))
|
|
7
|
+
|
|
8
|
+
## [2.18.1](https://github.com/appium/appium-espresso-driver/compare/v2.18.0...v2.18.1) (2023-03-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* remove .js ext from build-espresso command ([d13b85d](https://github.com/appium/appium-espresso-driver/commit/d13b85da41973e321b54dbd91c7679e9ee97ba35))
|
|
14
|
+
|
|
1
15
|
## [2.18.0](https://github.com/appium/appium-espresso-driver/compare/v2.17.0...v2.18.0) (2023-03-22)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -1121,6 +1121,12 @@ Lists all the previously registered [idling resources](https://developer.android
|
|
|
1121
1121
|
|
|
1122
1122
|
List of fully qualified class names of currently registered idling resources or an empty list if no resources have been registered yet.
|
|
1123
1123
|
|
|
1124
|
+
### mobile: waitForUIThread
|
|
1125
|
+
|
|
1126
|
+
- Wait for the UI thread to become idle, in other words, wait for the APP to become idle(https://developer.android.com/reference/androidx/test/espresso/UiController#loopMainThreadUntilIdle()).
|
|
1127
|
+
- Use case: On compose and native combination screens, it's possible for the Espresso API to block the UI thread, which can cause the app to freeze. To resolve this issue, it's recommended to explicitly call the `mobile:waitForUIThread` API, which can help to unfreeze the UI thread.
|
|
1128
|
+
|
|
1129
|
+
|
|
1124
1130
|
### mobile: unlock
|
|
1125
1131
|
|
|
1126
1132
|
Unlocks the device if it is locked. Noop if the device's screen is not locked.
|
|
@@ -57,6 +57,7 @@ extensions.executeMobile = async function executeMobile(mobileCommand, opts = {}
|
|
|
57
57
|
registerIdlingResources: 'mobileRegisterIdlingResources',
|
|
58
58
|
unregisterIdlingResources: 'mobileUnregisterIdlingResources',
|
|
59
59
|
listIdlingResources: 'mobileListIdlingResources',
|
|
60
|
+
waitForUIThread: 'mobileWaitForUIThread',
|
|
60
61
|
unlock: 'mobileUnlock',
|
|
61
62
|
refreshGpsCache: 'mobileRefreshGpsCache',
|
|
62
63
|
startMediaProjectionRecording: 'mobileStartMediaProjectionRecording',
|
|
@@ -70,4 +71,4 @@ extensions.executeMobile = async function executeMobile(mobileCommand, opts = {}
|
|
|
70
71
|
};
|
|
71
72
|
var _default = extensions;
|
|
72
73
|
exports.default = _default;
|
|
73
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
74
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbG9kYXNoIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfZHJpdmVyIiwiZXh0ZW5zaW9ucyIsImV4ZWN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6RCxxQkFBcUIsQ0FBRSwwQkFBeUIsQ0FBQztFQUNwRTtFQUNBLE9BQU8sTUFBTSxJQUFJLENBQUNBLHFCQUFxQixDQUFDRixhQUFhLENBQUMsQ0FBQyxDQUFDQyxJQUFJLENBQUM7QUFDL0QsQ0FBQztBQUFDLElBQUEyRCxRQUFBLEdBRWE5RCxVQUFVO0FBQUErRCxPQUFBLENBQUFDLE9BQUEsR0FBQUYsUUFBQSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","names":["_lodash","_interopRequireDefault","require","_driver","extensions","executeMobile","mobileCommand","opts","mobileCommandsMapping","shell","execEmuConsoleCommand","performEditorAction","changePermissions","getPermissions","startScreenStreaming","stopScreenStreaming","swipe","scrollToPage","navigateTo","clickAction","deviceInfo","isToastVisible","openDrawer","closeDrawer","setDate","setTime","getDeviceTime","backdoor","flashElement","uiautomator","uiautomatorPageSource","webAtoms","getContexts","dismissAutofill","getNotifications","listSms","sensorSet","pushFile","pullFile","pullFolder","deleteFile","isAppInstalled","queryAppState","activateApp","removeApp","terminateApp","installApp","clearApp","startActivity","startService","stopService","broadcast","registerIdlingResources","unregisterIdlingResources","listIdlingResources","unlock","refreshGpsCache","startMediaProjectionRecording","isMediaProjectionRecordingRunning","stopMediaProjectionRecording","_","has","errors","UnknownCommandError","keys","_default","exports","default"],"sources":["../../../lib/commands/execute.js"],"sourcesContent":["import _ from 'lodash';\nimport { errors } from 'appium/driver';\n\nconst extensions = {};\n\nextensions.executeMobile = async function executeMobile (mobileCommand, opts = {}) {\n const mobileCommandsMapping = {\n shell: 'mobileShell',\n\n execEmuConsoleCommand: 'mobileExecEmuConsoleCommand',\n\n performEditorAction: 'mobilePerformEditorAction',\n\n changePermissions: 'mobileChangePermissions',\n getPermissions: 'mobileGetPermissions',\n\n startScreenStreaming: 'mobileStartScreenStreaming',\n stopScreenStreaming: 'mobileStopScreenStreaming',\n\n swipe: 'mobileSwipe',\n scrollToPage: 'mobileScrollToPage',\n navigateTo: 'mobileNavigateTo',\n clickAction: 'mobileClickAction',\n\n deviceInfo: 'mobileGetDeviceInfo',\n\n isToastVisible: 'mobileIsToastVisible',\n\n openDrawer: 'mobileOpenDrawer',\n closeDrawer: 'mobileCloseDrawer',\n\n setDate: 'mobileSetDate',\n setTime: 'mobileSetTime',\n\n getDeviceTime: 'mobileGetDeviceTime',\n\n backdoor: 'mobileBackdoor',\n\n flashElement: 'mobileFlashElement',\n\n uiautomator: 'mobileUiautomator',\n uiautomatorPageSource: 'mobileUiautomatorPageSource',\n\n webAtoms: 'mobileWebAtoms',\n getContexts: 'mobileGetContexts',\n\n dismissAutofill: 'mobileDismissAutofill',\n\n getNotifications: 'mobileGetNotifications',\n\n listSms: 'mobileListSms',\n\n sensorSet: 'sensorSet',\n\n pushFile: 'mobilePushFile',\n pullFile: 'mobilePullFile',\n pullFolder: 'mobilePullFolder',\n deleteFile: 'mobileDeleteFile',\n\n isAppInstalled: 'mobileIsAppInstalled',\n queryAppState: 'mobileQueryAppState',\n activateApp: 'mobileActivateApp',\n removeApp: 'mobileRemoveApp',\n terminateApp: 'mobileTerminateApp',\n installApp: 'mobileInstallApp',\n clearApp: 'mobileClearApp',\n\n startActivity: 'mobileStartActivity',\n startService: 'mobileStartService',\n stopService: 'mobileStopService',\n broadcast: 'mobileBroadcast',\n\n registerIdlingResources: 'mobileRegisterIdlingResources',\n unregisterIdlingResources: 'mobileUnregisterIdlingResources',\n listIdlingResources: 'mobileListIdlingResources',\n\n unlock: 'mobileUnlock',\n\n refreshGpsCache: 'mobileRefreshGpsCache',\n\n startMediaProjectionRecording: 'mobileStartMediaProjectionRecording',\n isMediaProjectionRecordingRunning: 'mobileIsMediaProjectionRecordingRunning',\n stopMediaProjectionRecording: 'mobileStopMediaProjectionRecording',\n };\n\n if (!_.has(mobileCommandsMapping, mobileCommand)) {\n throw new errors.UnknownCommandError(`Unknown mobile command \"${mobileCommand}\". ` +\n `Only ${_.keys(mobileCommandsMapping)} commands are supported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AkB;IAE9BC,cAAc,EAAE,sBAAsB;IACtCC,aAAa,EAAE,qBAAqB;IACpCC,WAAW,EAAE,mBAAmB;IAChCC,SAAS,EAAE,iBAAiB;IAC5BC,YAAY,EAAE,oBAAoB;IAClCC,UAAU,EAAE,kBAAkB;IAC9BC,QAAQ,EAAE,gBAAgB;IAE1BC,aAAa,EAAE,qBAAqB;IACpCC,YAAY,EAAE,oBAAoB;IAClCC,WAAW,EAAE,mBAAmB;IAChCC,SAAS,EAAE,iBAAiB;IAE5BC,uBAAuB,EAAE,+BAA+B;IACxDC,yBAAyB,EAAE,iCAAiC;IAC5DC,mBAAmB,EAAE,2BAA2B;
|
|
1
|
+
{"version":3,"file":"execute.js","names":["_lodash","_interopRequireDefault","require","_driver","extensions","executeMobile","mobileCommand","opts","mobileCommandsMapping","shell","execEmuConsoleCommand","performEditorAction","changePermissions","getPermissions","startScreenStreaming","stopScreenStreaming","swipe","scrollToPage","navigateTo","clickAction","deviceInfo","isToastVisible","openDrawer","closeDrawer","setDate","setTime","getDeviceTime","backdoor","flashElement","uiautomator","uiautomatorPageSource","webAtoms","getContexts","dismissAutofill","getNotifications","listSms","sensorSet","pushFile","pullFile","pullFolder","deleteFile","isAppInstalled","queryAppState","activateApp","removeApp","terminateApp","installApp","clearApp","startActivity","startService","stopService","broadcast","registerIdlingResources","unregisterIdlingResources","listIdlingResources","waitForUIThread","unlock","refreshGpsCache","startMediaProjectionRecording","isMediaProjectionRecordingRunning","stopMediaProjectionRecording","_","has","errors","UnknownCommandError","keys","_default","exports","default"],"sources":["../../../lib/commands/execute.js"],"sourcesContent":["import _ from 'lodash';\nimport { errors } from 'appium/driver';\n\nconst extensions = {};\n\nextensions.executeMobile = async function executeMobile (mobileCommand, opts = {}) {\n const mobileCommandsMapping = {\n shell: 'mobileShell',\n\n execEmuConsoleCommand: 'mobileExecEmuConsoleCommand',\n\n performEditorAction: 'mobilePerformEditorAction',\n\n changePermissions: 'mobileChangePermissions',\n getPermissions: 'mobileGetPermissions',\n\n startScreenStreaming: 'mobileStartScreenStreaming',\n stopScreenStreaming: 'mobileStopScreenStreaming',\n\n swipe: 'mobileSwipe',\n scrollToPage: 'mobileScrollToPage',\n navigateTo: 'mobileNavigateTo',\n clickAction: 'mobileClickAction',\n\n deviceInfo: 'mobileGetDeviceInfo',\n\n isToastVisible: 'mobileIsToastVisible',\n\n openDrawer: 'mobileOpenDrawer',\n closeDrawer: 'mobileCloseDrawer',\n\n setDate: 'mobileSetDate',\n setTime: 'mobileSetTime',\n\n getDeviceTime: 'mobileGetDeviceTime',\n\n backdoor: 'mobileBackdoor',\n\n flashElement: 'mobileFlashElement',\n\n uiautomator: 'mobileUiautomator',\n uiautomatorPageSource: 'mobileUiautomatorPageSource',\n\n webAtoms: 'mobileWebAtoms',\n getContexts: 'mobileGetContexts',\n\n dismissAutofill: 'mobileDismissAutofill',\n\n getNotifications: 'mobileGetNotifications',\n\n listSms: 'mobileListSms',\n\n sensorSet: 'sensorSet',\n\n pushFile: 'mobilePushFile',\n pullFile: 'mobilePullFile',\n pullFolder: 'mobilePullFolder',\n deleteFile: 'mobileDeleteFile',\n\n isAppInstalled: 'mobileIsAppInstalled',\n queryAppState: 'mobileQueryAppState',\n activateApp: 'mobileActivateApp',\n removeApp: 'mobileRemoveApp',\n terminateApp: 'mobileTerminateApp',\n installApp: 'mobileInstallApp',\n clearApp: 'mobileClearApp',\n\n startActivity: 'mobileStartActivity',\n startService: 'mobileStartService',\n stopService: 'mobileStopService',\n broadcast: 'mobileBroadcast',\n\n registerIdlingResources: 'mobileRegisterIdlingResources',\n unregisterIdlingResources: 'mobileUnregisterIdlingResources',\n listIdlingResources: 'mobileListIdlingResources',\n waitForUIThread: 'mobileWaitForUIThread',\n\n unlock: 'mobileUnlock',\n\n refreshGpsCache: 'mobileRefreshGpsCache',\n\n startMediaProjectionRecording: 'mobileStartMediaProjectionRecording',\n isMediaProjectionRecordingRunning: 'mobileIsMediaProjectionRecordingRunning',\n stopMediaProjectionRecording: 'mobileStopMediaProjectionRecording',\n };\n\n if (!_.has(mobileCommandsMapping, mobileCommand)) {\n throw new errors.UnknownCommandError(`Unknown mobile command \"${mobileCommand}\". ` +\n `Only ${_.keys(mobileCommandsMapping)} commands are supported.`);\n }\n return await this[mobileCommandsMapping[mobileCommand]](opts);\n};\n\nexport default extensions;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,MAAME,UAAU,GAAG,CAAC,CAAC;AAErBA,UAAU,CAACC,aAAa,GAAG,eAAeA,aAAaA,CAAEC,aAAa,EAAEC,IAAI,GAAG,CAAC,CAAC,EAAE;EACjF,MAAMC,qBAAqB,GAAG;IAC5BC,KAAK,EAAE,aAAa;IAEpBC,qBAAqB,EAAE,6BAA6B;IAEpDC,mBAAmB,EAAE,2BAA2B;IAEhDC,iBAAiB,EAAE,yBAAyB;IAC5CC,cAAc,EAAE,sBAAsB;IAEtCC,oBAAoB,EAAE,4BAA4B;IAClDC,mBAAmB,EAAE,2BAA2B;IAEhDC,KAAK,EAAE,aAAa;IACpBC,YAAY,EAAE,oBAAoB;IAClCC,UAAU,EAAE,kBAAkB;IAC9BC,WAAW,EAAE,mBAAmB;IAEhCC,UAAU,EAAE,qBAAqB;IAEjCC,cAAc,EAAE,sBAAsB;IAEtCC,UAAU,EAAE,kBAAkB;IAC9BC,WAAW,EAAE,mBAAmB;IAEhCC,OAAO,EAAE,eAAe;IACxBC,OAAO,EAAE,eAAe;IAExBC,aAAa,EAAE,qBAAqB;IAEpCC,QAAQ,EAAE,gBAAgB;IAE1BC,YAAY,EAAE,oBAAoB;IAElCC,WAAW,EAAE,mBAAmB;IAChCC,qBAAqB,EAAE,6BAA6B;IAEpDC,QAAQ,EAAE,gBAAgB;IAC1BC,WAAW,EAAE,mBAAmB;IAEhCC,eAAe,EAAE,uBAAuB;IAExCC,gBAAgB,EAAE,wBAAwB;IAE1CC,OAAO,EAAE,eAAe;IAExBC,SAAS,EAAE,WAAW;IAEtBC,QAAQ,EAAE,gBAAgB;IAC1BC,QAAQ,EAAE,gBAAgB;IAC1BC,UAAU,EAAE,kBAAkB;IAC9BC,UAAU,EAAE,kBAAkB;IAE9BC,cAAc,EAAE,sBAAsB;IACtCC,aAAa,EAAE,qBAAqB;IACpCC,WAAW,EAAE,mBAAmB;IAChCC,SAAS,EAAE,iBAAiB;IAC5BC,YAAY,EAAE,oBAAoB;IAClCC,UAAU,EAAE,kBAAkB;IAC9BC,QAAQ,EAAE,gBAAgB;IAE1BC,aAAa,EAAE,qBAAqB;IACpCC,YAAY,EAAE,oBAAoB;IAClCC,WAAW,EAAE,mBAAmB;IAChCC,SAAS,EAAE,iBAAiB;IAE5BC,uBAAuB,EAAE,+BAA+B;IACxDC,yBAAyB,EAAE,iCAAiC;IAC5DC,mBAAmB,EAAE,2BAA2B;IAChDC,eAAe,EAAE,uBAAuB;IAExCC,MAAM,EAAE,cAAc;IAEtBC,eAAe,EAAE,uBAAuB;IAExCC,6BAA6B,EAAE,qCAAqC;IACpEC,iCAAiC,EAAE,yCAAyC;IAC5EC,4BAA4B,EAAE;EAChC,CAAC;EAED,IAAI,CAACC,eAAC,CAACC,GAAG,CAACtD,qBAAqB,EAAEF,aAAa,CAAC,EAAE;IAChD,MAAM,IAAIyD,cAAM,CAACC,mBAAmB,CAAE,2BAA0B1D,aAAc,KAAI,GAC/E,QAAOuD,eAAC,CAACI,IAAI,CAACzD,qBAAqB,CAAE,0BAAyB,CAAC;EACpE;EACA,OAAO,MAAM,IAAI,CAACA,qBAAqB,CAACF,aAAa,CAAC,CAAC,CAACC,IAAI,CAAC;AAC/D,CAAC;AAAC,IAAA2D,QAAA,GAEa9D,UAAU;AAAA+D,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -17,6 +17,9 @@ commands.mobileUnregisterIdlingResources = async function mobileUnregisterIdling
|
|
|
17
17
|
commands.mobileListIdlingResources = async function mobileListIdlingResources() {
|
|
18
18
|
return await this.espresso.jwproxy.command('/appium/execute_mobile/list_idling_resources', 'GET');
|
|
19
19
|
};
|
|
20
|
+
commands.mobileWaitForUIThread = async function mobileWaitForUIThread() {
|
|
21
|
+
return await this.espresso.jwproxy.command('/appium/execute_mobile/ui_thread_sync', 'POST');
|
|
22
|
+
};
|
|
20
23
|
var _default = commands;
|
|
21
24
|
exports.default = _default;
|
|
22
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
25
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfdXRpbHMiLCJyZXF1aXJlIiwiY29tbWFuZHMiLCJleHBvcnRzIiwibW9iaWxlUmVnaXN0ZXJJZGxpbmdSZXNvdXJjZXMiLCJvcHRzIiwiZXNwcmVzc28iLCJqd3Byb3h5IiwiY29tbWFuZCIsInJlcXVpcmVPcHRpb25zIiwibW9iaWxlVW5yZWdpc3RlcklkbGluZ1Jlc291cmNlcyIsIm1vYmlsZUxpc3RJZGxpbmdSZXNvdXJjZXMiLCJtb2JpbGVXYWl0Rm9yVUlUaHJlYWQiLCJfZGVmYXVsdCIsImRlZmF1bHQiXSwic291cmNlcyI6WyIuLi8uLi8uLi9saWIvY29tbWFuZHMvaWRsaW5nLXJlc291cmNlcy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyByZXF1aXJlT3B0aW9ucyB9IGZyb20gJy4uL3V0aWxzJztcblxuY29uc3QgY29tbWFuZHMgPSB7fTtcblxuLyoqXG4gKiBAdHlwZWRlZiB7T2JqZWN0fSBJZGxpbmdSZXNvdXJjZXNPcHRpb25zXG4gKiBAcHJvcGVydHkgeyFzdHJpbmd9IGNsYXNzTmFtZXMgLSBUaGUgY29tbWEtc2VwYXJhdGVkIGxpc3Qgb2YgaWRsaW5nIHJlc291cmNlcyBjbGFzcyBuYW1lcy5cbiAqIEVhY2ggbmFtZSBtdXN0IGJlIGEgZnVsbC1x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ts","espresso","jwproxy","command","requireOptions","mobileUnregisterIdlingResources","mobileListIdlingResources","_default","default"],"sources":["../../../lib/commands/idling-resources.js"],"sourcesContent":["import { requireOptions } from '../utils';\n\nconst commands = {};\n\n/**\n * @typedef {Object} IdlingResourcesOptions\n * @property {!string} classNames - The comma-separated list of idling resources class names.\n * Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.\n * Each class in the app source must implement a singleton pattern and have a static `getInstance()`\n * method returning the class instance, which implements `androidx.test.espresso.IdlingResource`\n * interface. Read\n * - https://developer.android.com/training/testing/espresso/idling-resource\n * - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057\n * for more details on how to design and use idling resources concept in Espresso.\n */\n\n/**\n * Registers one or more idling resources\n *\n * @param {IdlingResourcesOptions} opts\n * @throws {Error} If there was a failure while parsing options or registering\n * the actual instances\n */\ncommands.mobileRegisterIdlingResources = async function mobileRegisterIdlingResources (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/register_idling_resources', 'POST',\n requireOptions(opts, ['classNames']));\n};\n\n/**\n * Unregisters one or more idling resources\n *\n * @param {IdlingResourcesOptions} opts\n * @throws {Error} If there was a failure while parsing options or unregistering\n * the actual instances\n */\ncommands.mobileUnregisterIdlingResources = async function mobileUnregisterIdlingResources (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/unregister_idling_resources', 'POST',\n requireOptions(opts, ['classNames']));\n};\n\n/**\n * Returns a list of currently registered idling resources\n * or an empty list if no resources have been registered yet.\n *\n * @returns {Array<string>} The list of fully qualified class names\n */\ncommands.mobileListIdlingResources = async function mobileListIdlingResources () {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/list_idling_resources', 'GET');\n};\n\nexport { commands };\nexport default commands;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,GAAG,CAAC,CAAC;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AAqBpBA,QAAQ,CAACE,6BAA6B,GAAG,eAAeA,6BAA6BA,CAAEC,IAAI,GAAG,CAAC,CAAC,EAAE;EAChG,OAAO,MAAM,IAAI,CAACC,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,kDAAkD,EAAE,MAAM,EACnG,IAAAC,qBAAc,EAACJ,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC;AASDH,QAAQ,CAACQ,+BAA+B,GAAG,eAAeA,+BAA+BA,CAAEL,IAAI,GAAG,CAAC,CAAC,EAAE;EACpG,OAAO,MAAM,IAAI,CAACC,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,oDAAoD,EAAE,MAAM,EACrG,IAAAC,qBAAc,EAACJ,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC;AAQDH,QAAQ,CAACS,yBAAyB,GAAG,eAAeA,yBAAyBA,CAAA,EAAI;EAC/E,OAAO,MAAM,IAAI,CAACL,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,8CAA8C,EAAE,KAAK,CAAC;AACnG,CAAC;AAAC,
|
|
1
|
+
{"version":3,"file":"idling-resources.js","names":["_utils","require","commands","exports","mobileRegisterIdlingResources","opts","espresso","jwproxy","command","requireOptions","mobileUnregisterIdlingResources","mobileListIdlingResources","mobileWaitForUIThread","_default","default"],"sources":["../../../lib/commands/idling-resources.js"],"sourcesContent":["import { requireOptions } from '../utils';\n\nconst commands = {};\n\n/**\n * @typedef {Object} IdlingResourcesOptions\n * @property {!string} classNames - The comma-separated list of idling resources class names.\n * Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.\n * Each class in the app source must implement a singleton pattern and have a static `getInstance()`\n * method returning the class instance, which implements `androidx.test.espresso.IdlingResource`\n * interface. Read\n * - https://developer.android.com/training/testing/espresso/idling-resource\n * - https://android.jlelse.eu/integrate-espresso-idling-resources-in-your-app-to-build-flexible-ui-tests-c779e24f5057\n * for more details on how to design and use idling resources concept in Espresso.\n */\n\n/**\n * Registers one or more idling resources\n *\n * @param {IdlingResourcesOptions} opts\n * @throws {Error} If there was a failure while parsing options or registering\n * the actual instances\n */\ncommands.mobileRegisterIdlingResources = async function mobileRegisterIdlingResources (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/register_idling_resources', 'POST',\n requireOptions(opts, ['classNames']));\n};\n\n/**\n * Unregisters one or more idling resources\n *\n * @param {IdlingResourcesOptions} opts\n * @throws {Error} If there was a failure while parsing options or unregistering\n * the actual instances\n */\ncommands.mobileUnregisterIdlingResources = async function mobileUnregisterIdlingResources (opts = {}) {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/unregister_idling_resources', 'POST',\n requireOptions(opts, ['classNames']));\n};\n\n/**\n * Returns a list of currently registered idling resources\n * or an empty list if no resources have been registered yet.\n *\n * @returns {Array<string>} The list of fully qualified class names\n */\ncommands.mobileListIdlingResources = async function mobileListIdlingResources () {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/list_idling_resources', 'GET');\n};\n\n/**\n * Wait for UI thread to be idle.\n */\ncommands.mobileWaitForUIThread = async function mobileWaitForUIThread () {\n return await this.espresso.jwproxy.command('/appium/execute_mobile/ui_thread_sync', 'POST');\n};\n\nexport { commands };\nexport default commands;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,GAAG,CAAC,CAAC;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AAqBpBA,QAAQ,CAACE,6BAA6B,GAAG,eAAeA,6BAA6BA,CAAEC,IAAI,GAAG,CAAC,CAAC,EAAE;EAChG,OAAO,MAAM,IAAI,CAACC,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,kDAAkD,EAAE,MAAM,EACnG,IAAAC,qBAAc,EAACJ,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC;AASDH,QAAQ,CAACQ,+BAA+B,GAAG,eAAeA,+BAA+BA,CAAEL,IAAI,GAAG,CAAC,CAAC,EAAE;EACpG,OAAO,MAAM,IAAI,CAACC,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,oDAAoD,EAAE,MAAM,EACrG,IAAAC,qBAAc,EAACJ,IAAI,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC;AAQDH,QAAQ,CAACS,yBAAyB,GAAG,eAAeA,yBAAyBA,CAAA,EAAI;EAC/E,OAAO,MAAM,IAAI,CAACL,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,8CAA8C,EAAE,KAAK,CAAC;AACnG,CAAC;AAKDN,QAAQ,CAACU,qBAAqB,GAAG,eAAeA,qBAAqBA,CAAA,EAAI;EACvE,OAAO,MAAM,IAAI,CAACN,QAAQ,CAACC,OAAO,CAACC,OAAO,CAAC,uCAAuC,EAAE,MAAM,CAAC;AAC7F,CAAC;AAAC,IAAAK,QAAA,GAGaX,QAAQ;AAAAC,OAAA,CAAAW,OAAA,GAAAD,QAAA"}
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
* you may not use this file except in compliance with the License.
|
|
4
|
+
* See the NOTICE file distributed with this work for additional
|
|
5
|
+
* information regarding copyright ownership.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
package io.appium.espressoserver.lib.handlers
|
|
18
|
+
|
|
19
|
+
import androidx.test.espresso.UiController
|
|
20
|
+
import io.appium.espressoserver.lib.handlers.exceptions.AppiumException
|
|
21
|
+
import io.appium.espressoserver.lib.model.AppiumParams
|
|
22
|
+
import io.appium.espressoserver.lib.viewaction.UiControllerPerformer
|
|
23
|
+
import io.appium.espressoserver.lib.viewaction.UiControllerRunnable
|
|
24
|
+
|
|
25
|
+
class UIThreadSynchronizer : RequestHandler<AppiumParams, Void?> {
|
|
26
|
+
override fun handleInternal(params: AppiumParams): Void? {
|
|
27
|
+
val runnable = object : UiControllerRunnable<Void?> {
|
|
28
|
+
override fun run(uiController: UiController): Void? {
|
|
29
|
+
uiController.loopMainThreadUntilIdle()
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return UiControllerPerformer(runnable).run()
|
|
35
|
+
}
|
|
36
|
+
}
|
package/espresso-server/app/src/androidTest/java/io/appium/espressoserver/lib/http/Router.kt
CHANGED
|
@@ -143,6 +143,8 @@ internal class Router {
|
|
|
143
143
|
routeMap.addRoute(RouteDefinition(Method.POST, "/session/:sessionId/appium/execute_mobile/register_idling_resources", RegisterIdlingResources(), IdlingResourcesParams::class.java))
|
|
144
144
|
routeMap.addRoute(RouteDefinition(Method.POST, "/session/:sessionId/appium/execute_mobile/unregister_idling_resources", UnregisterIdlingResources(), IdlingResourcesParams::class.java))
|
|
145
145
|
routeMap.addRoute(RouteDefinition(Method.GET, "/session/:sessionId/appium/execute_mobile/list_idling_resources", ListIdlingResources(), AppiumParams::class.java))
|
|
146
|
+
routeMap.addRoute(RouteDefinition(Method.POST, "/session/:sessionId/appium/execute_mobile/ui_thread_sync", UIThreadSynchronizer(), AppiumParams::class.java))
|
|
147
|
+
|
|
146
148
|
|
|
147
149
|
// Not implemented
|
|
148
150
|
routeMap.addRoute(RouteDefinition(Method.POST, "/session/:sessionId/touch/flick", NotYetImplemented(), AppiumParams::class.java))
|
package/lib/commands/execute.js
CHANGED
|
@@ -73,6 +73,7 @@ extensions.executeMobile = async function executeMobile (mobileCommand, opts = {
|
|
|
73
73
|
registerIdlingResources: 'mobileRegisterIdlingResources',
|
|
74
74
|
unregisterIdlingResources: 'mobileUnregisterIdlingResources',
|
|
75
75
|
listIdlingResources: 'mobileListIdlingResources',
|
|
76
|
+
waitForUIThread: 'mobileWaitForUIThread',
|
|
76
77
|
|
|
77
78
|
unlock: 'mobileUnlock',
|
|
78
79
|
|
|
@@ -48,5 +48,12 @@ commands.mobileListIdlingResources = async function mobileListIdlingResources ()
|
|
|
48
48
|
return await this.espresso.jwproxy.command('/appium/execute_mobile/list_idling_resources', 'GET');
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Wait for UI thread to be idle.
|
|
53
|
+
*/
|
|
54
|
+
commands.mobileWaitForUIThread = async function mobileWaitForUIThread () {
|
|
55
|
+
return await this.espresso.jwproxy.command('/appium/execute_mobile/ui_thread_sync', 'POST');
|
|
56
|
+
};
|
|
57
|
+
|
|
51
58
|
export { commands };
|
|
52
59
|
export default commands;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appium-espresso-driver",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "appium-espresso-driver",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.19.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@babel/runtime": "^7.4.3",
|
|
@@ -1124,7 +1124,7 @@
|
|
|
1124
1124
|
}
|
|
1125
1125
|
},
|
|
1126
1126
|
"node_modules/@types/node": {
|
|
1127
|
-
"version": "18.15.
|
|
1127
|
+
"version": "18.15.10",
|
|
1128
1128
|
"license": "MIT"
|
|
1129
1129
|
},
|
|
1130
1130
|
"node_modules/@types/normalize-package-data": {
|
|
@@ -1379,7 +1379,7 @@
|
|
|
1379
1379
|
"license": "ISC"
|
|
1380
1380
|
},
|
|
1381
1381
|
"node_modules/appium-android-driver": {
|
|
1382
|
-
"version": "5.8.
|
|
1382
|
+
"version": "5.8.12",
|
|
1383
1383
|
"license": "Apache-2.0",
|
|
1384
1384
|
"dependencies": {
|
|
1385
1385
|
"@babel/runtime": "^7.0.0",
|
|
@@ -1445,7 +1445,7 @@
|
|
|
1445
1445
|
"license": "ISC"
|
|
1446
1446
|
},
|
|
1447
1447
|
"node_modules/appium-chromedriver": {
|
|
1448
|
-
"version": "5.3.
|
|
1448
|
+
"version": "5.3.2",
|
|
1449
1449
|
"hasInstallScript": true,
|
|
1450
1450
|
"license": "Apache-2.0",
|
|
1451
1451
|
"dependencies": {
|
|
@@ -3252,7 +3252,7 @@
|
|
|
3252
3252
|
}
|
|
3253
3253
|
},
|
|
3254
3254
|
"node_modules/mkdirp": {
|
|
3255
|
-
"version": "2.1.
|
|
3255
|
+
"version": "2.1.6",
|
|
3256
3256
|
"license": "MIT",
|
|
3257
3257
|
"bin": {
|
|
3258
3258
|
"mkdirp": "dist/cjs/src/bin.js"
|
|
@@ -3272,7 +3272,7 @@
|
|
|
3272
3272
|
}
|
|
3273
3273
|
},
|
|
3274
3274
|
"node_modules/moment-timezone": {
|
|
3275
|
-
"version": "0.5.
|
|
3275
|
+
"version": "0.5.42",
|
|
3276
3276
|
"license": "MIT",
|
|
3277
3277
|
"dependencies": {
|
|
3278
3278
|
"moment": "^2.29.4"
|
|
@@ -4575,7 +4575,7 @@
|
|
|
4575
4575
|
}
|
|
4576
4576
|
},
|
|
4577
4577
|
"node_modules/typedoc/node_modules/minimatch": {
|
|
4578
|
-
"version": "7.4.
|
|
4578
|
+
"version": "7.4.3",
|
|
4579
4579
|
"extraneous": true,
|
|
4580
4580
|
"license": "ISC",
|
|
4581
4581
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"automated testing",
|
|
8
8
|
"android"
|
|
9
9
|
],
|
|
10
|
-
"version": "2.
|
|
10
|
+
"version": "2.19.0",
|
|
11
11
|
"author": "Appium Contributors",
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
13
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"mainClass": "EspressoDriver",
|
|
41
41
|
"scripts": {
|
|
42
42
|
"print-espresso-path": "./scripts/print-espresso-path.js",
|
|
43
|
-
"build-espresso
|
|
43
|
+
"build-espresso": "./scripts/build-espresso.js"
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"main": "./build/index.js",
|