appium 2.14.0 → 2.15.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright OpenJS Foundation and other contributors, https://openjsf.org/
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -21,6 +21,7 @@ export type StringRecord = import("@appium/types").StringRecord;
21
21
  export type ExternalDriver = import("@appium/types").ExternalDriver;
22
22
  export type PluginClass = import("@appium/types").PluginClass;
23
23
  export type Plugin = import("@appium/types").Plugin;
24
+ export type ExtensionCore = import("@appium/base-driver").ExtensionCore;
24
25
  export type DriverClass = import("@appium/types").DriverClass<import("@appium/types").Driver>;
25
26
  export type AppiumSessionHandler = import("@appium/types").ISessionHandler<AppiumDriverConstraints, SessionHandlerCreateResult, SessionHandlerDeleteResult>;
26
27
  export type SessionHandlerCreateResult = SessionHandlerResult<[innerSessionId: string, caps: import("@appium/types").DriverCaps<Constraints>, protocol: string | undefined]>;
@@ -174,9 +175,9 @@ export class AppiumDriver extends DriverCore<{
174
175
  * Get the appropriate plugins for a session (or sessionless plugins)
175
176
  *
176
177
  * @param {?string} sessionId - the sessionId (or null) to use to find plugins
177
- * @returns {Array} - array of plugin instances
178
+ * @returns {Array<import('@appium/types').Plugin>} - array of plugin instances
178
179
  */
179
- pluginsForSession(sessionId?: string | null): any[];
180
+ pluginsForSession(sessionId?: string | null): Array<import("@appium/types").Plugin>;
180
181
  /**
181
182
  * To get plugins for a command, we either get the plugin instances associated with the
182
183
  * particular command's session, or in the case of sessionless plugins, pull from the set of
@@ -187,12 +188,13 @@ export class AppiumDriver extends DriverCore<{
187
188
  * @param {?string} sessionId - the particular session for which to find a plugin, or null if
188
189
  * sessionless
189
190
  */
190
- pluginsToHandleCmd(cmd: string, sessionId?: string | null): any[];
191
+ pluginsToHandleCmd(cmd: string, sessionId?: string | null): import("@appium/types").Plugin[];
191
192
  /**
192
193
  * Creates instances of all of the enabled Plugin classes
194
+ * @param {string|null} driverId - ID to use for linking a driver to a plugin in logs
193
195
  * @returns {Plugin[]}
194
196
  */
195
- createPluginInstances(): Plugin[];
197
+ createPluginInstances(driverId?: string | null): Plugin[];
196
198
  /**
197
199
  *
198
200
  * @param {string} cmd
@@ -1 +1 @@
1
- {"version":3,"file":"appium.d.ts","sourceRoot":"","sources":["../../lib/appium.js"],"names":[],"mappings":"AAg7BA;;;GAGG;AACH;IAME,cAOC;IAZD;;OAEG;IACH,MAFU,QAAQ,CAAC,MAAM,CAAC,CAEgB;CAU3C;yBAKY,OAAO,eAAe,EAAE,UAAU;yBAClC,OAAO,eAAe,EAAE,UAAU;0BAClC,OAAO,eAAe,EAAE,WAAW;2BACnC,OAAO,eAAe,EAAE,YAAY;4BACpC,OAAO,eAAe,EAAE,aAAa;2BACrC,OAAO,2BAA2B,EAAE,YAAY;yBAChD,OAAO,eAAe,EAAE,UAAU;yBAClC,OAAO,eAAe,EAAE,UAAU;2BAClC,OAAO,eAAe,EAAE,YAAY;6BACpC,OAAO,eAAe,EAAE,cAAc;0BACtC,OAAO,eAAe,EAAE,WAAW;qBACnC,OAAO,eAAe,EAAE,MAAM;0BAC9B,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,MAAM,CAAC;mCAInE,OAAO,eAAe,EAAE,eAAe,CAAC,uBAAuB,EACzE,0BAA0B,EAAE,0BAA0B,CAAC;yCAI7C,oBAAoB,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAC9D,OAAS,eAAe,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAC,SAAS,CAAC,CAAC;iBAIrD,CAAC,SAAd,WAAY,IACb,OAAO,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC;yCAI/B,oBAAoB,CAAC,IAAI,CAAC;;;;;iCAM1B,CAAC;;;;;sCAQD,OAAO,4BAA4B;kCACnC,OAAO,eAAe,EAAE,aAAa,CAAC,uBAAu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OAKG;IACH,8BAHY,MAAM,OAAA,GACL,KAAK,CAAC,OAAO,eAAe,EAAE,MAAM,CAAC,CAejD;IAED;;;;;;;;;OASG;IACH,wBAJW,MAAM,cACL,MAAM,OAAA,oCASjB;IAED;;;;OAIG;IACH,iCAHW,MAAM,GAAC,IAAI,GACT,MAAM,EAAE,CAepB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,WACF,GAAG,EAAA,GACL,OAAO,CAAC;QAAC,KAAK,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,WAAW,EAAE,eAAe,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAiK1I;IAED;;;;;;;YAyBC;IAED;;;aAoBC;IAED;;;;;;;OAwBC;IAED,qCAGC;IAYD,kCAGC;IAED,sDAAgD;IAChD,gDAA0C;IAC1C,wDAAkD;CACnD;;;;;;;;;;;;;2BA/5BM,qBAAqB;6BAWC,QAAQ"}
@@ -99,16 +99,6 @@ class AppiumDriver extends base_driver_1.DriverCore {
99
99
  }
100
100
  })();
101
101
  }
102
- /**
103
- * Retrieves logger instance for the current umbrella driver instance
104
- */
105
- get log() {
106
- if (!this._log) {
107
- const instanceName = `${this.constructor.name}@${support_1.node.getObjectId(this).substring(0, 4)}`;
108
- this._log = support_1.logger.getLogger(instanceName);
109
- }
110
- return this._log;
111
- }
112
102
  /**
113
103
  * Cancel commands queueing for the umbrella Appium driver
114
104
  */
@@ -262,8 +252,11 @@ class AppiumDriver extends base_driver_1.DriverCore {
262
252
  driverInstance.relaxedSecurityEnabled = true;
263
253
  }
264
254
  // We also want to assign any new Bidi Commands that the driver has specified, including all
265
- // the standard bidi commands
266
- driverInstance.updateBidiCommands(InnerDriver.newBidiCommands ?? {});
255
+ // the standard bidi commands. But add a method existence guard since some old driver class
256
+ // instances might not have this method
257
+ if (lodash_1.default.isFunction(driverInstance.updateBidiCommands)) {
258
+ driverInstance.updateBidiCommands(InnerDriver.newBidiCommands ?? {});
259
+ }
267
260
  if (!lodash_1.default.isEmpty(this.args.denyInsecure)) {
268
261
  this.log.info('Explicitly preventing use of insecure features:');
269
262
  this.args.denyInsecure.map((a) => this.log.info(` ${a}`));
@@ -324,11 +317,10 @@ class AppiumDriver extends base_driver_1.DriverCore {
324
317
  JSON.stringify(jwpSettings));
325
318
  await driverInstance.updateSettings(jwpSettings);
326
319
  }
327
- // if the user has asked for bidi support, and the driver says that it supports bidi,
328
- // send our bidi url back to the user. The inner driver will need to have already saved any
329
- // internal bidi urls it might want to proxy to, cause we are going to overwrite that
330
- // information here!
331
- if (dCaps.webSocketUrl && driverInstance.doesSupportBidi) {
320
+ // if the user has asked for bidi support, send our bidi url back to the user. The inner
321
+ // driver will need to have already saved any internal bidi urls it might want to proxy to,
322
+ // cause we are going to overwrite that information here!
323
+ if (dCaps.webSocketUrl) {
332
324
  const { address, port, basePath } = this.args;
333
325
  const scheme = `ws${this.server.isSecure() ? 's' : ''}`;
334
326
  const host = bidiHelpers.determineBiDiHost(address);
@@ -502,12 +494,13 @@ class AppiumDriver extends base_driver_1.DriverCore {
502
494
  * Get the appropriate plugins for a session (or sessionless plugins)
503
495
  *
504
496
  * @param {?string} sessionId - the sessionId (or null) to use to find plugins
505
- * @returns {Array} - array of plugin instances
497
+ * @returns {Array<import('@appium/types').Plugin>} - array of plugin instances
506
498
  */
507
499
  pluginsForSession(sessionId = null) {
508
500
  if (sessionId) {
509
501
  if (!this.sessionPlugins[sessionId]) {
510
- this.sessionPlugins[sessionId] = this.createPluginInstances();
502
+ const driverId = (0, base_driver_1.generateDriverLogPrefix)(this.sessions[sessionId]);
503
+ this.sessionPlugins[sessionId] = this.createPluginInstances(driverId || null);
511
504
  }
512
505
  return this.sessionPlugins[sessionId];
513
506
  }
@@ -533,14 +526,19 @@ class AppiumDriver extends base_driver_1.DriverCore {
533
526
  }
534
527
  /**
535
528
  * Creates instances of all of the enabled Plugin classes
529
+ * @param {string|null} driverId - ID to use for linking a driver to a plugin in logs
536
530
  * @returns {Plugin[]}
537
531
  */
538
- createPluginInstances() {
532
+ createPluginInstances(driverId = null) {
539
533
  /** @type {Plugin[]} */
540
534
  const pluginInstances = [];
541
535
  for (const [PluginClass, name] of this.pluginClasses.entries()) {
542
536
  const cliArgs = this.getCliArgsForPlugin(name);
543
- const plugin = new PluginClass(name, cliArgs);
537
+ const plugin = new PluginClass(name, cliArgs, driverId);
538
+ if (lodash_1.default.isFunction(/** @type {Plugin & ExtensionCore} */ (plugin).updateBidiCommands)) {
539
+ // some old plugin classes don't have `updateBidiCommands`
540
+ /** @type {Plugin & ExtensionCore} */ (plugin).updateBidiCommands(PluginClass.newBidiCommands ?? {});
541
+ }
544
542
  pluginInstances.push(plugin);
545
543
  }
546
544
  return pluginInstances;
@@ -672,6 +670,12 @@ class AppiumDriver extends base_driver_1.DriverCore {
672
670
  this.log.info(`Promoting ${this.sessionlessPlugins.length} sessionless plugins to be attached ` +
673
671
  `to session ID ${sessionId}`);
674
672
  this.sessionPlugins[sessionId] = this.sessionlessPlugins;
673
+ for (const p of /** @type {(Plugin & ExtensionCore)[]} */ (this.sessionPlugins[sessionId])) {
674
+ if (lodash_1.default.isFunction(p.updateLogPrefix)) {
675
+ // some old plugin classes don't have `updateLogPrefix` yet
676
+ p.updateLogPrefix(`${(0, base_driver_1.generateDriverLogPrefix)(p)} <${(0, base_driver_1.generateDriverLogPrefix)(this.sessions[sessionId])}>`);
677
+ }
678
+ }
675
679
  this.sessionlessPlugins = [];
676
680
  }
677
681
  return res;
@@ -796,6 +800,7 @@ exports.NoDriverProxyCommandError = NoDriverProxyCommandError;
796
800
  * @typedef {import('@appium/types').ExternalDriver} ExternalDriver
797
801
  * @typedef {import('@appium/types').PluginClass} PluginClass
798
802
  * @typedef {import('@appium/types').Plugin} Plugin
803
+ * @typedef {import('@appium/base-driver').ExtensionCore} ExtensionCore
799
804
  * @typedef {import('@appium/types').DriverClass<import('@appium/types').Dri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,GAAG,KAAK,oCAAsB,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,KAAK;IAMlD;QACE,KAAK,CACH,qEAAqE;YACnE,mEAAmE;YACnE,yEAAyE;YACzE,6DAA6D,CAChE,CAAC;QAXJ;;WAEG;QACH,SAAI,GAAG,kCAAkC,CAAC;IAS1C,CAAC;CACF;AAdD,8DAcC;AAID;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;GAQG;AAEH;;;GAGG"}
@@ -1,7 +1,9 @@
1
+ import { ExtensionCore } from '@appium/base-driver';
1
2
  import WebSocket from 'ws';
2
3
  import type { IncomingMessage } from 'node:http';
3
4
  import type { AppiumDriver } from './appium';
4
- import type { ErrorBiDiCommandResponse, SuccessBiDiCommandResponse, ExternalDriver } from '@appium/types';
5
+ import type { ErrorBiDiCommandResponse, SuccessBiDiCommandResponse, ExternalDriver, Plugin } from '@appium/types';
6
+ type ExtensionPlugin = Plugin & ExtensionCore;
5
7
  type AnyDriver = ExternalDriver | AppiumDriver;
6
8
  /**
7
9
  * Clients cannot use broadcast addresses, like 0.0.0.0 or ::
@@ -21,8 +23,9 @@ export declare function onBidiConnection(this: AppiumDriver, ws: WebSocket, req:
21
23
  /**
22
24
  * @param data
23
25
  * @param driver
26
+ * @param plugins
24
27
  */
25
- export declare function onBidiMessage(this: AppiumDriver, data: Buffer, driver: AnyDriver): Promise<SuccessBiDiCommandResponse | ErrorBiDiCommandResponse>;
28
+ export declare function onBidiMessage(this: AppiumDriver, data: Buffer, driver: AnyDriver, plugins: ExtensionPlugin[]): Promise<SuccessBiDiCommandResponse | ErrorBiDiCommandResponse>;
26
29
  /**
27
30
  * Log a bidi server error
28
31
  * @param err
@@ -1 +1 @@
1
- {"version":3,"file":"bidi.d.ts","sourceRoot":"","sources":["../../lib/bidi.ts"],"names":[],"mappings":"AAMA,OAAO,SAAS,MAAM,IA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,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAiC9F;AAWD;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,eAAe,EAAE,GACzB,OAAO,CAAC,0BAA0B,GAAG,wBAAwB,CAAC,CA8ChE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAEtE"}
package/build/lib/bidi.js CHANGED
@@ -43,10 +43,10 @@ function determineBiDiHost(address) {
43
43
  function onBidiConnection(ws, req) {
44
44
  try {
45
45
  const initBiDiSocketFunc = initBidiSocket.bind(this);
46
- const { bidiHandlerDriver, proxyClient, send, sendToProxy, logSocketErr } = initBiDiSocketFunc(ws, req);
46
+ const { bidiHandlerDriver, bidiHandlerPlugins, proxyClient, send, sendToProxy, logSocketErr } = initBiDiSocketFunc(ws, req);
47
47
  const initBidiSocketHandlersFunc = initBidiSocketHandlers
48
48
  .bind(this);
49
- initBidiSocketHandlersFunc(ws, proxyClient, send, sendToProxy, bidiHandlerDriver, logSocketErr);
49
+ initBidiSocketHandlersFunc(ws, proxyClient, send, sendToProxy, bidiHandlerDriver, bidiHandlerPlugins, logSocketErr);
50
50
  if (proxyClient) {
51
51
  const initBidiProxyHandlersFunc = initBidiProxyHandlers
52
52
  .bind(bidiHandlerDriver);
@@ -54,7 +54,7 @@ function onBidiConnection(ws, req) {
54
54
  }
55
55
  const initBidiEventListenersFunc = initBidiEventListeners
56
56
  .bind(this);
57
- initBidiEventListenersFunc(ws, bidiHandlerDriver, send);
57
+ initBidiEventListenersFunc(ws, bidiHandlerDriver, bidiHandlerPlugins, send);
58
58
  }
59
59
  catch (err) {
60
60
  this.log.error(err);
@@ -64,11 +64,20 @@ function onBidiConnection(ws, req) {
64
64
  catch { }
65
65
  }
66
66
  }
67
+ function wrapCommandWithPlugins(driver, plugins, method, params) {
68
+ const [moduleName, methodName] = method.split('.');
69
+ let next = async () => await driver.executeBidiCommand(method, params);
70
+ for (const plugin of plugins.filter((p) => p.doesBidiCommandExist(moduleName, methodName))) {
71
+ next = ((_next) => async () => await plugin.executeBidiCommand(method, params, _next, driver))(next);
72
+ }
73
+ return next;
74
+ }
67
75
  /**
68
76
  * @param data
69
77
  * @param driver
78
+ * @param plugins
70
79
  */
71
- async function onBidiMessage(data, driver) {
80
+ async function onBidiMessage(data, driver, plugins) {
72
81
  let resMessage;
73
82
  let id = 0;
74
83
  const driverLog = driver.log;
@@ -89,7 +98,8 @@ async function onBidiMessage(data, driver) {
89
98
  if (!params) {
90
99
  throw new base_driver_1.errors.InvalidArgumentError(`Missing params for BiDi operation in '${dataTruncated}`);
91
100
  }
92
- const result = await driver.executeBidiCommand(method, params);
101
+ const executeWrappedCommand = wrapCommandWithPlugins(driver, plugins, method, params);
102
+ const result = await executeWrappedCommand();
93
103
  resMessage = {
94
104
  id,
95
105
  type: 'success',
@@ -140,6 +150,7 @@ function initBidiSocket(ws, req) {
140
150
  // (if no session id is included in the bidi connection request)
141
151
  let bidiHandlerDriver;
142
152
  let proxyClient = null;
153
+ const bidiHandlerPlugins = [];
143
154
  if (sessionMatch) {
144
155
  // If we found a session id, see if it matches an active session
145
156
  const sessionId = sessionMatch[1];
@@ -167,16 +178,21 @@ function initBidiSocket(ws, req) {
167
178
  throw new Error(`Got request for ${driverName} to proxy bidi connections to upstream socket with ` +
168
179
  `url ${bidiProxyUrl}, but this was not a valid url`);
169
180
  }
170
- this.log.info(`Bidi connection for ${driverName} will be proxied to ${bidiProxyUrl}`);
181
+ this.log.info(`Bidi connection for ${driverName} will be proxied to ${bidiProxyUrl}. ` +
182
+ `Plugins will not handle bidi commands`);
171
183
  proxyClient = new ws_1.default(bidiProxyUrl);
172
184
  this.bidiProxyClients[sessionId] = proxyClient;
173
185
  }
186
+ else {
187
+ bidiHandlerPlugins.push(...this.pluginsForSession(sessionId));
188
+ }
174
189
  }
175
190
  else {
176
191
  this.log.info('Bidi websocket connection made to main server');
177
192
  // no need to store the socket connection if it's to the main server since it will just
178
193
  // stay open as long as the server itself is and will close when the server closes.
179
194
  bidiHandlerDriver = this; // eslint-disable-line @typescript-eslint/no-this-alias
195
+ bidiHandlerPlugins.push(...this.pluginsForSession());
180
196
  }
181
197
  const driverLog = bidiHandlerDriver.log;
182
198
  const logSocketErr = (err) => {
@@ -201,7 +217,7 @@ function initBidiSocket(ws, req) {
201
217
  // Construct a conditional send method for proxying messages from the client to an upstream
202
218
  // bidi socket server (e.g. on a browser)
203
219
  const sendToProxy = proxyClient ? sendFactory(proxyClient) : null;
204
- return { bidiHandlerDriver, proxyClient, send, sendToProxy, logSocketErr };
220
+ return { bidiHandlerDriver, bidiHandlerPlugins, proxyClient, send, sendToProxy, logSocketErr };
205
221
  }
206
222
  /**
207
223
  * Set up handlers on upstream bidi socket we are proxying to/from
@@ -248,9 +264,10 @@ function initBidiProxyHandlers(proxyClient, ws, send) {
248
264
  * upstream socket
249
265
  * @param bidiHandlerDriver - the driver
250
266
  * handling the bidi commands
267
+ * @param bidiHandlerPlugins - plugins that might also handle bidi commands
251
268
  * @param logSocketErr - a special prefixed logger
252
269
  */
253
- function initBidiSocketHandlers(ws, proxyClient, send, sendToProxy, bidiHandlerDriver, logSocketErr) {
270
+ function initBidiSocketHandlers(ws, proxyClient, send, sendToProxy, bidiHandlerDriver, bidiHandlerPlugins, logSocketErr) {
254
271
  const driverLog = bidiHandlerDriver.log;
255
272
  // Can't do much with random errors on the connection other than log them
256
273
  ws.on('error', logSocketErr);
@@ -263,10 +280,12 @@ function initBidiSocketHandlers(ws, proxyClient, send, sendToProxy, bidiHandlerD
263
280
  ws.on('message', async (data) => {
264
281
  if (proxyClient && sendToProxy) {
265
282
  // if we're meant to proxy to an upstream bidi socket, just do that
283
+ // TODO trying to determine how this proxying behaviour would interface with plugins is too
284
+ // complex for now, so just ignore plugins in this case
266
285
  await sendToProxy(data.toString('utf8'));
267
286
  }
268
287
  else {
269
- const res = await this.onBidiMessage(data, bidiHandlerDriver);
288
+ const res = await this.onBidiMessage(data, bidiHandlerDriver, bidiHandlerPlugins);
270
289
  await send(JSON.stringify(res));
271
290
  }
272
291
  });
@@ -297,52 +316,60 @@ function initBidiSocketHandlers(ws, proxyClient, send, sendToProxy, bidiHandlerD
297
316
  * @param send - a method used to send data to the
298
317
  * client
299
318
  */
300
- function initBidiEventListeners(ws, bidiHandlerDriver, send) {
319
+ function initBidiEventListeners(ws, bidiHandlerDriver, bidiHandlerPlugins, send) {
301
320
  // If the driver emits a bidi event that should maybe get sent to the client, check to make
302
321
  // sure the client is subscribed and then pass it on
303
- const driverLog = bidiHandlerDriver.log;
304
- const driverEe = bidiHandlerDriver.eventEmitter;
305
322
  const eventLogCounts = BIDI_EVENTS_MAP.get(bidiHandlerDriver) ?? {};
306
323
  BIDI_EVENTS_MAP.set(bidiHandlerDriver, eventLogCounts);
307
- const eventListener = async ({ context, method, params = {} }) => {
308
- // if the driver didn't specify a context, use the empty context
309
- if (!context) {
310
- context = '';
311
- }
312
- if (!method || !params) {
313
- driverLog.warn(`Driver emitted a bidi event that was malformed. Require method and params keys ` +
314
- `(with optional context). But instead received: ${lodash_1.default.truncate(JSON.stringify({
315
- context,
316
- method,
317
- params,
318
- }), { length: MAX_LOGGED_DATA_LENGTH })}`);
319
- return;
320
- }
321
- if (ws.readyState !== ws_1.default.OPEN) {
322
- // if the websocket is not still 'open', then we can ignore sending these events
323
- if (ws.readyState > ws_1.default.OPEN) {
324
- // if the websocket is closed or closing, we can remove this listener as well to avoid
325
- // leaks
326
- driverEe.removeListener(constants_1.BIDI_EVENT_NAME, eventListener);
324
+ const eventListenerFactory = (extType, ext) => {
325
+ const eventListener = async ({ context, method, params = {} }) => {
326
+ // if the driver didn't specify a context, use the empty context
327
+ if (!context) {
328
+ context = '';
327
329
  }
328
- return;
329
- }
330
- const eventSubs = bidiHandlerDriver.bidiEventSubs[method];
331
- if (lodash_1.default.isArray(eventSubs) && eventSubs.includes(context)) {
332
- if (method in eventLogCounts) {
333
- ++eventLogCounts[method];
330
+ if (!method || !params) {
331
+ ext.log?.warn(// some old plugins might not have the `log` property
332
+ `${lodash_1.default.capitalize(extType)} emitted a bidi event that was malformed. Require method and params keys ` +
333
+ `(with optional context). But instead received: ${lodash_1.default.truncate(JSON.stringify({
334
+ context,
335
+ method,
336
+ params,
337
+ }), { length: MAX_LOGGED_DATA_LENGTH })}`);
338
+ return;
334
339
  }
335
- else {
336
- driverLog.info(`<-- BIDI EVENT ${method} (context: '${context}', ` +
337
- `params: ${lodash_1.default.truncate(JSON.stringify(params), { length: MAX_LOGGED_DATA_LENGTH })}). ` +
338
- `All further similar events won't be logged.`);
339
- eventLogCounts[method] = 1;
340
+ if (ws.readyState !== ws_1.default.OPEN) {
341
+ // if the websocket is not still 'open', then we can ignore sending these events
342
+ if (ws.readyState > ws_1.default.OPEN) {
343
+ // if the websocket is closed or closing, we can remove this listener as well to avoid
344
+ // leaks. Some old plugin classes might not have the `eventEmitter` property, so use an
345
+ // existence guard for now.
346
+ ext.eventEmitter?.removeListener(constants_1.BIDI_EVENT_NAME, eventListener);
347
+ }
348
+ return;
340
349
  }
341
- // now we can send the event onto the socket
342
- const ev = { type: 'event', context, method, params };
343
- await send(JSON.stringify(ev));
344
- }
350
+ const eventSubs = bidiHandlerDriver.bidiEventSubs[method];
351
+ if (lodash_1.default.isArray(eventSubs) && eventSubs.includes(context)) {
352
+ if (method in eventLogCounts) {
353
+ ++eventLogCounts[method];
354
+ }
355
+ else {
356
+ ext.log?.info(// some old plugins might not have the `log` property
357
+ `<-- BIDI EVENT ${method} (context: '${context}', ` +
358
+ `params: ${lodash_1.default.truncate(JSON.stringify(params), { length: MAX_LOGGED_DATA_LENGTH })}). ` +
359
+ `All further similar events won't be logged.`);
360
+ eventLogCounts[method] = 1;
361
+ }
362
+ // now we can send the event onto the socket
363
+ const ev = { type: 'event', context, method, params };
364
+ await send(JSON.stringify(ev));
365
+ }
366
+ };
367
+ return eventListener;
345
368
  };
346
- driverEe.on(constants_1.BIDI_EVENT_NAME, eventListener);
369
+ bidiHandlerDriver.eventEmitter.on(constants_1.BIDI_EVENT_NAME, eventListenerFactory('driver', bidiHandlerDriver));
370
+ for (const plugin of bidiHandlerPlugins) {
371
+ // some old plugins might not have the eventEmitter property
372
+ plugin.eventEmitter?.on(constants_1.BIDI_EVENT_NAME, eventListenerFactory('plugin', plugin));
373
+ }
347
374
  }
348
375
  //# sourceMappingURL=bidi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bidi.js","sourceRoot":"","sources":["../../lib/bidi.ts"],"names":[],"mappings":";;;;;AAgDA,8CAQC;AAOD,4CAgCC;AAMD,sCAiDC;AAMD,8CAEC;AA9JD,oDAAuB;AACvB,wDAAyB;AACzB,qDAE6B;AAC7B,2CAA4D;AAC5D,4CAA2B;AAC3B,sDAAyB;AACzB,mCAIiB;AAsBjB,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,uDAAuD;AACtF,MAAM,eAAe,GAA+C,IAAI,OAAO,EAAE,CAAC;AAClF,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,IAAI,CAAC,IAAA,qBAAa,EAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,uBAAe,EAAC,OAAO,KAAK,uBAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5E,MAAM,CAAC,CAA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E,CAAC,2BAAe,EAAE,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IACnF,CAAC;AACH,CAAC"}
package/lib/appium.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  GET_STATUS_COMMAND,
11
11
  promoteAppiumOptions,
12
12
  promoteAppiumOptionsForObject,
13
+ generateDriverLogPrefix,
13
14
  } from '@appium/base-driver';
14
15
  import AsyncLock from 'async-lock';
15
16
  import {
@@ -18,7 +19,7 @@ import {
18
19
  makeNonW3cCapsError,
19
20
  validateFeatures,
20
21
  } from './utils';
21
- import {util, node, logger} from '@appium/support';
22
+ import {util} from '@appium/support';
22
23
  import {getDefaultsForExtension} from './schema';
23
24
  import {DRIVER_TYPE, BIDI_BASE_PATH} from './constants';
24
25
  import * as bidiHelpers from './bidi';
@@ -140,17 +141,6 @@ class AppiumDriver extends DriverCore {
140
141
  })();
141
142
  }
142
143
 
143
- /**
144
- * Retrieves logger instance for the current umbrella driver instance
145
- */
146
- get log() {
147
- if (!this._log) {
148
- const instanceName = `${this.constructor.name}@${node.getObjectId(this).substring(0, 4)}`;
149
- this._log = logger.getLogger(instanceName);
150
- }
151
- return this._log;
152
- }
153
-
154
144
  /**
155
145
  * Cancel commands queueing for the umbrella Appium driver
156
146
  */
@@ -343,8 +333,11 @@ class AppiumDriver extends DriverCore {
343
333
  }
344
334
 
345
335
  // We also want to assign any new Bidi Commands that the driver has specified, including all
346
- // the standard bidi commands
347
- driverInstance.updateBidiCommands(InnerDriver.newBidiCommands ?? {});
336
+ // the standard bidi commands. But add a method existence guard since some old driver class
337
+ // instances might not have this method
338
+ if (_.isFunction(driverInstance.updateBidiCommands)) {
339
+ driverInstance.updateBidiCommands(InnerDriver.newBidiCommands ?? {});
340
+ }
348
341
 
349
342
  if (!_.isEmpty(this.args.denyInsecure)) {
350
343
  this.log.info('Explicitly preventing use of insecure features:');
@@ -427,11 +420,10 @@ class AppiumDriver extends DriverCore {
427
420
  await driverInstance.updateSettings(jwpSettings);
428
421
  }
429
422
 
430
- // if the user has asked for bidi support, and the driver says that it supports bidi,
431
- // send our bidi url back to the user. The inner driver will need to have already saved any
432
- // internal bidi urls it might want to proxy to, cause we are going to overwrite that
433
- // information here!
434
- if (dCaps.webSocketUrl && driverInstance.doesSupportBidi) {
423
+ // if the user has asked for bidi support, send our bidi url back to the user. The inner
424
+ // driver will need to have already saved any internal bidi urls it might want to proxy to,
425
+ // cause we are going to overwrite that information here!
426
+ if (dCaps.webSocketUrl) {
435
427
  const {address, port, basePath} = this.args;
436
428
  const scheme = `ws${this.server.isSecure() ? 's' : ''}`;
437
429
  const host = bidiHelpers.determineBiDiHost(address);
@@ -626,12 +618,13 @@ class AppiumDriver extends DriverCore {
626
618
  * Get the appropriate plugins for a session (or sessionless plugins)
627
619
  *
628
620
  * @param {?string} sessionId - the sessionId (or null) to use to find plugins
629
- * @returns {Array} - array of plugin instances
621
+ * @returns {Array<import('@appium/types').Plugin>} - array of plugin instances
630
622
  */
631
623
  pluginsForSession(sessionId = null) {
632
624
  if (sessionId) {
633
625
  if (!this.sessionPlugins[sessionId]) {
634
- this.sessionPlugins[sessionId] = this.createPluginInstances();
626
+ const driverId = generateDriverLogPrefix(this.sessions[sessionId]);
627
+ this.sessionPlugins[sessionId] = this.createPluginInstances(driverId || null);
635
628
  }
636
629
  return this.sessionPlugins[sessionId];
637
630
  }
@@ -662,14 +655,19 @@ class AppiumDriver extends DriverCore {
662
655
 
663
656
  /**
664
657
  * Creates instances of all of the enabled Plugin classes
658
+ * @param {string|null} driverId - ID to use for linking a driver to a plugin in logs
665
659
  * @returns {Plugin[]}
666
660
  */
667
- createPluginInstances() {
661
+ createPluginInstances(driverId = null) {
668
662
  /** @type {Plugin[]} */
669
663
  const pluginInstances = [];
670
664
  for (const [PluginClass, name] of this.pluginClasses.entries()) {
671
665
  const cliArgs = this.getCliArgsForPlugin(name);
672
- const plugin = new PluginClass(name, cliArgs);
666
+ const plugin = new PluginClass(name, cliArgs, driverId);
667
+ if (_.isFunction(/** @type {Plugin & ExtensionCore} */(plugin).updateBidiCommands)) {
668
+ // some old plugin classes don't have `updateBidiCommands`
669
+ /** @type {Plugin & ExtensionCore} */(plugin).updateBidiCommands(PluginClass.newBidiCommands ?? {});
670
+ }
673
671
  pluginInstances.push(plugin);
674
672
  }
675
673
  return pluginInstances;
@@ -830,6 +828,12 @@ class AppiumDriver extends DriverCore {
830
828
  `to session ID ${sessionId}`,
831
829
  );
832
830
  this.sessionPlugins[sessionId] = this.sessionlessPlugins;
831
+ for (const p of /** @type {(Plugin & ExtensionCore)[]} */(this.sessionPlugins[sessionId])) {
832
+ if (_.isFunction(p.updateLogPrefix)) {
833
+ // some old plugin classes don't have `updateLogPrefix` yet
834
+ p.updateLogPrefix(`${generateDriverLogPrefix(p)} <${generateDriverLogPrefix(this.sessions[sessionId])}>`);
835
+ }
836
+ }
833
837
  this.sessionlessPlugins = [];
834
838
  }
835
839
 
@@ -977,6 +981,7 @@ export {AppiumDriver};
977
981
  * @typedef {import('@appium/types').ExternalDriver} ExternalDriver
978
982
  * @typedef {import('@appium/types').PluginClass} PluginClass
979
983
  * @typedef {import('@appium/types').Plugin} Plugin
984
+ * @typedef {import('@appium/base-driver').ExtensionCore} ExtensionCore
980
985
  * @typedef {import('@appium/types').DriverClass<import('@appium/types').Driver>} DriverClass
981
986
  */
982
987
 
package/lib/bidi.ts CHANGED
@@ -2,6 +2,7 @@ import _ from 'lodash';
2
2
  import B from 'bluebird';
3
3
  import {
4
4
  errors,
5
+ ExtensionCore,
5
6
  } from '@appium/base-driver';
6
7
  import {BIDI_BASE_PATH, BIDI_EVENT_NAME} from './constants';
7
8
  import WebSocket from 'ws';
@@ -17,14 +18,18 @@ import type {
17
18
  ErrorBiDiCommandResponse,
18
19
  SuccessBiDiCommandResponse,
19
20
  ExternalDriver,
20
- StringRecord
21
+ StringRecord,
22
+ Plugin,
23
+ BiDiResultData
21
24
  } from '@appium/types';
22
25
 
26
+ type ExtensionPlugin = Plugin & ExtensionCore
23
27
  type AnyDriver = ExternalDriver | AppiumDriver;
24
28
  type SendData = (data: string | Buffer) => Promise<void>;
25
29
  type LogSocketError = (err: Error) => void;
26
30
  interface InitBiDiSocketResult {
27
31
  bidiHandlerDriver: AnyDriver;
32
+ bidiHandlerPlugins: ExtensionPlugin[];
28
33
  proxyClient: WebSocket | null;
29
34
  send: SendData;
30
35
  sendToProxy: SendData | null;
@@ -64,7 +69,7 @@ export function determineBiDiHost(address: string): string {
64
69
  export function onBidiConnection(this: AppiumDriver, ws: WebSocket, req: IncomingMessage): void {
65
70
  try {
66
71
  const initBiDiSocketFunc: OmitThisParameter<typeof initBidiSocket> = initBidiSocket.bind(this);
67
- const {bidiHandlerDriver, proxyClient, send, sendToProxy, logSocketErr} = initBiDiSocketFunc(
72
+ const {bidiHandlerDriver, bidiHandlerPlugins, proxyClient, send, sendToProxy, logSocketErr} = initBiDiSocketFunc(
68
73
  ws,
69
74
  req,
70
75
  );
@@ -77,6 +82,7 @@ export function onBidiConnection(this: AppiumDriver, ws: WebSocket, req: Incomin
77
82
  send,
78
83
  sendToProxy,
79
84
  bidiHandlerDriver,
85
+ bidiHandlerPlugins,
80
86
  logSocketErr,
81
87
  );
82
88
  if (proxyClient) {
@@ -86,7 +92,7 @@ export function onBidiConnection(this: AppiumDriver, ws: WebSocket, req: Incomin
86
92
  }
87
93
  const initBidiEventListenersFunc: OmitThisParameter<typeof initBidiEventListeners> = initBidiEventListeners
88
94
  .bind(this);
89
- initBidiEventListenersFunc(ws, bidiHandlerDriver, send);
95
+ initBidiEventListenersFunc(ws, bidiHandlerDriver, bidiHandlerPlugins, send);
90
96
  } catch (err) {
91
97
  this.log.error(err);
92
98
  try {
@@ -95,14 +101,25 @@ export function onBidiConnection(this: AppiumDriver, ws: WebSocket, req: Incomin
95
101
  }
96
102
  }
97
103
 
104
+ function wrapCommandWithPlugins(driver: ExtensionCore, plugins: ExtensionCore[], method: string, params: StringRecord): () => Promise<BiDiResultData> {
105
+ const [moduleName, methodName] = method.split('.');
106
+ let next = async () => await driver.executeBidiCommand(method, params);
107
+ for (const plugin of plugins.filter((p) => p.doesBidiCommandExist(moduleName, methodName))) {
108
+ next = ((_next) => async () => await plugin.executeBidiCommand(method, params, _next, driver))(next);
109
+ }
110
+ return next;
111
+ }
112
+
98
113
  /**
99
114
  * @param data
100
115
  * @param driver
116
+ * @param plugins
101
117
  */
102
118
  export async function onBidiMessage(
103
119
  this: AppiumDriver,
104
120
  data: Buffer,
105
- driver: AnyDriver
121
+ driver: AnyDriver,
122
+ plugins: ExtensionPlugin[]
106
123
  ): Promise<SuccessBiDiCommandResponse | ErrorBiDiCommandResponse> {
107
124
  let resMessage: SuccessBiDiCommandResponse | ErrorBiDiCommandResponse;
108
125
  let id: number = 0;
@@ -129,7 +146,8 @@ export async function onBidiMessage(
129
146
  `Missing params for BiDi operation in '${dataTruncated}`,
130
147
  );
131
148
  }
132
- const result = await driver.executeBidiCommand(method, params);
149
+ const executeWrappedCommand = wrapCommandWithPlugins(driver as ExtensionCore, plugins, method, params);
150
+ const result = await executeWrappedCommand();
133
151
  resMessage = {
134
152
  id,
135
153
  type: 'success',
@@ -186,6 +204,7 @@ function initBidiSocket(this: AppiumDriver, ws: WebSocket, req: IncomingMessage)
186
204
 
187
205
  let bidiHandlerDriver: AnyDriver;
188
206
  let proxyClient: WebSocket | null = null;
207
+ const bidiHandlerPlugins: ExtensionPlugin[] = [];
189
208
  if (sessionMatch) {
190
209
  // If we found a session id, see if it matches an active session
191
210
  const sessionId = sessionMatch[1];
@@ -217,15 +236,19 @@ function initBidiSocket(this: AppiumDriver, ws: WebSocket, req: IncomingMessage)
217
236
  `url ${bidiProxyUrl}, but this was not a valid url`,
218
237
  );
219
238
  }
220
- this.log.info(`Bidi connection for ${driverName} will be proxied to ${bidiProxyUrl}`);
239
+ this.log.info(`Bidi connection for ${driverName} will be proxied to ${bidiProxyUrl}. ` +
240
+ `Plugins will not handle bidi commands`);
221
241
  proxyClient = new WebSocket(bidiProxyUrl);
222
242
  this.bidiProxyClients[sessionId] = proxyClient;
243
+ } else {
244
+ bidiHandlerPlugins.push(...this.pluginsForSession(sessionId) as ExtensionPlugin[]);
223
245
  }
224
246
  } else {
225
247
  this.log.info('Bidi websocket connection made to main server');
226
248
  // no need to store the socket connection if it's to the main server since it will just
227
249
  // stay open as long as the server itself is and will close when the server closes.
228
250
  bidiHandlerDriver = this; // eslint-disable-line @typescript-eslint/no-this-alias
251
+ bidiHandlerPlugins.push(...this.pluginsForSession() as ExtensionPlugin[]);
229
252
  }
230
253
 
231
254
  const driverLog = bidiHandlerDriver.log;
@@ -254,7 +277,7 @@ function initBidiSocket(this: AppiumDriver, ws: WebSocket, req: IncomingMessage)
254
277
  // bidi socket server (e.g. on a browser)
255
278
  const sendToProxy: SendData | null = proxyClient ? sendFactory(proxyClient) : null;
256
279
 
257
- return {bidiHandlerDriver, proxyClient, send, sendToProxy, logSocketErr};
280
+ return {bidiHandlerDriver, bidiHandlerPlugins, proxyClient, send, sendToProxy, logSocketErr};
258
281
  }
259
282
 
260
283
  /**
@@ -315,6 +338,7 @@ function initBidiProxyHandlers(
315
338
  * upstream socket
316
339
  * @param bidiHandlerDriver - the driver
317
340
  * handling the bidi commands
341
+ * @param bidiHandlerPlugins - plugins that might also handle bidi commands
318
342
  * @param logSocketErr - a special prefixed logger
319
343
  */
320
344
  function initBidiSocketHandlers(
@@ -324,6 +348,7 @@ function initBidiSocketHandlers(
324
348
  send: SendData,
325
349
  sendToProxy: SendData | null,
326
350
  bidiHandlerDriver: AnyDriver,
351
+ bidiHandlerPlugins: ExtensionPlugin[],
327
352
  logSocketErr: LogSocketError,
328
353
  ): void {
329
354
  const driverLog = bidiHandlerDriver.log;
@@ -340,9 +365,11 @@ function initBidiSocketHandlers(
340
365
  ws.on('message', async (data: Buffer) => {
341
366
  if (proxyClient && sendToProxy) {
342
367
  // if we're meant to proxy to an upstream bidi socket, just do that
368
+ // TODO trying to determine how this proxying behaviour would interface with plugins is too
369
+ // complex for now, so just ignore plugins in this case
343
370
  await sendToProxy(data.toString('utf8'));
344
371
  } else {
345
- const res = await this.onBidiMessage(data, bidiHandlerDriver);
372
+ const res = await this.onBidiMessage(data, bidiHandlerDriver, bidiHandlerPlugins);
346
373
  await send(JSON.stringify(res));
347
374
  }
348
375
  });
@@ -381,56 +408,63 @@ function initBidiEventListeners(
381
408
  this: AppiumDriver,
382
409
  ws: WebSocket,
383
410
  bidiHandlerDriver: AnyDriver,
411
+ bidiHandlerPlugins: ExtensionPlugin[],
384
412
  send: SendData,
385
413
  ): void {
386
414
  // If the driver emits a bidi event that should maybe get sent to the client, check to make
387
415
  // sure the client is subscribed and then pass it on
388
- const driverLog = bidiHandlerDriver.log;
389
- const driverEe = bidiHandlerDriver.eventEmitter;
390
416
  const eventLogCounts: Record<string, number> = BIDI_EVENTS_MAP.get(bidiHandlerDriver) ?? {};
391
417
  BIDI_EVENTS_MAP.set(bidiHandlerDriver, eventLogCounts);
392
- const eventListener = async ({context, method, params = {}}) => {
393
- // if the driver didn't specify a context, use the empty context
394
- if (!context) {
395
- context = '';
396
- }
397
- if (!method || !params) {
398
- driverLog.warn(
399
- `Driver emitted a bidi event that was malformed. Require method and params keys ` +
400
- `(with optional context). But instead received: ${_.truncate(JSON.stringify({
401
- context,
402
- method,
403
- params,
404
- }), {length: MAX_LOGGED_DATA_LENGTH})}`,
405
- );
406
- return;
407
- }
408
- if (ws.readyState !== WebSocket.OPEN) {
409
- // if the websocket is not still 'open', then we can ignore sending these events
410
- if (ws.readyState > WebSocket.OPEN) {
411
- // if the websocket is closed or closing, we can remove this listener as well to avoid
412
- // leaks
413
- driverEe.removeListener(BIDI_EVENT_NAME, eventListener);
418
+ const eventListenerFactory = (extType: 'driver'|'plugin', ext: ExtensionCore) => {
419
+ const eventListener = async ({context, method, params = {}}) => {
420
+ // if the driver didn't specify a context, use the empty context
421
+ if (!context) {
422
+ context = '';
414
423
  }
415
- return;
416
- }
417
-
418
- const eventSubs = bidiHandlerDriver.bidiEventSubs[method];
419
- if (_.isArray(eventSubs) && eventSubs.includes(context)) {
420
- if (method in eventLogCounts) {
421
- ++eventLogCounts[method];
422
- } else {
423
- driverLog.info(
424
- `<-- BIDI EVENT ${method} (context: '${context}', ` +
425
- `params: ${_.truncate(JSON.stringify(params), {length: MAX_LOGGED_DATA_LENGTH})}). ` +
426
- `All further similar events won't be logged.`,
424
+ if (!method || !params) {
425
+ ext.log?.warn( // some old plugins might not have the `log` property
426
+ `${_.capitalize(extType)} emitted a bidi event that was malformed. Require method and params keys ` +
427
+ `(with optional context). But instead received: ${_.truncate(JSON.stringify({
428
+ context,
429
+ method,
430
+ params,
431
+ }), {length: MAX_LOGGED_DATA_LENGTH})}`,
427
432
  );
428
- eventLogCounts[method] = 1;
433
+ return;
429
434
  }
430
- // now we can send the event onto the socket
431
- const ev = {type: 'event', context, method, params};
432
- await send(JSON.stringify(ev));
433
- }
435
+ if (ws.readyState !== WebSocket.OPEN) {
436
+ // if the websocket is not still 'open', then we can ignore sending these events
437
+ if (ws.readyState > WebSocket.OPEN) {
438
+ // if the websocket is closed or closing, we can remove this listener as well to avoid
439
+ // leaks. Some old plugin classes might not have the `eventEmitter` property, so use an
440
+ // existence guard for now.
441
+ ext.eventEmitter?.removeListener(BIDI_EVENT_NAME, eventListener);
442
+ }
443
+ return;
444
+ }
445
+
446
+ const eventSubs = bidiHandlerDriver.bidiEventSubs[method];
447
+ if (_.isArray(eventSubs) && eventSubs.includes(context)) {
448
+ if (method in eventLogCounts) {
449
+ ++eventLogCounts[method];
450
+ } else {
451
+ ext.log?.info( // some old plugins might not have the `log` property
452
+ `<-- BIDI EVENT ${method} (context: '${context}', ` +
453
+ `params: ${_.truncate(JSON.stringify(params), {length: MAX_LOGGED_DATA_LENGTH})}). ` +
454
+ `All further similar events won't be logged.`,
455
+ );
456
+ eventLogCounts[method] = 1;
457
+ }
458
+ // now we can send the event onto the socket
459
+ const ev = {type: 'event', context, method, params};
460
+ await send(JSON.stringify(ev));
461
+ }
462
+ };
463
+ return eventListener;
434
464
  };
435
- driverEe.on(BIDI_EVENT_NAME, eventListener);
465
+ bidiHandlerDriver.eventEmitter.on(BIDI_EVENT_NAME, eventListenerFactory('driver', bidiHandlerDriver as ExtensionCore));
466
+ for (const plugin of bidiHandlerPlugins) {
467
+ // some old plugins might not have the eventEmitter property
468
+ plugin.eventEmitter?.on(BIDI_EVENT_NAME, eventListenerFactory('plugin', plugin));
469
+ }
436
470
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "description": "Automation for Apps.",
5
5
  "keywords": [
6
6
  "automation",
@@ -60,13 +60,13 @@
60
60
  "test:unit": "mocha \"./test/unit/**/*.spec.js\""
61
61
  },
62
62
  "dependencies": {
63
- "@appium/base-driver": "^9.14.0",
64
- "@appium/base-plugin": "^2.2.51",
65
- "@appium/docutils": "^1.0.27",
63
+ "@appium/base-driver": "^9.15.0",
64
+ "@appium/base-plugin": "^2.3.0",
65
+ "@appium/docutils": "^1.0.29",
66
66
  "@appium/logger": "^1.6.1",
67
67
  "@appium/schema": "^0.7.1",
68
- "@appium/support": "^6.0.1",
69
- "@appium/types": "^0.23.0",
68
+ "@appium/support": "^6.0.3",
69
+ "@appium/types": "^0.24.0",
70
70
  "@sidvind/better-ajv-errors": "3.0.1",
71
71
  "@types/argparse": "2.0.17",
72
72
  "@types/bluebird": "3.5.42",
@@ -89,7 +89,7 @@
89
89
  "resolve-from": "5.0.0",
90
90
  "semver": "7.6.3",
91
91
  "source-map-support": "0.5.21",
92
- "teen_process": "2.2.2",
92
+ "teen_process": "2.2.3",
93
93
  "type-fest": "4.31.0",
94
94
  "winston": "3.17.0",
95
95
  "wrap-ansi": "7.0.0",
@@ -103,5 +103,5 @@
103
103
  "publishConfig": {
104
104
  "access": "public"
105
105
  },
106
- "gitHead": "3fa73a1d1a95e3868fbceb005f8b1deb4ac53eaf"
106
+ "gitHead": "a7ce83e169e101ae497bab11204a73703fd54e99"
107
107
  }