appium-remote-debugger 8.12.0 → 9.0.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/README.md +0 -1
- package/build/index.js +5 -5
- package/build/lib/atoms.js +4 -4
- package/build/lib/logger.js +3 -3
- package/build/lib/mixins/connect.js +4 -4
- package/build/lib/mixins/execute.js +7 -7
- package/build/lib/mixins/index.js +3 -2
- package/build/lib/mixins/navigate.js +7 -7
- package/build/lib/protocol/index.js +1 -1
- package/build/lib/remote-debugger-real-device.js +2 -1
- package/build/lib/remote-debugger.js +11 -4
- package/build/lib/rpc/index.js +4 -4
- package/build/lib/rpc/remote-messages.js +1 -1
- package/build/lib/rpc/rpc-client-real-device.js +3 -2
- package/build/lib/rpc/rpc-client-simulator.js +3 -2
- package/build/lib/rpc/rpc-client.js +19 -12
- package/build/lib/rpc/rpc-message-handler.js +5 -5
- package/build/lib/utils.js +10 -10
- package/lib/atoms.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/mixins/connect.js +1 -1
- package/lib/mixins/execute.js +10 -3
- package/lib/mixins/navigate.js +1 -1
- package/lib/remote-debugger-real-device.js +1 -0
- package/lib/remote-debugger.js +8 -0
- package/lib/rpc/rpc-client-real-device.js +1 -0
- package/lib/rpc/rpc-client-simulator.js +1 -0
- package/lib/rpc/rpc-client.js +10 -4
- package/lib/rpc/rpc-message-handler.js +1 -1
- package/lib/utils.js +2 -2
- package/package.json +14 -12
package/lib/atoms.js
CHANGED
package/lib/logger.js
CHANGED
package/lib/mixins/connect.js
CHANGED
|
@@ -2,7 +2,7 @@ import log from '../logger';
|
|
|
2
2
|
import { appInfoFromDict, pageArrayFromDict, getDebuggerAppKey,
|
|
3
3
|
getPossibleDebuggerAppKeys, simpleStringify, deferredPromise } from '../utils';
|
|
4
4
|
import events from './events';
|
|
5
|
-
import { timing } from 'appium
|
|
5
|
+
import { timing } from '@appium/support';
|
|
6
6
|
import { retryInterval, waitForCondition } from 'asyncbox';
|
|
7
7
|
import _ from 'lodash';
|
|
8
8
|
|
package/lib/mixins/execute.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import log from '../logger';
|
|
2
|
-
import { errors } from 'appium
|
|
2
|
+
import { errors } from '@appium/base-driver';
|
|
3
3
|
import { checkParams, simpleStringify, convertResult, RESPONSE_LOG_LENGTH } from '../utils';
|
|
4
4
|
import { getScriptForAtom } from '../atoms';
|
|
5
|
-
import { util, timing } from 'appium
|
|
5
|
+
import { util, timing } from '@appium/support';
|
|
6
6
|
import { retryInterval } from 'asyncbox';
|
|
7
7
|
import _ from 'lodash';
|
|
8
8
|
|
|
@@ -10,12 +10,19 @@ import _ from 'lodash';
|
|
|
10
10
|
/* How many milliseconds to wait for webkit to return a response before timing out */
|
|
11
11
|
const RPC_RESPONSE_TIMEOUT_MS = 5000;
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Execute a Selenium atom in Safari
|
|
15
|
+
* @param {string} atom Name of Selenium atom (see atoms/ directory)
|
|
16
|
+
* @param {Array<*>} args Arguments passed to the atom
|
|
17
|
+
* @param {Array<string>} frames
|
|
18
|
+
* @returns {string} The result received from the atom
|
|
19
|
+
*/
|
|
13
20
|
async function executeAtom (atom, args, frames) {
|
|
14
21
|
if (!this.rpcClient.isConnected) {
|
|
15
22
|
throw new Error('Remote debugger is not connected');
|
|
16
23
|
}
|
|
17
24
|
|
|
18
|
-
log.debug(`Executing atom '${atom}'`);
|
|
25
|
+
log.debug(`Executing atom '${atom}' with 'args=${JSON.stringify(args)}; frames=${frames}'`);
|
|
19
26
|
const script = await getScriptForAtom(atom, args, frames);
|
|
20
27
|
const value = await this.execute(script, true);
|
|
21
28
|
log.debug(`Received result for atom '${atom}' execution: ${_.truncate(simpleStringify(value), {length: RESPONSE_LOG_LENGTH})}`);
|
package/lib/mixins/navigate.js
CHANGED
|
@@ -23,6 +23,7 @@ export default class RemoteDebuggerRealDevice extends RemoteDebugger {
|
|
|
23
23
|
logAllCommunication: this.logAllCommunication,
|
|
24
24
|
logAllCommunicationHexDump: this.logAllCommunicationHexDump,
|
|
25
25
|
socketChunkSize: this.socketChunkSize,
|
|
26
|
+
webInspectorMaxFrameLength: this.webInspectorMaxFrameLength,
|
|
26
27
|
udid: this.udid
|
|
27
28
|
});
|
|
28
29
|
}
|
package/lib/remote-debugger.js
CHANGED
|
@@ -39,6 +39,8 @@ class RemoteDebugger extends EventEmitter {
|
|
|
39
39
|
* - logAllCommunication - log plists sent and received from Web Inspector
|
|
40
40
|
* - logAllCommunicationHexDump - log communication from Web Inspector as hex dump
|
|
41
41
|
* - socketChunkSize - size, in bytes, of chunks of data sent to Web Inspector (real device only)
|
|
42
|
+
* - webInspectorMaxFrameLength - The maximum size in bytes of a single data frame
|
|
43
|
+
* in the device communication protocol
|
|
42
44
|
*/
|
|
43
45
|
constructor (opts = {}) {
|
|
44
46
|
super();
|
|
@@ -64,6 +66,7 @@ class RemoteDebugger extends EventEmitter {
|
|
|
64
66
|
logFullResponse = false,
|
|
65
67
|
logAllCommunication = false,
|
|
66
68
|
logAllCommunicationHexDump = false,
|
|
69
|
+
webInspectorMaxFrameLength,
|
|
67
70
|
socketChunkSize,
|
|
68
71
|
fullPageInitialization,
|
|
69
72
|
} = opts;
|
|
@@ -89,6 +92,10 @@ class RemoteDebugger extends EventEmitter {
|
|
|
89
92
|
this.logAllCommunicationHexDump = logAllCommunicationHexDump;
|
|
90
93
|
this.socketChunkSize = socketChunkSize;
|
|
91
94
|
|
|
95
|
+
if (_.isInteger(webInspectorMaxFrameLength)) {
|
|
96
|
+
this.webInspectorMaxFrameLength = webInspectorMaxFrameLength;
|
|
97
|
+
}
|
|
98
|
+
|
|
92
99
|
this.fullPageInitialization = fullPageInitialization;
|
|
93
100
|
|
|
94
101
|
this._lock = new AsyncLock();
|
|
@@ -133,6 +140,7 @@ class RemoteDebugger extends EventEmitter {
|
|
|
133
140
|
logAllCommunication: this.logAllCommunication,
|
|
134
141
|
logAllCommunicationHexDump: this.logAllCommunicationHexDump,
|
|
135
142
|
fullPageInitialization: this.fullPageInitialization,
|
|
143
|
+
webInspectorMaxFrameLength: this.webInspectorMaxFrameLength,
|
|
136
144
|
});
|
|
137
145
|
}
|
|
138
146
|
|
|
@@ -23,6 +23,7 @@ export default class RpcClientRealDevice extends RpcClient {
|
|
|
23
23
|
verbose: this.logAllCommunication,
|
|
24
24
|
verboseHexDump: this.logAllCommunicationHexDump,
|
|
25
25
|
socketChunkSize: this.socketChunkSize,
|
|
26
|
+
maxFrameLength: this.webInspectorMaxFrameLength,
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
this.service.listenMessage(this.receive.bind(this));
|
|
@@ -79,6 +79,7 @@ export default class RpcClientSimulator extends RpcClient {
|
|
|
79
79
|
osVersion: this.platformVersion,
|
|
80
80
|
verbose: this.logAllCommunication,
|
|
81
81
|
verboseHexDump: this.logAllCommunicationHexDump,
|
|
82
|
+
maxFrameLength: this.webInspectorMaxFrameLength,
|
|
82
83
|
});
|
|
83
84
|
this.service.listenMessage(this.receive.bind(this));
|
|
84
85
|
|
package/lib/rpc/rpc-client.js
CHANGED
|
@@ -4,7 +4,7 @@ import log from '../logger';
|
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import B from 'bluebird';
|
|
6
6
|
import RpcMessageHandler from './rpc-message-handler';
|
|
7
|
-
import { util, timing } from 'appium
|
|
7
|
+
import { util, timing } from '@appium/support';
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
const DATA_LOG_LENGTH = {length: 200};
|
|
@@ -38,6 +38,7 @@ export default class RpcClient {
|
|
|
38
38
|
isSafari = true,
|
|
39
39
|
logAllCommunication = false,
|
|
40
40
|
logAllCommunicationHexDump = false,
|
|
41
|
+
webInspectorMaxFrameLength,
|
|
41
42
|
socketChunkSize,
|
|
42
43
|
fullPageInitialization = false,
|
|
43
44
|
} = opts;
|
|
@@ -52,6 +53,7 @@ export default class RpcClient {
|
|
|
52
53
|
this.logAllCommunication = logAllCommunication;
|
|
53
54
|
this.logAllCommunicationHexDump = logAllCommunicationHexDump;
|
|
54
55
|
this.socketChunkSize = socketChunkSize;
|
|
56
|
+
this.webInspectorMaxFrameLength = webInspectorMaxFrameLength;
|
|
55
57
|
|
|
56
58
|
this.fullPageInitialization = fullPageInitialization;
|
|
57
59
|
|
|
@@ -172,12 +174,16 @@ export default class RpcClient {
|
|
|
172
174
|
}
|
|
173
175
|
return await this.sendToDevice(command, opts, waitForResponse);
|
|
174
176
|
} catch (err) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
+
let { message = '' } = err;
|
|
178
|
+
message = message.toLowerCase();
|
|
179
|
+
if (message.includes(`'target' domain was not found`)) {
|
|
180
|
+
log.info('The target device does not support Target based communication. ' +
|
|
177
181
|
'Will follow non-target based communication.');
|
|
178
182
|
this.isTargetBased = false;
|
|
179
183
|
return await this.sendToDevice(command, opts, waitForResponse);
|
|
180
|
-
} else if (
|
|
184
|
+
} else if (message.includes(`domain was not found`) ||
|
|
185
|
+
message.includes(`some arguments of method`) ||
|
|
186
|
+
message.includes(`missing target`)) {
|
|
181
187
|
this.isTargetBased = true;
|
|
182
188
|
await this.waitForTarget(appIdKey, pageIdKey);
|
|
183
189
|
return await this.sendToDevice(command, opts, waitForResponse);
|
package/lib/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import log from './logger';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import B from 'bluebird';
|
|
4
|
-
import { errorFromMJSONWPStatusCode } from 'appium
|
|
5
|
-
import { util } from 'appium
|
|
4
|
+
import { errorFromMJSONWPStatusCode } from '@appium/base-driver';
|
|
5
|
+
import { util } from '@appium/support';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
const WEB_CONTENT_BUNDLE_ID = 'com.apple.WebKit.WebContent';
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"keywords": [
|
|
5
5
|
"appium"
|
|
6
6
|
],
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "9.0.0",
|
|
8
8
|
"author": "appium",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"repository": {
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"atoms"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@appium/base-driver": "^8.0.0",
|
|
34
|
+
"@appium/support": "^2.55.3",
|
|
33
35
|
"@babel/runtime": "^7.0.0",
|
|
34
|
-
"appium-
|
|
35
|
-
"appium-ios-device": "^1.2.1",
|
|
36
|
-
"appium-support": "^2.41.0",
|
|
36
|
+
"appium-ios-device": "^2.0.0",
|
|
37
37
|
"async-lock": "^1.2.2",
|
|
38
38
|
"asyncbox": "^2.6.0",
|
|
39
39
|
"bluebird": "^3.4.7",
|
|
40
40
|
"lodash": "^4.17.11",
|
|
41
|
-
"source-map-support": "^0.
|
|
41
|
+
"source-map-support": "^0.x"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"prepare": "gulp prepublish",
|
|
@@ -63,18 +63,20 @@
|
|
|
63
63
|
"precommit-test"
|
|
64
64
|
],
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"
|
|
67
|
-
"appium-
|
|
68
|
-
"appium-ios-simulator": "^
|
|
66
|
+
"@appium/gulp-plugins": "^6.0.0",
|
|
67
|
+
"@appium/eslint-config-appium": "^5.0.0",
|
|
68
|
+
"appium-ios-simulator": "^4.0.0",
|
|
69
69
|
"chai": "^4.1.2",
|
|
70
70
|
"chai-as-promised": "^7.1.1",
|
|
71
|
-
"
|
|
72
|
-
"fancy-log": "^1.3.3",
|
|
71
|
+
"fancy-log": "^2.0.0",
|
|
73
72
|
"finalhandler": "^1.1.2",
|
|
74
73
|
"gulp": "^4.0.0",
|
|
75
|
-
"mocha": "^
|
|
74
|
+
"mocha": "^9.0.0",
|
|
75
|
+
"mocha-junit-reporter": "^2.0.0",
|
|
76
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
76
77
|
"node-simctl": "^6.0.2",
|
|
77
78
|
"pre-commit": "^1.1.3",
|
|
78
|
-
"serve-static": "^1.14.1"
|
|
79
|
+
"serve-static": "^1.14.1",
|
|
80
|
+
"sinon": "^12.0.0"
|
|
79
81
|
}
|
|
80
82
|
}
|