appium-android-driver 5.14.7 → 6.0.1
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 +7 -0
- package/build/lib/commands/actions.d.ts +6 -224
- package/build/lib/commands/actions.d.ts.map +1 -1
- package/build/lib/commands/actions.js +306 -405
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +7 -9
- package/build/lib/commands/alert.d.ts.map +1 -1
- package/build/lib/commands/alert.js +24 -18
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +7 -313
- package/build/lib/commands/app-management.d.ts.map +1 -1
- package/build/lib/commands/app-management.js +135 -293
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/context.d.ts +8 -92
- package/build/lib/commands/context.d.ts.map +1 -1
- package/build/lib/commands/context.js +381 -439
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/element.d.ts +8 -35
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +153 -136
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/emu-console.d.ts +6 -48
- package/build/lib/commands/emu-console.d.ts.map +1 -1
- package/build/lib/commands/emu-console.js +19 -34
- package/build/lib/commands/emu-console.js.map +1 -1
- package/build/lib/commands/execute.d.ts +6 -5
- package/build/lib/commands/execute.d.ts.map +1 -1
- package/build/lib/commands/execute.js +77 -66
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +7 -128
- package/build/lib/commands/file-actions.d.ts.map +1 -1
- package/build/lib/commands/file-actions.js +183 -219
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/find.d.ts +8 -12
- package/build/lib/commands/find.d.ts.map +1 -1
- package/build/lib/commands/find.js +19 -23
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +9 -132
- package/build/lib/commands/general.d.ts.map +1 -1
- package/build/lib/commands/general.js +281 -312
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/ime.d.ts +7 -10
- package/build/lib/commands/ime.d.ts.map +1 -1
- package/build/lib/commands/ime.js +47 -35
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/index.d.ts +27 -2
- package/build/lib/commands/index.d.ts.map +1 -1
- package/build/lib/commands/index.js +41 -19
- package/build/lib/commands/index.js.map +1 -1
- package/build/lib/commands/intent.d.ts +7 -417
- package/build/lib/commands/intent.d.ts.map +1 -1
- package/build/lib/commands/intent.js +104 -216
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +6 -5
- package/build/lib/commands/keyboard.d.ts.map +1 -1
- package/build/lib/commands/keyboard.js +16 -8
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/log.d.ts +7 -44
- package/build/lib/commands/log.d.ts.map +1 -1
- package/build/lib/commands/log.js +146 -108
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +7 -143
- package/build/lib/commands/media-projection.d.ts.map +1 -1
- package/build/lib/commands/media-projection.js +113 -140
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/mixins.d.ts +740 -0
- package/build/lib/commands/mixins.d.ts.map +1 -0
- package/build/lib/commands/mixins.js +19 -0
- package/build/lib/commands/mixins.js.map +1 -0
- package/build/lib/commands/network.d.ts +7 -138
- package/build/lib/commands/network.d.ts.map +1 -1
- package/build/lib/commands/network.js +212 -254
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/performance.d.ts +24 -70
- package/build/lib/commands/performance.d.ts.map +1 -1
- package/build/lib/commands/performance.js +144 -100
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +8 -92
- package/build/lib/commands/permissions.d.ts.map +1 -1
- package/build/lib/commands/permissions.js +75 -87
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +7 -193
- package/build/lib/commands/recordscreen.d.ts.map +1 -1
- package/build/lib/commands/recordscreen.js +151 -182
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/shell.d.ts +7 -7
- package/build/lib/commands/shell.d.ts.map +1 -1
- package/build/lib/commands/shell.js +40 -33
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +9 -103
- package/build/lib/commands/streamscreen.d.ts.map +1 -1
- package/build/lib/commands/streamscreen.js +261 -218
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +22 -90
- package/build/lib/commands/system-bars.d.ts.map +1 -1
- package/build/lib/commands/system-bars.js +76 -74
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/touch.d.ts +10 -29
- package/build/lib/commands/touch.d.ts.map +1 -1
- package/build/lib/commands/touch.js +301 -285
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/commands/types.d.ts +978 -0
- package/build/lib/commands/types.d.ts.map +1 -0
- package/build/lib/commands/types.js +3 -0
- package/build/lib/commands/types.js.map +1 -0
- package/build/lib/constraints.d.ts +291 -0
- package/build/lib/constraints.d.ts.map +1 -0
- package/build/lib/{desired-caps.js → constraints.js} +103 -102
- package/build/lib/constraints.js.map +1 -0
- package/build/lib/driver.d.ts +68 -37
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +123 -80
- package/build/lib/driver.js.map +1 -1
- package/build/lib/helpers/android.d.ts +164 -0
- package/build/lib/helpers/android.d.ts.map +1 -0
- package/build/lib/helpers/android.js +819 -0
- package/build/lib/helpers/android.js.map +1 -0
- package/build/lib/helpers/index.d.ts +7 -0
- package/build/lib/helpers/index.d.ts.map +1 -0
- package/build/lib/helpers/index.js +29 -0
- package/build/lib/helpers/index.js.map +1 -0
- package/build/lib/helpers/types.d.ts +121 -0
- package/build/lib/helpers/types.d.ts.map +1 -0
- package/build/lib/helpers/types.js +3 -0
- package/build/lib/helpers/types.js.map +1 -0
- package/build/lib/helpers/unlock.d.ts +32 -0
- package/build/lib/helpers/unlock.d.ts.map +1 -0
- package/build/lib/helpers/unlock.js +273 -0
- package/build/lib/helpers/unlock.js.map +1 -0
- package/build/lib/helpers/webview.d.ts +74 -0
- package/build/lib/helpers/webview.d.ts.map +1 -0
- package/build/lib/helpers/webview.js +421 -0
- package/build/lib/helpers/webview.js.map +1 -0
- package/build/lib/index.d.ts +9 -0
- package/build/lib/index.d.ts.map +1 -0
- package/build/lib/index.js +37 -0
- package/build/lib/index.js.map +1 -0
- package/build/lib/method-map.d.ts +0 -8
- package/build/lib/method-map.d.ts.map +1 -1
- package/build/lib/method-map.js +63 -74
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/stubs.d.ts +0 -1
- package/build/lib/stubs.d.ts.map +1 -1
- package/build/lib/stubs.js +1 -0
- package/build/lib/stubs.js.map +1 -1
- package/build/lib/utils.d.ts +1 -1
- package/build/lib/utils.d.ts.map +1 -1
- package/lib/commands/actions.js +351 -464
- package/lib/commands/alert.js +27 -17
- package/lib/commands/app-management.js +156 -314
- package/lib/commands/context.js +457 -441
- package/lib/commands/element.js +201 -157
- package/lib/commands/emu-console.js +25 -45
- package/lib/commands/execute.js +106 -90
- package/lib/commands/file-actions.js +222 -240
- package/lib/commands/find.ts +103 -0
- package/lib/commands/general.js +327 -339
- package/lib/commands/ime.js +50 -34
- package/lib/commands/{index.js → index.ts} +20 -24
- package/lib/commands/intent.js +108 -249
- package/lib/commands/keyboard.js +20 -8
- package/lib/commands/log.js +172 -116
- package/lib/commands/media-projection.js +134 -161
- package/lib/commands/mixins.ts +966 -0
- package/lib/commands/network.js +252 -281
- package/lib/commands/performance.js +203 -132
- package/lib/commands/permissions.js +108 -109
- package/lib/commands/recordscreen.js +212 -209
- package/lib/commands/shell.js +51 -40
- package/lib/commands/streamscreen.js +355 -289
- package/lib/commands/system-bars.js +92 -83
- package/lib/commands/touch.js +357 -294
- package/lib/commands/types.ts +1097 -0
- package/lib/{desired-caps.js → constraints.ts} +106 -103
- package/lib/{driver.js → driver.ts} +278 -132
- package/lib/helpers/android.ts +1143 -0
- package/lib/helpers/index.ts +6 -0
- package/lib/helpers/types.ts +134 -0
- package/lib/helpers/unlock.ts +329 -0
- package/lib/helpers/webview.ts +582 -0
- package/lib/index.ts +18 -0
- package/lib/method-map.js +87 -98
- package/lib/stubs.ts +0 -1
- package/package.json +26 -19
- package/build/index.js +0 -51
- package/build/lib/android-helpers.d.ts +0 -136
- package/build/lib/android-helpers.d.ts.map +0 -1
- package/build/lib/android-helpers.js +0 -855
- package/build/lib/android-helpers.js.map +0 -1
- package/build/lib/commands/coverage.d.ts +0 -5
- package/build/lib/commands/coverage.d.ts.map +0 -1
- package/build/lib/commands/coverage.js +0 -19
- package/build/lib/commands/coverage.js.map +0 -1
- package/build/lib/desired-caps.d.ts +0 -353
- package/build/lib/desired-caps.d.ts.map +0 -1
- package/build/lib/desired-caps.js.map +0 -1
- package/build/lib/unlock-helpers.d.ts +0 -38
- package/build/lib/unlock-helpers.d.ts.map +0 -1
- package/build/lib/unlock-helpers.js +0 -266
- package/build/lib/unlock-helpers.js.map +0 -1
- package/build/lib/webview-helpers.d.ts +0 -224
- package/build/lib/webview-helpers.d.ts.map +0 -1
- package/build/lib/webview-helpers.js +0 -528
- package/build/lib/webview-helpers.js.map +0 -1
- package/index.js +0 -24
- package/lib/android-helpers.js +0 -983
- package/lib/commands/coverage.js +0 -18
- package/lib/commands/find.js +0 -82
- package/lib/unlock-helpers.js +0 -278
- package/lib/webview-helpers.js +0 -602
package/lib/commands/log.js
CHANGED
|
@@ -1,144 +1,200 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import {DEFAULT_WS_PATHNAME_PREFIX, BaseDriver} from 'appium/driver';
|
|
3
4
|
import _ from 'lodash';
|
|
5
|
+
import os from 'node:os';
|
|
4
6
|
import WebSocket from 'ws';
|
|
5
|
-
import
|
|
7
|
+
import log from '../logger';
|
|
8
|
+
import {mixin} from './mixins';
|
|
6
9
|
|
|
7
10
|
const GET_SERVER_LOGS_FEATURE = 'get_server_logs';
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} sessionId
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
const WEBSOCKET_ENDPOINT = (sessionId) =>
|
|
17
|
+
`${DEFAULT_WS_PATHNAME_PREFIX}/session/${sessionId}/appium/device/logcat`;
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @see {@link https://github.com/SeleniumHQ/selenium/blob/0d425676b3c9df261dd641917f867d4d5ce7774d/java/client/src/org/openqa/selenium/logging/LogEntry.java}
|
|
22
|
+
* @param {number} timestamp
|
|
23
|
+
* @param {string} level
|
|
24
|
+
* @param {string} message
|
|
25
|
+
*/
|
|
26
|
+
function toLogRecord(timestamp, level, message) {
|
|
15
27
|
return {
|
|
16
28
|
timestamp,
|
|
17
29
|
level,
|
|
18
30
|
message,
|
|
19
31
|
};
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @type {import('./mixins').LogMixin & ThisType<import('../driver').AndroidDriver>}
|
|
35
|
+
* @satisfies {import('@appium/types').ExternalDriver}
|
|
36
|
+
*/
|
|
37
|
+
const LogMixin = {
|
|
38
|
+
supportedLogTypes: {
|
|
39
|
+
logcat: {
|
|
40
|
+
description: 'Logs for Android applications on real device and emulators via ADB',
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param {import('../driver').AndroidDriver} self
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
getter: (self) => /** @type {ADB} */ (self.adb).getLogcatLogs(),
|
|
34
47
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
);
|
|
48
|
+
bugreport: {
|
|
49
|
+
description: `'adb bugreport' output for advanced issues diagnostic`,
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param {import('../driver').AndroidDriver} self
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
getter: async (self) => {
|
|
56
|
+
const output = await /** @type {ADB} */ (self.adb).bugreport();
|
|
57
|
+
const timestamp = Date.now();
|
|
58
|
+
return output.split(os.EOL).map((x) => toLogRecord(timestamp, 'ALL', x));
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
server: {
|
|
62
|
+
description: 'Appium server logs',
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {import('../driver').AndroidDriver} self
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
getter: (self) => {
|
|
69
|
+
self.ensureFeatureEnabled(GET_SERVER_LOGS_FEATURE);
|
|
70
|
+
const timestamp = Date.now();
|
|
71
|
+
return log
|
|
72
|
+
.unwrap()
|
|
73
|
+
.record.map((x) =>
|
|
74
|
+
toLogRecord(
|
|
75
|
+
timestamp,
|
|
76
|
+
'ALL',
|
|
77
|
+
_.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
},
|
|
46
81
|
},
|
|
47
82
|
},
|
|
48
|
-
};
|
|
49
83
|
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
log.info(`Starting logcat broadcasting on web socket server ` +
|
|
66
|
-
`${JSON.stringify(this.server.address())} to ${pathname}`);
|
|
67
|
-
// https://github.com/websockets/ws/blob/master/doc/ws.md
|
|
68
|
-
const wss = new WebSocket.Server({
|
|
69
|
-
noServer: true,
|
|
70
|
-
});
|
|
71
|
-
wss.on('connection', (ws, req) => {
|
|
72
|
-
if (req) {
|
|
73
|
-
const remoteIp = _.isEmpty(req.headers['x-forwarded-for'])
|
|
74
|
-
? req.connection?.remoteAddress
|
|
75
|
-
: req.headers['x-forwarded-for'];
|
|
76
|
-
log.debug(`Established a new logcat listener web socket connection from ${remoteIp}`);
|
|
77
|
-
} else {
|
|
78
|
-
log.debug('Established a new logcat listener web socket connection');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (_.isEmpty(this._logcatWebsocketListener)) {
|
|
82
|
-
this._logcatWebsocketListener = (logRecord) => {
|
|
83
|
-
if (ws?.readyState === WebSocket.OPEN) {
|
|
84
|
-
ws.send(logRecord.message);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
84
|
+
/**
|
|
85
|
+
* Starts Android logcat broadcast websocket on the same host and port
|
|
86
|
+
* where Appium server is running at `/ws/session/:sessionId:/appium/logcat` endpoint. The method
|
|
87
|
+
* will return immediately if the web socket is already listening.
|
|
88
|
+
*
|
|
89
|
+
* Each connected websocket listener will receive logcat log lines
|
|
90
|
+
* as soon as they are visible to Appium.
|
|
91
|
+
*/
|
|
92
|
+
async mobileStartLogsBroadcast() {
|
|
93
|
+
const server = /** @type {import('@appium/types').AppiumServer} */ (this.server);
|
|
94
|
+
const adb = /** @type {ADB} */ (this.adb);
|
|
95
|
+
const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
|
|
96
|
+
if (!_.isEmpty(await server.getWebSocketHandlers(pathname))) {
|
|
97
|
+
log.debug(`The logcat broadcasting web socket server is already listening at ${pathname}`);
|
|
98
|
+
return;
|
|
87
99
|
}
|
|
88
|
-
this.adb.setLogcatListener(this._logcatWebsocketListener);
|
|
89
100
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
log.info(
|
|
102
|
+
`Starting logcat broadcasting on web socket server ` +
|
|
103
|
+
`${JSON.stringify(server.address())} to ${pathname}`
|
|
104
|
+
);
|
|
105
|
+
// https://github.com/websockets/ws/blob/master/doc/ws.md
|
|
106
|
+
const wss = new WebSocket.Server({
|
|
107
|
+
noServer: true,
|
|
108
|
+
});
|
|
109
|
+
wss.on('connection', (ws, req) => {
|
|
110
|
+
if (req) {
|
|
111
|
+
const remoteIp = _.isEmpty(req.headers['x-forwarded-for'])
|
|
112
|
+
? req.connection?.remoteAddress
|
|
113
|
+
: req.headers['x-forwarded-for'];
|
|
114
|
+
log.debug(`Established a new logcat listener web socket connection from ${remoteIp}`);
|
|
115
|
+
} else {
|
|
116
|
+
log.debug('Established a new logcat listener web socket connection');
|
|
96
117
|
}
|
|
97
118
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
119
|
+
if (_.isEmpty(this._logcatWebsocketListener)) {
|
|
120
|
+
this._logcatWebsocketListener = (logRecord) => {
|
|
121
|
+
if (ws?.readyState === WebSocket.OPEN) {
|
|
122
|
+
ws.send(logRecord.message);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
104
125
|
}
|
|
105
|
-
|
|
126
|
+
adb.setLogcatListener(this._logcatWebsocketListener);
|
|
127
|
+
|
|
128
|
+
ws.on('close', (code, reason) => {
|
|
129
|
+
if (!_.isEmpty(this._logcatWebsocketListener)) {
|
|
130
|
+
try {
|
|
131
|
+
adb.removeLogcatListener(this._logcatWebsocketListener);
|
|
132
|
+
} catch (ign) {}
|
|
133
|
+
this._logcatWebsocketListener = undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
let closeMsg = 'Logcat listener web socket is closed.';
|
|
137
|
+
if (!_.isEmpty(code)) {
|
|
138
|
+
closeMsg += ` Code: ${code}.`;
|
|
139
|
+
}
|
|
140
|
+
if (!_.isEmpty(reason)) {
|
|
141
|
+
closeMsg += ` Reason: ${reason.toString()}.`;
|
|
142
|
+
}
|
|
143
|
+
log.debug(closeMsg);
|
|
144
|
+
});
|
|
106
145
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
146
|
+
await server.addWebSocketHandler(
|
|
147
|
+
pathname,
|
|
148
|
+
/** @type {import('@appium/types').WSServer} */ (wss)
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* Stops the previously started logcat broadcasting wesocket server.
|
|
153
|
+
* This method will return immediately if no server is running.
|
|
154
|
+
*/
|
|
155
|
+
async mobileStopLogsBroadcast() {
|
|
156
|
+
const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
|
|
157
|
+
const server = /** @type {import('@appium/types').AppiumServer} */ (this.server);
|
|
158
|
+
if (_.isEmpty(await server.getWebSocketHandlers(pathname))) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
110
161
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (_.isEmpty(await this.server.getWebSocketHandlers(pathname))) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
162
|
+
log.debug(
|
|
163
|
+
`Stopping logcat broadcasting on web socket server ` +
|
|
164
|
+
`${JSON.stringify(server.address())} to ${pathname}`
|
|
165
|
+
);
|
|
166
|
+
await server.removeWebSocketHandler(pathname);
|
|
167
|
+
},
|
|
120
168
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
169
|
+
async getLogTypes() {
|
|
170
|
+
// XXX why doesn't `super` work here?
|
|
171
|
+
const nativeLogTypes = await BaseDriver.prototype.getLogTypes.call(this);
|
|
172
|
+
if (this.isWebContext()) {
|
|
173
|
+
const webLogTypes = /** @type {string[]} */ (
|
|
174
|
+
await /** @type {import('appium-chromedriver').Chromedriver} */ (
|
|
175
|
+
this.chromedriver
|
|
176
|
+
).jwproxy.command('/log/types', 'GET')
|
|
177
|
+
);
|
|
178
|
+
return [...nativeLogTypes, ...webLogTypes];
|
|
179
|
+
}
|
|
180
|
+
return nativeLogTypes;
|
|
181
|
+
},
|
|
125
182
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
183
|
+
async getLog(logType) {
|
|
184
|
+
if (this.isWebContext() && !_.keys(this.supportedLogTypes).includes(logType)) {
|
|
185
|
+
return await /** @type {import('appium-chromedriver').Chromedriver} */ (
|
|
186
|
+
this.chromedriver
|
|
187
|
+
).jwproxy.command('/log', 'POST', {type: logType});
|
|
188
|
+
}
|
|
189
|
+
// XXX why doesn't `super` work here?
|
|
190
|
+
return await BaseDriver.prototype.getLog.call(this, logType);
|
|
191
|
+
},
|
|
133
192
|
};
|
|
134
193
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
return await BaseDriver.prototype.getLog.call(this, logType);
|
|
140
|
-
};
|
|
194
|
+
mixin(LogMixin);
|
|
195
|
+
|
|
196
|
+
export default LogMixin;
|
|
141
197
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
198
|
+
/**
|
|
199
|
+
* @typedef {import('appium-adb').ADB} ADB
|
|
200
|
+
*/
|