appium-remote-debugger 12.1.3 → 12.1.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/build/lib/atoms.js +1 -1
- package/build/lib/atoms.js.map +1 -1
- package/build/lib/mixins/connect.js +3 -3
- package/build/lib/mixins/connect.js.map +1 -1
- package/build/lib/mixins/execute.js +1 -1
- package/build/lib/mixins/execute.js.map +1 -1
- package/build/lib/mixins/message-handlers.d.ts.map +1 -1
- package/build/lib/mixins/message-handlers.js +3 -7
- package/build/lib/mixins/message-handlers.js.map +1 -1
- package/build/lib/mixins/misc.js +36 -6
- package/build/lib/mixins/misc.js.map +1 -1
- package/build/lib/mixins/navigate.js +42 -9
- package/build/lib/mixins/navigate.js.map +1 -1
- package/build/lib/remote-debugger-real-device.d.ts +1 -1
- package/build/lib/remote-debugger-real-device.d.ts.map +1 -1
- package/build/lib/remote-debugger-real-device.js +2 -5
- package/build/lib/remote-debugger-real-device.js.map +1 -1
- package/build/lib/rpc/index.d.ts +2 -2
- package/build/lib/rpc/index.d.ts.map +1 -1
- package/build/lib/rpc/index.js +4 -7
- package/build/lib/rpc/index.js.map +1 -1
- package/build/lib/rpc/remote-messages.js +2 -2
- package/build/lib/rpc/remote-messages.js.map +1 -1
- package/build/lib/rpc/rpc-client-real-device.d.ts +1 -1
- package/build/lib/rpc/rpc-client-real-device.d.ts.map +1 -1
- package/build/lib/rpc/rpc-client-real-device.js +2 -2
- package/build/lib/rpc/rpc-client-real-device.js.map +1 -1
- package/build/lib/rpc/rpc-client-simulator.d.ts +1 -1
- package/build/lib/rpc/rpc-client-simulator.d.ts.map +1 -1
- package/build/lib/rpc/rpc-client-simulator.js +3 -3
- package/build/lib/rpc/rpc-client-simulator.js.map +1 -1
- package/build/lib/rpc/rpc-client.d.ts +1 -1
- package/build/lib/rpc/rpc-client.d.ts.map +1 -1
- package/build/lib/rpc/rpc-client.js +2 -2
- package/build/lib/rpc/rpc-client.js.map +1 -1
- package/build/lib/utils.js +1 -1
- package/build/lib/utils.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/atoms.js +1 -1
- package/lib/mixins/connect.js +2 -2
- package/lib/mixins/execute.js +1 -1
- package/lib/mixins/message-handlers.js +1 -5
- package/lib/mixins/misc.js +3 -3
- package/lib/mixins/navigate.js +8 -8
- package/lib/remote-debugger-real-device.ts +1 -1
- package/lib/rpc/index.js +2 -2
- package/lib/rpc/remote-messages.js +1 -1
- package/lib/rpc/rpc-client-real-device.js +2 -2
- package/lib/rpc/rpc-client-simulator.js +2 -2
- package/lib/rpc/rpc-client.js +5 -5
- package/lib/rpc/rpc-message-handler.js +1 -1
- package/lib/utils.js +2 -2
- package/package.json +3 -3
- package/scripts/common.js +1 -1
package/lib/atoms.js
CHANGED
|
@@ -28,7 +28,7 @@ async function getAtom (atomName) {
|
|
|
28
28
|
const atomFileName = path.resolve(getModuleRoot(), 'atoms', `${atomName}.js`);
|
|
29
29
|
try {
|
|
30
30
|
ATOMS_CACHE[atomName] = await fs.readFile(atomFileName);
|
|
31
|
-
} catch
|
|
31
|
+
} catch {
|
|
32
32
|
throw new Error(`Unable to load Atom '${atomName}' from file '${atomFileName}'`);
|
|
33
33
|
}
|
|
34
34
|
}
|
package/lib/mixins/connect.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
WEB_CONTENT_BUNDLE_ID,
|
|
4
4
|
appIdsForBundle,
|
|
5
5
|
} from '../utils';
|
|
6
|
-
import events from './events';
|
|
6
|
+
import { events } from './events';
|
|
7
7
|
import { timing, util } from '@appium/support';
|
|
8
8
|
import { retryInterval, waitForCondition } from 'asyncbox';
|
|
9
9
|
import _ from 'lodash';
|
|
@@ -85,7 +85,7 @@ export async function connect (timeout = APP_CONNECT_TIMEOUT_MS) {
|
|
|
85
85
|
`Retrieved ${util.pluralize('application', _.size(getAppDict(this)), true)} ` +
|
|
86
86
|
`within ${timer.getDuration().asMilliSeconds.toFixed(0)}ms`
|
|
87
87
|
);
|
|
88
|
-
} catch
|
|
88
|
+
} catch {
|
|
89
89
|
this.log.debug(`Timed out waiting for applications to be reported`);
|
|
90
90
|
}
|
|
91
91
|
}
|
package/lib/mixins/execute.js
CHANGED
|
@@ -122,7 +122,7 @@ export async function executeAtomAsync (atom, args = [], frames = []) {
|
|
|
122
122
|
await this.executeAtom(
|
|
123
123
|
'execute_script', [`delete window.${promiseName};`, [null, null], subcommandTimeout], frames
|
|
124
124
|
);
|
|
125
|
-
} catch
|
|
125
|
+
} catch {}
|
|
126
126
|
}
|
|
127
127
|
return convertResult(res);
|
|
128
128
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import events from './events';
|
|
1
|
+
import { events } from './events';
|
|
2
2
|
import {
|
|
3
3
|
pageArrayFromDict,
|
|
4
4
|
appInfoFromDict,
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
* @param {Record<string, any>} pageDict
|
|
28
28
|
* @returns {Promise<void>}
|
|
29
29
|
*/
|
|
30
|
-
// eslint-disable-next-line require-await
|
|
31
30
|
export async function onPageChange (err, appIdKey, pageDict) {
|
|
32
31
|
if (_.isEmpty(pageDict)) {
|
|
33
32
|
return;
|
|
@@ -69,7 +68,6 @@ export async function onPageChange (err, appIdKey, pageDict) {
|
|
|
69
68
|
* @param {Record<string, any>} dict
|
|
70
69
|
* @returns {Promise<void>}
|
|
71
70
|
*/
|
|
72
|
-
// eslint-disable-next-line require-await
|
|
73
71
|
export async function onAppConnect (err, dict) {
|
|
74
72
|
const appIdKey = dict.WIRApplicationIdentifierKey;
|
|
75
73
|
this.log.debug(`Notified that new application '${appIdKey}' has connected`);
|
|
@@ -110,7 +108,6 @@ export function onAppDisconnect (err, dict) {
|
|
|
110
108
|
* @param {Record<string, any>} dict
|
|
111
109
|
* @returns {Promise<void>}
|
|
112
110
|
*/
|
|
113
|
-
// eslint-disable-next-line require-await
|
|
114
111
|
export async function onAppUpdate (err, dict) {
|
|
115
112
|
this.log.debug(`Notified that an application has been updated`);
|
|
116
113
|
updateAppsWithDict.bind(this)(dict);
|
|
@@ -146,7 +143,6 @@ export function onCurrentState (err, state) {
|
|
|
146
143
|
* @param {Record<string, any>} apps
|
|
147
144
|
* @returns {Promise<void>}
|
|
148
145
|
*/
|
|
149
|
-
// eslint-disable-next-line require-await
|
|
150
146
|
export async function onConnectedApplicationList (err, apps) {
|
|
151
147
|
this.log.debug(`Received connected applications list: ${_.keys(apps).join(', ')}`);
|
|
152
148
|
|
package/lib/mixins/misc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { checkParams } from '../utils';
|
|
2
|
-
import B from 'bluebird';
|
|
2
|
+
import B, { TimeoutError as BTimeoutError } from 'bluebird';
|
|
3
3
|
import {
|
|
4
4
|
getAppIdKey,
|
|
5
5
|
getPageIdKey,
|
|
@@ -72,7 +72,7 @@ export async function garbageCollect (timeoutMs = GARBAGE_COLLECT_TIMEOUT_MS) {
|
|
|
72
72
|
appIdKey: getAppIdKey(this),
|
|
73
73
|
pageIdKey: getPageIdKey(this),
|
|
74
74
|
});
|
|
75
|
-
} catch
|
|
75
|
+
} catch {
|
|
76
76
|
this.log.debug(`Unable to collect garbage at this time`);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
@@ -86,7 +86,7 @@ export async function garbageCollect (timeoutMs = GARBAGE_COLLECT_TIMEOUT_MS) {
|
|
|
86
86
|
).timeout(timeoutMs);
|
|
87
87
|
this.log.debug(`Garbage collection successful`);
|
|
88
88
|
} catch (e) {
|
|
89
|
-
if (e instanceof
|
|
89
|
+
if (e instanceof BTimeoutError) {
|
|
90
90
|
this.log.debug(`Garbage collection timed out after ${timeoutMs}ms`);
|
|
91
91
|
} else {
|
|
92
92
|
this.log.debug(`Unable to collect garbage: ${e.message}`);
|
package/lib/mixins/navigate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { checkParams, pageArrayFromDict } from '../utils';
|
|
2
|
-
import events from './events';
|
|
2
|
+
import { events } from './events';
|
|
3
3
|
import { timing, util } from '@appium/support';
|
|
4
4
|
import _ from 'lodash';
|
|
5
|
-
import B from 'bluebird';
|
|
5
|
+
import B, { TimeoutError as BTimeoutError } from 'bluebird';
|
|
6
6
|
import { errors } from '@appium/base-driver';
|
|
7
7
|
import { rpcConstants } from '../rpc';
|
|
8
8
|
import {
|
|
@@ -128,7 +128,7 @@ export async function waitForDom (startPageLoadTimer) {
|
|
|
128
128
|
const cancellationPromise = B.resolve((async () => {
|
|
129
129
|
try {
|
|
130
130
|
await getPageLoadDelay(this);
|
|
131
|
-
} catch
|
|
131
|
+
} catch {}
|
|
132
132
|
})());
|
|
133
133
|
|
|
134
134
|
try {
|
|
@@ -159,7 +159,7 @@ export async function checkPageIsReady (timeoutMs) {
|
|
|
159
159
|
`The pageLoadStrategy is '${getPageLoadStartegy(this) ?? PAGE_LOAD_STRATEGY.NORMAL}'`);
|
|
160
160
|
return this.isPageLoadingCompleted(readyState);
|
|
161
161
|
} catch (err) {
|
|
162
|
-
if (!(err instanceof
|
|
162
|
+
if (!(err instanceof BTimeoutError)) {
|
|
163
163
|
throw err;
|
|
164
164
|
}
|
|
165
165
|
this.log.debug(`Page readiness check timed out after ${actualTimeoutMs}ms`);
|
|
@@ -180,7 +180,7 @@ export async function navToUrl (url) {
|
|
|
180
180
|
|
|
181
181
|
try {
|
|
182
182
|
new URL(url);
|
|
183
|
-
} catch
|
|
183
|
+
} catch {
|
|
184
184
|
throw new TypeError(`'${url}' is not a valid URL`);
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -213,7 +213,7 @@ export async function navToUrl (url) {
|
|
|
213
213
|
if (isReady && isPageLoading && onPageLoaded) {
|
|
214
214
|
return onPageLoaded();
|
|
215
215
|
}
|
|
216
|
-
} catch
|
|
216
|
+
} catch {}
|
|
217
217
|
const msLeft = PAGE_READINESS_JS_MIN_CHECK_INTERVAL_MS - pageReadyCheckStart.getDuration().asMilliSeconds;
|
|
218
218
|
if (msLeft > 0 && isPageLoading) {
|
|
219
219
|
await B.delay(msLeft);
|
|
@@ -299,7 +299,7 @@ export async function navToUrl (url) {
|
|
|
299
299
|
const cancellationPromise = B.resolve((async () => {
|
|
300
300
|
try {
|
|
301
301
|
await getPageLoadDelay(this);
|
|
302
|
-
} catch
|
|
302
|
+
} catch {}
|
|
303
303
|
})());
|
|
304
304
|
|
|
305
305
|
try {
|
|
@@ -332,7 +332,7 @@ export async function navToUrl (url) {
|
|
|
332
332
|
pageIdKey: getPageIdKey(this),
|
|
333
333
|
}, didPageFinishLoad)).timeout(CONSOLE_ENABLEMENT_TIMEOUT_MS);
|
|
334
334
|
} catch (err) {
|
|
335
|
-
if (err instanceof
|
|
335
|
+
if (err instanceof BTimeoutError) {
|
|
336
336
|
throw new errors.TimeoutError(`Could not enable console events after the page load within ` +
|
|
337
337
|
`${CONSOLE_ENABLEMENT_TIMEOUT_MS}ms. The Web Inspector/Safari may need to be restarted.`);
|
|
338
338
|
}
|
package/lib/rpc/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import RpcClientSimulator from './rpc-client-simulator';
|
|
2
|
-
import RpcClientRealDevice from './rpc-client-real-device';
|
|
1
|
+
import { RpcClientSimulator } from './rpc-client-simulator';
|
|
2
|
+
import { RpcClientRealDevice } from './rpc-client-real-device';
|
|
3
3
|
import * as rpcConstants from './constants';
|
|
4
4
|
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import log from '../logger';
|
|
2
|
-
import RpcClient from './rpc-client';
|
|
2
|
+
import { RpcClient } from './rpc-client';
|
|
3
3
|
import { services } from 'appium-ios-device';
|
|
4
4
|
|
|
5
5
|
|
|
@@ -47,7 +47,7 @@ export class RpcClientRealDevice extends RpcClient {
|
|
|
47
47
|
/**
|
|
48
48
|
* @override
|
|
49
49
|
*/
|
|
50
|
-
async sendMessage (cmd) {
|
|
50
|
+
async sendMessage (cmd) {
|
|
51
51
|
this.service.sendMessage(cmd);
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -2,7 +2,7 @@ import log from '../logger';
|
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import B from 'bluebird';
|
|
4
4
|
import net from 'net';
|
|
5
|
-
import RpcClient from './rpc-client';
|
|
5
|
+
import { RpcClient } from './rpc-client';
|
|
6
6
|
import { services } from 'appium-ios-device';
|
|
7
7
|
|
|
8
8
|
export class RpcClientSimulator extends RpcClient {
|
|
@@ -170,7 +170,7 @@ export class RpcClientSimulator extends RpcClient {
|
|
|
170
170
|
try {
|
|
171
171
|
// @ts-ignore socket must be defined
|
|
172
172
|
this.socket.removeListener('error', onSocketError);
|
|
173
|
-
} catch
|
|
173
|
+
} catch {}
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
|
package/lib/rpc/rpc-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RemoteMessages from './remote-messages';
|
|
1
|
+
import { RemoteMessages } from './remote-messages';
|
|
2
2
|
import { waitForCondition } from 'asyncbox';
|
|
3
3
|
import log from '../logger';
|
|
4
4
|
import _ from 'lodash';
|
|
@@ -435,11 +435,11 @@ export class RpcClient {
|
|
|
435
435
|
});
|
|
436
436
|
}
|
|
437
437
|
|
|
438
|
-
async connect () {
|
|
438
|
+
async connect () {
|
|
439
439
|
throw new Error(`Sub-classes need to implement a 'connect' function`);
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
async disconnect () {
|
|
442
|
+
async disconnect () {
|
|
443
443
|
this.messageHandler?.removeAllListeners();
|
|
444
444
|
}
|
|
445
445
|
|
|
@@ -448,7 +448,7 @@ export class RpcClient {
|
|
|
448
448
|
* @returns {Promise<void>}
|
|
449
449
|
*/
|
|
450
450
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
451
|
-
async sendMessage (command) {
|
|
451
|
+
async sendMessage (command) {
|
|
452
452
|
throw new Error(`Sub-classes need to implement a 'sendMessage' function`);
|
|
453
453
|
}
|
|
454
454
|
|
|
@@ -457,7 +457,7 @@ export class RpcClient {
|
|
|
457
457
|
* @returns {Promise<void>}
|
|
458
458
|
*/
|
|
459
459
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
460
|
-
async receive (data) {
|
|
460
|
+
async receive (data) {
|
|
461
461
|
throw new Error(`Sub-classes need to implement a 'receive' function`);
|
|
462
462
|
}
|
|
463
463
|
|
|
@@ -82,7 +82,7 @@ export default class RpcMessageHandler extends EventEmitters {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
async dispatchDataMessage (msgId, method, params, result, error) {
|
|
85
|
+
async dispatchDataMessage (msgId, method, params, result, error) {
|
|
86
86
|
if (!_.isEmpty(msgId)) {
|
|
87
87
|
log.debug(`Handling message (id: '${msgId}')`);
|
|
88
88
|
}
|
package/lib/utils.js
CHANGED
|
@@ -140,7 +140,7 @@ export function deferredPromise () {
|
|
|
140
140
|
let resolve;
|
|
141
141
|
/** @type {(err?: Error) => void} */
|
|
142
142
|
let reject;
|
|
143
|
-
const promise = new B((res, rej) => {
|
|
143
|
+
const promise = new B((res, rej) => {
|
|
144
144
|
resolve = res;
|
|
145
145
|
reject = rej;
|
|
146
146
|
});
|
|
@@ -164,7 +164,7 @@ export function convertResult (res) {
|
|
|
164
164
|
} else if (_.isString(res)) {
|
|
165
165
|
try {
|
|
166
166
|
res = JSON.parse(res);
|
|
167
|
-
} catch
|
|
167
|
+
} catch {
|
|
168
168
|
// we might get a serialized object, but we might not
|
|
169
169
|
// if we get here, it is just a value
|
|
170
170
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"appium"
|
|
6
6
|
],
|
|
7
|
-
"version": "12.1.
|
|
7
|
+
"version": "12.1.5",
|
|
8
8
|
"author": "Appium Contributors",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@appium/base-driver": "^9.0.0",
|
|
37
|
-
"@appium/support": "^
|
|
37
|
+
"@appium/support": "^6.0.0",
|
|
38
38
|
"appium-ios-device": "^2.0.0",
|
|
39
39
|
"asyncbox": "^3.0.0",
|
|
40
40
|
"bluebird": "^3.4.7",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"singleQuote": true
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@appium/eslint-config-appium-ts": "^
|
|
67
|
+
"@appium/eslint-config-appium-ts": "^1.x",
|
|
68
68
|
"@appium/tsconfig": "^0.x",
|
|
69
69
|
"@appium/types": "^0.x",
|
|
70
70
|
"@semantic-release/changelog": "^6.0.1",
|