appium-remote-debugger 11.5.4 → 11.5.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 +6 -0
- package/build/lib/mixins/connect.d.ts +15 -41
- package/build/lib/mixins/connect.d.ts.map +1 -1
- package/build/lib/mixins/connect.js +80 -95
- package/build/lib/mixins/connect.js.map +1 -1
- package/build/lib/mixins/message-handlers.d.ts +4 -4
- package/build/lib/mixins/message-handlers.d.ts.map +1 -1
- package/build/lib/mixins/message-handlers.js +25 -67
- package/build/lib/mixins/message-handlers.js.map +1 -1
- package/build/lib/remote-debugger.d.ts +0 -2
- package/build/lib/remote-debugger.d.ts.map +1 -1
- package/build/lib/remote-debugger.js +0 -2
- package/build/lib/remote-debugger.js.map +1 -1
- package/build/lib/rpc/rpc-client.d.ts.map +1 -1
- package/build/lib/rpc/rpc-client.js +14 -17
- package/build/lib/rpc/rpc-client.js.map +1 -1
- package/build/lib/utils.d.ts +14 -7
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +15 -20
- package/build/lib/utils.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/mixins/connect.js +84 -105
- package/lib/mixins/message-handlers.js +30 -70
- package/lib/remote-debugger.js +1 -3
- package/lib/rpc/rpc-client.js +13 -18
- package/lib/utils.js +15 -20
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [11.5.5](https://github.com/appium/appium-remote-debugger/compare/v11.5.4...v11.5.5) (2024-07-31)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Tune page array retrieval ([#395](https://github.com/appium/appium-remote-debugger/issues/395)) ([8bb5ce3](https://github.com/appium/appium-remote-debugger/commit/8bb5ce397a0d1f642558e7012db5e6916157079e))
|
|
6
|
+
|
|
1
7
|
## [11.5.4](https://github.com/appium/appium-remote-debugger/compare/v11.5.3...v11.5.4) (2024-07-26)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} AppPages
|
|
3
|
-
* @property {string} appIdKey
|
|
4
|
-
* @property {Record<string, any>} pageDict
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {Object} App
|
|
8
|
-
* @property {string} id
|
|
9
|
-
* @property {string} bundleId
|
|
10
|
-
*/
|
|
11
1
|
/**
|
|
12
2
|
*
|
|
13
3
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
@@ -27,41 +17,25 @@ export function connect(this: import("../remote-debugger").RemoteDebugger, timeo
|
|
|
27
17
|
* @returns {Promise<void>}
|
|
28
18
|
*/
|
|
29
19
|
export function disconnect(this: import("../remote-debugger").RemoteDebugger): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* @typedef {Object} Page
|
|
32
|
-
* @property {string} url
|
|
33
|
-
* @property {string} title
|
|
34
|
-
* @property {number} id
|
|
35
|
-
* @property {boolean} isKey
|
|
36
|
-
* @property {string} [bundleId]
|
|
37
|
-
*/
|
|
38
20
|
/**
|
|
39
21
|
*
|
|
40
22
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
41
|
-
* @param {string?} currentUrl
|
|
42
|
-
* @param {number} [maxTries]
|
|
43
|
-
* @param {boolean} [ignoreAboutBlankUrl]
|
|
23
|
+
* @param {string?} [currentUrl=null]
|
|
24
|
+
* @param {number} [maxTries=SELECT_APP_RETRIES]
|
|
25
|
+
* @param {boolean} [ignoreAboutBlankUrl=false]
|
|
44
26
|
* @returns {Promise<Page[]>}
|
|
45
27
|
*/
|
|
46
|
-
export function selectApp(this: import("../remote-debugger").RemoteDebugger, currentUrl?: string | null, maxTries?: number | undefined, ignoreAboutBlankUrl?: boolean | undefined): Promise<Page[]>;
|
|
28
|
+
export function selectApp(this: import("../remote-debugger").RemoteDebugger, currentUrl?: string | null | undefined, maxTries?: number | undefined, ignoreAboutBlankUrl?: boolean | undefined): Promise<Page[]>;
|
|
47
29
|
export class selectApp {
|
|
48
|
-
/**
|
|
49
|
-
* @typedef {Object} Page
|
|
50
|
-
* @property {string} url
|
|
51
|
-
* @property {string} title
|
|
52
|
-
* @property {number} id
|
|
53
|
-
* @property {boolean} isKey
|
|
54
|
-
* @property {string} [bundleId]
|
|
55
|
-
*/
|
|
56
30
|
/**
|
|
57
31
|
*
|
|
58
32
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
59
|
-
* @param {string?} currentUrl
|
|
60
|
-
* @param {number} [maxTries]
|
|
61
|
-
* @param {boolean} [ignoreAboutBlankUrl]
|
|
33
|
+
* @param {string?} [currentUrl=null]
|
|
34
|
+
* @param {number} [maxTries=SELECT_APP_RETRIES]
|
|
35
|
+
* @param {boolean} [ignoreAboutBlankUrl=false]
|
|
62
36
|
* @returns {Promise<Page[]>}
|
|
63
37
|
*/
|
|
64
|
-
constructor(this: import("../remote-debugger").RemoteDebugger, currentUrl?: string | null, maxTries?: number | undefined, ignoreAboutBlankUrl?: boolean | undefined);
|
|
38
|
+
constructor(this: import("../remote-debugger").RemoteDebugger, currentUrl?: string | null | undefined, maxTries?: number | undefined, ignoreAboutBlankUrl?: boolean | undefined);
|
|
65
39
|
appIdKey: string | undefined;
|
|
66
40
|
}
|
|
67
41
|
/**
|
|
@@ -70,18 +44,18 @@ export class selectApp {
|
|
|
70
44
|
* @param {string?} currentUrl
|
|
71
45
|
* @param {number} maxTries
|
|
72
46
|
* @param {boolean} ignoreAboutBlankUrl
|
|
73
|
-
* @returns {Promise<
|
|
47
|
+
* @returns {Promise<AppPage>}
|
|
74
48
|
*/
|
|
75
|
-
export function searchForApp(this: import("../remote-debugger").RemoteDebugger, currentUrl: string | null, maxTries: number, ignoreAboutBlankUrl: boolean): Promise<
|
|
49
|
+
export function searchForApp(this: import("../remote-debugger").RemoteDebugger, currentUrl: string | null, maxTries: number, ignoreAboutBlankUrl: boolean): Promise<AppPage>;
|
|
76
50
|
/**
|
|
77
51
|
*
|
|
78
52
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
79
|
-
* @param {Record<string,
|
|
53
|
+
* @param {Record<string, import('../utils').AppInfo>} appsDict
|
|
80
54
|
* @param {string?} currentUrl
|
|
81
55
|
* @param {boolean} [ignoreAboutBlankUrl]
|
|
82
|
-
* @returns {
|
|
56
|
+
* @returns {AppPage?}
|
|
83
57
|
*/
|
|
84
|
-
export function searchForPage(this: import("../remote-debugger").RemoteDebugger, appsDict: Record<string,
|
|
58
|
+
export function searchForPage(this: import("../remote-debugger").RemoteDebugger, appsDict: Record<string, import("../utils").AppInfo>, currentUrl?: string | null, ignoreAboutBlankUrl?: boolean | undefined): AppPage | null;
|
|
85
59
|
/**
|
|
86
60
|
*
|
|
87
61
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
@@ -104,9 +78,9 @@ export class selectPage {
|
|
|
104
78
|
appIdKey: string;
|
|
105
79
|
pageIdKey: string | number;
|
|
106
80
|
}
|
|
107
|
-
export type
|
|
81
|
+
export type AppPage = {
|
|
108
82
|
appIdKey: string;
|
|
109
|
-
pageDict:
|
|
83
|
+
pageDict: Page;
|
|
110
84
|
};
|
|
111
85
|
export type App = {
|
|
112
86
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../lib/mixins/connect.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../lib/mixins/connect.js"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,qFAFa,OAAO,CAAC,IAAI,CAAC,CAQzB;AAED;;;;;GAKG;AACH,0GAFa,OAAO,CAAC,OAAO,eAAe,EAAE,YAAY,CAAC,CA2CzD;AAED;;;;GAIG;AACH,+EAFa,OAAO,CAAC,IAAI,CAAC,CAQzB;AAED;;;;;;;GAOG;AACH,gMAFa,OAAO,CAAC,IAAI,EAAE,CAAC,CA8C3B;;IApDD;;;;;;;OAOG;IACH,iLA4CC;IA5BK,6BAAwB;;AA8B9B;;;;;;;GAOG;AACH,4FALW,MAAM,OAAC,YACP,MAAM,uBACN,OAAO,GACL,OAAO,CAAC,OAAO,CAAC,CAwD5B;AAED;;;;;;;GAOG;AACH,2FALW,MAAM,CAAC,MAAM,EAAE,OAAO,UAAU,EAAE,OAAO,CAAC,eAC1C,MAAM,OAAC,8CAEL,OAAO,OAAC,CAmBpB;AAED;;;;;;;GAOG;AACH,wFALW,MAAM,GAAC,MAAM,aACb,MAAM,GAAC,MAAM,yCAEX,OAAO,CAAC,IAAI,CAAC,CAkBzB;;IAxBD;;;;;;;OAOG;IACH,yEALW,MAAM,GAAC,MAAM,aACb,MAAM,GAAC,MAAM,wCAoBvB;IAfC,iBAAuF;IACvF,2BAA0B;;;cA4Cd,MAAM;cACN,IAAI;;;QAKJ,MAAM;cACN,MAAM;;;SAKN,MAAM;WACN,MAAM;QACN,MAAM;WACN,OAAO"}
|
|
@@ -21,16 +21,6 @@ const SELECT_APP_RETRIES = 20;
|
|
|
21
21
|
const SELECT_APP_RETRY_SLEEP_MS = 500;
|
|
22
22
|
const SAFARI_BUNDLE_ID = 'com.apple.mobilesafari';
|
|
23
23
|
const BLANK_PAGE_URL = 'about:blank';
|
|
24
|
-
/**
|
|
25
|
-
* @typedef {Object} AppPages
|
|
26
|
-
* @property {string} appIdKey
|
|
27
|
-
* @property {Record<string, any>} pageDict
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {Object} App
|
|
31
|
-
* @property {string} id
|
|
32
|
-
* @property {string} bundleId
|
|
33
|
-
*/
|
|
34
24
|
/**
|
|
35
25
|
*
|
|
36
26
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
@@ -99,20 +89,12 @@ async function disconnect() {
|
|
|
99
89
|
this.emit(events_1.default.EVENT_DISCONNECT, true);
|
|
100
90
|
this.teardown();
|
|
101
91
|
}
|
|
102
|
-
/**
|
|
103
|
-
* @typedef {Object} Page
|
|
104
|
-
* @property {string} url
|
|
105
|
-
* @property {string} title
|
|
106
|
-
* @property {number} id
|
|
107
|
-
* @property {boolean} isKey
|
|
108
|
-
* @property {string} [bundleId]
|
|
109
|
-
*/
|
|
110
92
|
/**
|
|
111
93
|
*
|
|
112
94
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
113
|
-
* @param {string?} currentUrl
|
|
114
|
-
* @param {number} [maxTries]
|
|
115
|
-
* @param {boolean} [ignoreAboutBlankUrl]
|
|
95
|
+
* @param {string?} [currentUrl=null]
|
|
96
|
+
* @param {number} [maxTries=SELECT_APP_RETRIES]
|
|
97
|
+
* @param {boolean} [ignoreAboutBlankUrl=false]
|
|
116
98
|
* @returns {Promise<Page[]>}
|
|
117
99
|
*/
|
|
118
100
|
async function selectApp(currentUrl = null, maxTries = SELECT_APP_RETRIES, ignoreAboutBlankUrl = false) {
|
|
@@ -126,21 +108,14 @@ async function selectApp(currentUrl = null, maxTries = SELECT_APP_RETRIES, ignor
|
|
|
126
108
|
this.log.debug('No applications currently connected.');
|
|
127
109
|
return [];
|
|
128
110
|
}
|
|
129
|
-
const { appIdKey
|
|
130
|
-
// if, after all this, we have no dictionary, we have failed
|
|
131
|
-
if (!appIdKey || !pageDict) {
|
|
132
|
-
throw this.log.errorWithException(`Could not connect to a valid app after ${maxTries} tries.`);
|
|
133
|
-
}
|
|
111
|
+
const { appIdKey } = await this.searchForApp(currentUrl, maxTries, ignoreAboutBlankUrl);
|
|
134
112
|
if (this.appIdKey !== appIdKey) {
|
|
135
113
|
this.log.debug(`Received altered app id, updating from '${this.appIdKey}' to '${appIdKey}'`);
|
|
136
114
|
this.appIdKey = appIdKey;
|
|
137
115
|
}
|
|
138
|
-
logApplicationDictionary.bind(this)(
|
|
116
|
+
logApplicationDictionary.bind(this)();
|
|
139
117
|
// translate the dictionary into a useful form, and return to sender
|
|
140
|
-
|
|
141
|
-
? (0, utils_1.pageArrayFromDict)(pageDict)
|
|
142
|
-
: this.appDict[appIdKey].pageArray;
|
|
143
|
-
this.log.debug(`Finally selecting app ${this.appIdKey}: ${(0, utils_1.simpleStringify)(pageArray)}`);
|
|
118
|
+
this.log.debug(`Finally selecting app ${this.appIdKey}`);
|
|
144
119
|
/** @type {Page[]} */
|
|
145
120
|
const fullPageArray = [];
|
|
146
121
|
for (const [app, info] of lodash_1.default.toPairs(this.appDict)) {
|
|
@@ -170,78 +145,80 @@ async function selectApp(currentUrl = null, maxTries = SELECT_APP_RETRIES, ignor
|
|
|
170
145
|
* @param {string?} currentUrl
|
|
171
146
|
* @param {number} maxTries
|
|
172
147
|
* @param {boolean} ignoreAboutBlankUrl
|
|
173
|
-
* @returns {Promise<
|
|
148
|
+
* @returns {Promise<AppPage>}
|
|
174
149
|
*/
|
|
175
150
|
async function searchForApp(currentUrl, maxTries, ignoreAboutBlankUrl) {
|
|
176
151
|
const bundleIds = this.includeSafari && !this.isSafari
|
|
177
152
|
? [this.bundleId, ...this.additionalBundleIds, SAFARI_BUNDLE_ID]
|
|
178
153
|
: [this.bundleId, ...this.additionalBundleIds];
|
|
179
154
|
let retryCount = 0;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
155
|
+
return /** @type {AppPage} */ (await (0, asyncbox_1.retryInterval)(maxTries, SELECT_APP_RETRY_SLEEP_MS, async () => {
|
|
156
|
+
logApplicationDictionary.bind(this)();
|
|
157
|
+
const possibleAppIds = (0, utils_1.getPossibleDebuggerAppKeys)(/** @type {string[]} */ (bundleIds), this.appDict);
|
|
158
|
+
this.log.debug(`Trying out the possible app ids: ${possibleAppIds.join(', ')} (try #${retryCount + 1} of ${maxTries})`);
|
|
159
|
+
for (const attemptedAppIdKey of possibleAppIds) {
|
|
160
|
+
try {
|
|
161
|
+
if (!this.appDict[attemptedAppIdKey].isActive) {
|
|
162
|
+
this.log.debug(`Skipping app '${attemptedAppIdKey}' because it is not active`);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
this.log.debug(`Attempting app '${attemptedAppIdKey}'`);
|
|
166
|
+
/** @type {string} */
|
|
167
|
+
let appIdKey;
|
|
168
|
+
/** @type {import('@appium/types').StringRecord} */
|
|
169
|
+
let pageDict;
|
|
186
170
|
try {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const [appIdKey, pageDict] = await this.requireRpcClient().selectApp(attemptedAppIdKey);
|
|
193
|
-
// in iOS 8.2 the connect logic happens, but with an empty dictionary
|
|
194
|
-
// which leads to the remote debugger getting disconnected, and into a loop
|
|
195
|
-
if (lodash_1.default.isEmpty(pageDict)) {
|
|
196
|
-
this.log.debug('Empty page dictionary received. Trying again.');
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
// save the page array for this app
|
|
200
|
-
this.appDict[appIdKey].pageArray = (0, utils_1.pageArrayFromDict)(pageDict);
|
|
201
|
-
// if we are looking for a particular url, make sure we
|
|
202
|
-
// have the right page. Ignore empty or undefined urls.
|
|
203
|
-
// Ignore about:blank if requested.
|
|
204
|
-
const result = this.searchForPage(this.appDict, currentUrl, ignoreAboutBlankUrl);
|
|
205
|
-
if (result) {
|
|
206
|
-
return result;
|
|
207
|
-
}
|
|
208
|
-
if (currentUrl) {
|
|
209
|
-
this.log.debug(`Received app, but expected url ('${currentUrl}') was not found. Trying again.`);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
this.log.debug('Received app, but no match was found. Trying again.');
|
|
213
|
-
}
|
|
171
|
+
[appIdKey, pageDict] = await this.requireRpcClient().selectApp(attemptedAppIdKey);
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
this.log.info(`Skipping app '${attemptedAppIdKey}'. Original error: ${e.message}`);
|
|
175
|
+
continue;
|
|
214
176
|
}
|
|
215
|
-
|
|
216
|
-
|
|
177
|
+
// save the page array for this app
|
|
178
|
+
this.appDict[appIdKey].pageArray = (0, utils_1.pageArrayFromDict)(pageDict);
|
|
179
|
+
// if we are looking for a particular url, make sure we
|
|
180
|
+
// have the right page. Ignore empty or undefined urls.
|
|
181
|
+
// Ignore about:blank if requested.
|
|
182
|
+
const result = this.searchForPage(this.appDict, currentUrl, ignoreAboutBlankUrl);
|
|
183
|
+
if (result) {
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
if (currentUrl) {
|
|
187
|
+
this.log.debug(`Received app, but expected url ('${currentUrl}') was not found. Trying again.`);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
this.log.debug('Received app, but no match was found. Trying again.');
|
|
217
191
|
}
|
|
218
192
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
193
|
+
catch (err) {
|
|
194
|
+
this.log.debug(err.stack);
|
|
195
|
+
this.log.warn(`Error checking application ${attemptedAppIdKey}: '${err.message}'`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
retryCount++;
|
|
199
|
+
throw new Error(`Could not connect to a valid webapp. Make sure it is debuggable and has at least one active page.`);
|
|
200
|
+
}));
|
|
227
201
|
}
|
|
228
202
|
/**
|
|
229
203
|
*
|
|
230
204
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
231
|
-
* @param {Record<string,
|
|
205
|
+
* @param {Record<string, import('../utils').AppInfo>} appsDict
|
|
232
206
|
* @param {string?} currentUrl
|
|
233
207
|
* @param {boolean} [ignoreAboutBlankUrl]
|
|
234
|
-
* @returns {
|
|
208
|
+
* @returns {AppPage?}
|
|
235
209
|
*/
|
|
236
210
|
function searchForPage(appsDict, currentUrl = null, ignoreAboutBlankUrl = false) {
|
|
237
211
|
for (const appDict of lodash_1.default.values(appsDict)) {
|
|
238
|
-
if (!appDict || !appDict.isActive || !appDict.pageArray || appDict.pageArray
|
|
212
|
+
if (!appDict || !appDict.isActive || !appDict.pageArray || lodash_1.default.isEmpty(appDict.pageArray)) {
|
|
239
213
|
continue;
|
|
240
214
|
}
|
|
241
|
-
for (const
|
|
242
|
-
if ((!ignoreAboutBlankUrl ||
|
|
243
|
-
(!currentUrl ||
|
|
244
|
-
return {
|
|
215
|
+
for (const page of appDict.pageArray) {
|
|
216
|
+
if ((!ignoreAboutBlankUrl || page.url !== BLANK_PAGE_URL) &&
|
|
217
|
+
(!currentUrl || page.url === currentUrl || page.url === `${currentUrl}/`)) {
|
|
218
|
+
return {
|
|
219
|
+
appIdKey: appDict.id,
|
|
220
|
+
pageDict: page
|
|
221
|
+
};
|
|
245
222
|
}
|
|
246
223
|
}
|
|
247
224
|
}
|
|
@@ -269,21 +246,11 @@ async function selectPage(appIdKey, pageIdKey, skipReadyCheck = false) {
|
|
|
269
246
|
}
|
|
270
247
|
/**
|
|
271
248
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
272
|
-
* @param {Record<string, any>} apps
|
|
273
249
|
* @returns {void}
|
|
274
250
|
*/
|
|
275
|
-
function logApplicationDictionary(
|
|
276
|
-
function getValueString(key, value) {
|
|
277
|
-
if (lodash_1.default.isFunction(value)) {
|
|
278
|
-
return '[Function]';
|
|
279
|
-
}
|
|
280
|
-
if (key === 'pageArray' && !lodash_1.default.isArray(value)) {
|
|
281
|
-
return `"Waiting for data"`;
|
|
282
|
-
}
|
|
283
|
-
return JSON.stringify(value);
|
|
284
|
-
}
|
|
251
|
+
function logApplicationDictionary() {
|
|
285
252
|
this.log.debug('Current applications available:');
|
|
286
|
-
for (const [app, info] of lodash_1.default.toPairs(
|
|
253
|
+
for (const [app, info] of lodash_1.default.toPairs(this.appDict)) {
|
|
287
254
|
this.log.debug(` Application: "${app}"`);
|
|
288
255
|
for (const [key, value] of lodash_1.default.toPairs(info)) {
|
|
289
256
|
if (key === 'pageArray' && Array.isArray(value) && value.length) {
|
|
@@ -297,10 +264,28 @@ function logApplicationDictionary(apps) {
|
|
|
297
264
|
}
|
|
298
265
|
}
|
|
299
266
|
else {
|
|
300
|
-
const valueString =
|
|
267
|
+
const valueString = lodash_1.default.isFunction(value) ? '[Function]' : JSON.stringify(value);
|
|
301
268
|
this.log.debug(` ${key}: ${valueString}`);
|
|
302
269
|
}
|
|
303
270
|
}
|
|
304
271
|
}
|
|
305
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* @typedef {Object} AppPage
|
|
275
|
+
* @property {string} appIdKey
|
|
276
|
+
* @property {Page} pageDict
|
|
277
|
+
*/
|
|
278
|
+
/**
|
|
279
|
+
* @typedef {Object} App
|
|
280
|
+
* @property {string} id
|
|
281
|
+
* @property {string} bundleId
|
|
282
|
+
*/
|
|
283
|
+
/**
|
|
284
|
+
* @typedef {Object} Page
|
|
285
|
+
* @property {string} url
|
|
286
|
+
* @property {string} title
|
|
287
|
+
* @property {number} id
|
|
288
|
+
* @property {boolean} isKey
|
|
289
|
+
* @property {string} [bundleId]
|
|
290
|
+
*/
|
|
306
291
|
//# sourceMappingURL=connect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../lib/mixins/connect.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../lib/mixins/connect.js"],"names":[],"mappings":";;;;;AAqBA,4CAMC;AAQD,0BAyCC;AAOD,gCAMC;AAUD,8BA4CC;AAUD,oCAsDC;AAUD,sCAiBC;AAUD,gCAgBC;AApQD,oCAGkB;AAClB,sDAA8B;AAC9B,6CAAyC;AACzC,uCAA2D;AAC3D,oDAAuB;AAEvB,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAClD,MAAM,cAAc,GAAG,aAAa,CAAC;AAErC;;;;GAIG;AACI,KA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CAAC;gBAC/E,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,GAAG,KAAK,WAAW,EAAE,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG"}
|
|
@@ -16,18 +16,18 @@ export function onAppConnect(this: import("../remote-debugger").RemoteDebugger,
|
|
|
16
16
|
/**
|
|
17
17
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
18
18
|
* @param {Error?} err
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {import('@appium/types').StringRecord} dict
|
|
20
20
|
* @returns {void}
|
|
21
21
|
*/
|
|
22
|
-
export function onAppDisconnect(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict:
|
|
22
|
+
export function onAppDisconnect(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict: import("@appium/types").StringRecord): void;
|
|
23
23
|
export class onAppDisconnect {
|
|
24
24
|
/**
|
|
25
25
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
26
26
|
* @param {Error?} err
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {import('@appium/types').StringRecord} dict
|
|
28
28
|
* @returns {void}
|
|
29
29
|
*/
|
|
30
|
-
constructor(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict:
|
|
30
|
+
constructor(this: import("../remote-debugger").RemoteDebugger, err: Error | null, dict: import("@appium/types").StringRecord);
|
|
31
31
|
appIdKey: string | undefined;
|
|
32
32
|
connected: boolean | undefined;
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-handlers.d.ts","sourceRoot":"","sources":["../../../lib/mixins/message-handlers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-handlers.d.ts","sourceRoot":"","sources":["../../../lib/mixins/message-handlers.js"],"names":[],"mappings":"AAcA;;;;;;GAMG;AAEH,qFANW,KAAK,OAAC,YACN,MAAM,YACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAoCzB;AAED;;;;;GAKG;AAEH,qFALW,KAAK,OAAC,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAOzB;AAED;;;;;GAKG;AACH,wFAJW,KAAK,OAAC,QACN,OAAO,eAAe,EAAE,YAAY,GAClC,IAAI,CAuBhB;;IA3BD;;;;;OAKG;IACH,oEAJW,KAAK,OAAC,QACN,OAAO,eAAe,EAAE,YAAY,EAwB9C;IATG,6BAAsF;IAMtF,+BAAsB;;AAK1B;;;;;GAKG;AAEH,oFALW,KAAK,OAAC,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;;;GAKG;AACH,8FAJW,KAAK,OAAC,WACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,IAAI,CAKhB;;IATD;;;;;OAKG;IACH,oEAJW,KAAK,OAAC,WACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAM7B;IAFC,sBAAsD;;AAIxD;;;;;GAKG;AACH,uFAJW,KAAK,OAAC,SACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,IAAI,CAOhB;;IAXD;;;;;OAKG;IACH,oEAJW,KAAK,OAAC,SACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAQ7B;IAJC,kBAAsD;;AAMxD;;;;;GAKG;AAEH,mGALW,KAAK,OAAC,QACN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAkBzB"}
|
|
@@ -24,45 +24,32 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
24
24
|
* @param {Record<string, any>} pageDict
|
|
25
25
|
* @returns {Promise<void>}
|
|
26
26
|
*/
|
|
27
|
+
// eslint-disable-next-line require-await
|
|
27
28
|
async function onPageChange(err, appIdKey, pageDict) {
|
|
28
29
|
if (lodash_1.default.isEmpty(pageDict)) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
// we have a pre-existing pageDict
|
|
43
|
-
if (lodash_1.default.isEqual(this.appDict[appIdKey].pageArray, pageArray)) {
|
|
44
|
-
this.log.debug(`Received page change notice for app '${appIdKey}' ` +
|
|
45
|
-
`but the listing has not changed. Ignoring.`);
|
|
46
|
-
return done();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// keep track of the page dictionary
|
|
51
|
-
this.appDict[appIdKey].pageArray = pageArray;
|
|
52
|
-
}
|
|
32
|
+
const currentPages = (0, utils_1.pageArrayFromDict)(pageDict);
|
|
33
|
+
// save the page dict for this app
|
|
34
|
+
if (this.appDict[appIdKey]) {
|
|
35
|
+
const previousPages = this.appDict[appIdKey].pageArray;
|
|
36
|
+
// we have a pre-existing pageDict
|
|
37
|
+
if (previousPages && lodash_1.default.isEqual(previousPages, currentPages)) {
|
|
38
|
+
this.log.debug(`Received page change notice for app '${appIdKey}' ` +
|
|
39
|
+
`but the listing has not changed. Ignoring.`);
|
|
40
|
+
return;
|
|
53
41
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
}
|
|
42
|
+
// keep track of the page dictionary
|
|
43
|
+
this.appDict[appIdKey].pageArray = currentPages;
|
|
44
|
+
this.log.debug(`Pages changed for ${appIdKey}: ${JSON.stringify(previousPages)} -> ${JSON.stringify(currentPages)}`);
|
|
45
|
+
}
|
|
58
46
|
if (this._navigatingToPage) {
|
|
59
47
|
// in the middle of navigating, so reporting a page change will cause problems
|
|
60
48
|
return;
|
|
61
49
|
}
|
|
62
|
-
this.log.debug(`Page changed: ${(0, utils_1.simpleStringify)(pageDict, true)}`);
|
|
63
50
|
this.emit(events_1.default.EVENT_PAGE_CHANGE, {
|
|
64
51
|
appIdKey: appIdKey.replace('PID:', ''),
|
|
65
|
-
pageArray,
|
|
52
|
+
pageArray: currentPages,
|
|
66
53
|
});
|
|
67
54
|
}
|
|
68
55
|
/**
|
|
@@ -71,22 +58,16 @@ async function onPageChange(err, appIdKey, pageDict) {
|
|
|
71
58
|
* @param {Record<string, any>} dict
|
|
72
59
|
* @returns {Promise<void>}
|
|
73
60
|
*/
|
|
61
|
+
// eslint-disable-next-line require-await
|
|
74
62
|
async function onAppConnect(err, dict) {
|
|
75
63
|
const appIdKey = dict.WIRApplicationIdentifierKey;
|
|
76
64
|
this.log.debug(`Notified that new application '${appIdKey}' has connected`);
|
|
77
|
-
|
|
78
|
-
try {
|
|
79
|
-
updateAppsWithDict.bind(this)(dict);
|
|
80
|
-
}
|
|
81
|
-
finally {
|
|
82
|
-
done();
|
|
83
|
-
}
|
|
84
|
-
});
|
|
65
|
+
updateAppsWithDict.bind(this)(dict);
|
|
85
66
|
}
|
|
86
67
|
/**
|
|
87
68
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
88
69
|
* @param {Error?} err
|
|
89
|
-
* @param {
|
|
70
|
+
* @param {import('@appium/types').StringRecord} dict
|
|
90
71
|
* @returns {void}
|
|
91
72
|
*/
|
|
92
73
|
function onAppDisconnect(err, dict) {
|
|
@@ -114,15 +95,10 @@ function onAppDisconnect(err, dict) {
|
|
|
114
95
|
* @param {Record<string, any>} dict
|
|
115
96
|
* @returns {Promise<void>}
|
|
116
97
|
*/
|
|
98
|
+
// eslint-disable-next-line require-await
|
|
117
99
|
async function onAppUpdate(err, dict) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
updateAppsWithDict.bind(this)(dict);
|
|
121
|
-
}
|
|
122
|
-
finally {
|
|
123
|
-
done();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
100
|
+
this.log.debug(`Notified that an application has been updated`);
|
|
101
|
+
updateAppsWithDict.bind(this)(dict);
|
|
126
102
|
}
|
|
127
103
|
/**
|
|
128
104
|
* @this {import('../remote-debugger').RemoteDebugger}
|
|
@@ -152,6 +128,7 @@ function onCurrentState(err, state) {
|
|
|
152
128
|
* @param {Record<string, any>} apps
|
|
153
129
|
* @returns {Promise<void>}
|
|
154
130
|
*/
|
|
131
|
+
// eslint-disable-next-line require-await
|
|
155
132
|
async function onConnectedApplicationList(err, apps) {
|
|
156
133
|
this.log.debug(`Received connected applications list: ${lodash_1.default.keys(apps).join(', ')}`);
|
|
157
134
|
// translate the received information into an easier-to-manage
|
|
@@ -165,22 +142,7 @@ async function onConnectedApplicationList(err, apps) {
|
|
|
165
142
|
newDict[id] = entry;
|
|
166
143
|
}
|
|
167
144
|
// update the object's list of apps
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
lodash_1.default.defaults(this.appDict, newDict);
|
|
171
|
-
}
|
|
172
|
-
finally {
|
|
173
|
-
done();
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* @this {import('../remote-debugger').RemoteDebugger}
|
|
179
|
-
* @param {(done: () => any) => any} fn
|
|
180
|
-
* @returns {Promise<any>}
|
|
181
|
-
*/
|
|
182
|
-
async function useAppDictLock(fn) {
|
|
183
|
-
return await this._lock.acquire('appDict', fn);
|
|
145
|
+
lodash_1.default.defaults(this.appDict, newDict);
|
|
184
146
|
}
|
|
185
147
|
/**
|
|
186
148
|
*
|
|
@@ -191,17 +153,13 @@ async function useAppDictLock(fn) {
|
|
|
191
153
|
function updateAppsWithDict(dict) {
|
|
192
154
|
// get the dictionary entry into a nice form, and add it to the
|
|
193
155
|
// application dictionary
|
|
194
|
-
this.appDict
|
|
195
|
-
|
|
156
|
+
this.appDict ?? (this.appDict = {});
|
|
157
|
+
const [id, entry] = (0, utils_1.appInfoFromDict)(dict);
|
|
196
158
|
if (this.appDict[id]) {
|
|
197
159
|
// preserve the page dictionary for this entry
|
|
198
160
|
entry.pageArray = this.appDict[id].pageArray;
|
|
199
161
|
}
|
|
200
162
|
this.appDict[id] = entry;
|
|
201
|
-
// add a promise to get the page dictionary
|
|
202
|
-
if (lodash_1.default.isUndefined(entry.pageArray)) {
|
|
203
|
-
entry.pageArray = (0, utils_1.deferredPromise)();
|
|
204
|
-
}
|
|
205
163
|
// try to get the app id from our connected apps
|
|
206
164
|
if (!this.appIdKey) {
|
|
207
165
|
this.appIdKey = (0, utils_1.getDebuggerAppKey)(/** @type {string} */ (this.bundleId), this.appDict);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-handlers.js","sourceRoot":"","sources":["../../../lib/mixins/message-handlers.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"message-handlers.js","sourceRoot":"","sources":["../../../lib/mixins/message-handlers.js"],"names":[],"mappings":";;;;;AAsBA,oCAiCC;AASD,oCAIC;AAQD,0CAqBC;AASD,kCAGC;AAQD,sDAGC;AAQD,wCAKC;AASD,gEAeC;AA7JD,sDAA8B;AAC9B,oCAIkB;AAClB,oDAAuB;AAGvB;;;GAGG;AAEH;;;;;;GAMG;AACH,yCAAyC;AAClC,KAAK,UAAU,YAAY,CAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ;IACzD,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,yBAAiB,EAAC,QAAQ,CAAC,CAAC;IACjD,kCAAkC;IAClC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC;QACvD,kCAAkC;QAClC,IAAI,aAAa,IAAI,gBAAC,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,GAAG,CAAC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