appium-android-driver 5.13.1 → 5.13.2
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/index.js +43 -40
- package/build/lib/android-helpers.d.ts +136 -0
- package/build/lib/android-helpers.d.ts.map +1 -0
- package/build/lib/android-helpers.js +760 -679
- package/build/lib/android-helpers.js.map +1 -1
- package/build/lib/bootstrap.d.ts +29 -0
- package/build/lib/bootstrap.d.ts.map +1 -0
- package/build/lib/bootstrap.js +192 -179
- package/build/lib/bootstrap.js.map +1 -1
- package/build/lib/commands/actions.d.ts +209 -0
- package/build/lib/commands/actions.d.ts.map +1 -0
- package/build/lib/commands/actions.js +327 -265
- package/build/lib/commands/actions.js.map +1 -1
- package/build/lib/commands/alert.d.ts +10 -0
- package/build/lib/commands/alert.d.ts.map +1 -0
- package/build/lib/commands/alert.js +12 -18
- package/build/lib/commands/alert.js.map +1 -1
- package/build/lib/commands/app-management.d.ts +314 -0
- package/build/lib/commands/app-management.d.ts.map +1 -0
- package/build/lib/commands/app-management.js +278 -110
- package/build/lib/commands/app-management.js.map +1 -1
- package/build/lib/commands/context.d.ts +94 -0
- package/build/lib/commands/context.d.ts.map +1 -0
- package/build/lib/commands/context.js +412 -260
- package/build/lib/commands/context.js.map +1 -1
- package/build/lib/commands/coverage.d.ts +5 -0
- package/build/lib/commands/coverage.d.ts.map +1 -0
- package/build/lib/commands/coverage.js +14 -17
- package/build/lib/commands/coverage.js.map +1 -1
- package/build/lib/commands/element.d.ts +36 -0
- package/build/lib/commands/element.d.ts.map +1 -0
- package/build/lib/commands/element.js +97 -127
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/emu-console.d.ts +49 -0
- package/build/lib/commands/emu-console.d.ts.map +1 -0
- package/build/lib/commands/emu-console.js +36 -25
- package/build/lib/commands/emu-console.js.map +1 -1
- package/build/lib/commands/execute.d.ts +6 -0
- package/build/lib/commands/execute.d.ts.map +1 -0
- package/build/lib/commands/execute.js +68 -69
- package/build/lib/commands/execute.js.map +1 -1
- package/build/lib/commands/file-actions.d.ts +129 -0
- package/build/lib/commands/file-actions.d.ts.map +1 -0
- package/build/lib/commands/file-actions.js +321 -178
- package/build/lib/commands/file-actions.js.map +1 -1
- package/build/lib/commands/find.d.ts +13 -0
- package/build/lib/commands/find.d.ts.map +1 -0
- package/build/lib/commands/find.js +69 -51
- package/build/lib/commands/find.js.map +1 -1
- package/build/lib/commands/general.d.ts +133 -0
- package/build/lib/commands/general.d.ts.map +1 -0
- package/build/lib/commands/general.js +275 -216
- package/build/lib/commands/general.js.map +1 -1
- package/build/lib/commands/ime.d.ts +11 -0
- package/build/lib/commands/ime.d.ts.map +1 -0
- package/build/lib/commands/ime.js +27 -33
- package/build/lib/commands/ime.js.map +1 -1
- package/build/lib/commands/index.d.ts +3 -0
- package/build/lib/commands/index.d.ts.map +1 -0
- package/build/lib/commands/index.js +32 -35
- package/build/lib/commands/index.js.map +1 -1
- package/build/lib/commands/intent.d.ts +418 -0
- package/build/lib/commands/intent.d.ts.map +1 -0
- package/build/lib/commands/intent.js +281 -151
- package/build/lib/commands/intent.js.map +1 -1
- package/build/lib/commands/keyboard.d.ts +6 -0
- package/build/lib/commands/keyboard.d.ts.map +1 -0
- package/build/lib/commands/keyboard.js +6 -14
- package/build/lib/commands/keyboard.js.map +1 -1
- package/build/lib/commands/log.d.ts +45 -0
- package/build/lib/commands/log.d.ts.map +1 -0
- package/build/lib/commands/log.js +117 -103
- package/build/lib/commands/log.js.map +1 -1
- package/build/lib/commands/media-projection.d.ts +144 -0
- package/build/lib/commands/media-projection.d.ts.map +1 -0
- package/build/lib/commands/media-projection.js +228 -171
- package/build/lib/commands/media-projection.js.map +1 -1
- package/build/lib/commands/network.d.ts +139 -0
- package/build/lib/commands/network.d.ts.map +1 -0
- package/build/lib/commands/network.js +249 -181
- package/build/lib/commands/network.js.map +1 -1
- package/build/lib/commands/performance.d.ts +101 -0
- package/build/lib/commands/performance.d.ts.map +1 -0
- package/build/lib/commands/performance.js +390 -236
- package/build/lib/commands/performance.js.map +1 -1
- package/build/lib/commands/permissions.d.ts +93 -0
- package/build/lib/commands/permissions.d.ts.map +1 -0
- package/build/lib/commands/permissions.js +133 -93
- package/build/lib/commands/permissions.js.map +1 -1
- package/build/lib/commands/recordscreen.d.ts +194 -0
- package/build/lib/commands/recordscreen.d.ts.map +1 -0
- package/build/lib/commands/recordscreen.js +293 -224
- package/build/lib/commands/recordscreen.js.map +1 -1
- package/build/lib/commands/shell.d.ts +8 -0
- package/build/lib/commands/shell.d.ts.map +1 -0
- package/build/lib/commands/shell.js +38 -43
- package/build/lib/commands/shell.js.map +1 -1
- package/build/lib/commands/streamscreen.d.ts +104 -0
- package/build/lib/commands/streamscreen.d.ts.map +1 -0
- package/build/lib/commands/streamscreen.js +364 -305
- package/build/lib/commands/streamscreen.js.map +1 -1
- package/build/lib/commands/system-bars.d.ts +100 -0
- package/build/lib/commands/system-bars.d.ts.map +1 -0
- package/build/lib/commands/system-bars.js +148 -90
- package/build/lib/commands/system-bars.js.map +1 -1
- package/build/lib/commands/touch.d.ts +30 -0
- package/build/lib/commands/touch.d.ts.map +1 -0
- package/build/lib/commands/touch.js +311 -287
- package/build/lib/commands/touch.js.map +1 -1
- package/build/lib/desired-caps.d.ts +353 -0
- package/build/lib/desired-caps.d.ts.map +1 -0
- package/build/lib/desired-caps.js +291 -292
- package/build/lib/desired-caps.js.map +1 -1
- package/build/lib/driver.d.ts +430 -0
- package/build/lib/driver.d.ts.map +1 -0
- package/build/lib/driver.js +449 -384
- package/build/lib/driver.js.map +1 -1
- package/build/lib/logger.d.ts +3 -0
- package/build/lib/logger.d.ts.map +1 -0
- package/build/lib/logger.js +5 -11
- package/build/lib/logger.js.map +1 -1
- package/build/lib/method-map.d.ts +389 -0
- package/build/lib/method-map.d.ts.map +1 -0
- package/build/lib/method-map.js +220 -394
- package/build/lib/method-map.js.map +1 -1
- package/build/lib/stubs.d.ts +8 -0
- package/build/lib/stubs.d.ts.map +1 -0
- package/build/lib/stubs.js +5 -0
- package/build/lib/stubs.js.map +1 -0
- package/build/lib/uiautomator.d.ts +24 -0
- package/build/lib/uiautomator.d.ts.map +1 -0
- package/build/lib/uiautomator.js +86 -82
- package/build/lib/uiautomator.js.map +1 -1
- package/build/lib/unlock-helpers.d.ts +38 -0
- package/build/lib/unlock-helpers.d.ts.map +1 -0
- package/build/lib/unlock-helpers.js +228 -204
- package/build/lib/unlock-helpers.js.map +1 -1
- package/build/lib/utils.d.ts +11 -0
- package/build/lib/utils.d.ts.map +1 -0
- package/build/lib/utils.js +23 -18
- package/build/lib/utils.js.map +1 -1
- package/build/lib/webview-helpers.d.ts +223 -0
- package/build/lib/webview-helpers.d.ts.map +1 -0
- package/build/lib/webview-helpers.js +476 -298
- package/build/lib/webview-helpers.js.map +1 -1
- package/index.js +3 -1
- package/lib/android-helpers.js +2 -1
- package/lib/stubs.ts +8 -0
- package/lib/unlock-helpers.js +2 -2
- package/package.json +23 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordscreen.js","names":["_lodash","_interopRequireDefault","require","_asyncbox","_support","_teen_process","_path","commands","exports","RETRY_PAUSE","RETRY_TIMEOUT","MAX_RECORDING_TIME_SEC","MAX_TIME_SEC","DEFAULT_RECORDING_TIME_SEC","PROCESS_SHUTDOWN_TIMEOUT","SCREENRECORD_BINARY","DEFAULT_EXT","MIN_EMULATOR_API_LEVEL","FFMPEG_BINARY","system","isWindows","uploadRecordedMedia","localFile","remotePath","uploadOptions","_","isEmpty","util","toInMemoryBase64","toString","user","pass","method","headers","fileFieldName","formFields","options","auth","net","uploadFile","verifyScreenRecordIsSupported","adb","isEmulator","apiLevel","getApiLevel","Error","scheduleScreenRecord","recordingProperties","log","stopped","timer","videoSize","bitRate","timeLimit","bugReport","currentTimeLimit","hasValue","currentTimeLimitInt","parseInt","isNaN","pathOnDevice","uuidV4","substring","recordingProc","screenrecord","on","currentDuration","getDuration","asSeconds","toFixed","debug","timeLimitInt","chunkDuration","e","error","stack","start","waitForCondition","fileExists","waitMs","intervalMs","records","push","recordingProcess","mergeScreenRecords","mediaFiles","fs","which","configContent","map","x","join","configFile","path","resolve","dirname","writeFile","result","Math","floor","Date","args","info","exec","terminateBackgroundScreenRecording","force","pids","getPIDsByName","p","shell","err","message","startRecordingScreen","forceRestart","stopRecordingScreen","warn","_screenRecordingProperties","record","rimraf","timeout","parseFloat","timing","Timer","isRunning","stop","errorAndThrow","tmpRoot","tempDir","openDir","localRecords","posix","basename","pull","last","resultFilePath","length","size","stat","toReadableSizeString","_default","default"],"sources":["../../../lib/commands/recordscreen.js"],"sourcesContent":["import _ from 'lodash';\nimport { waitForCondition } from 'asyncbox';\nimport { util, fs, net, tempDir, system, timing } from '@appium/support';\nimport { exec } from 'teen_process';\nimport path from 'path';\n\n\nconst commands = {};\n\nconst RETRY_PAUSE = 300;\nconst RETRY_TIMEOUT = 5000;\nconst MAX_RECORDING_TIME_SEC = 60 * 3;\nconst MAX_TIME_SEC = 60 * 30;\nconst DEFAULT_RECORDING_TIME_SEC = MAX_RECORDING_TIME_SEC;\nconst PROCESS_SHUTDOWN_TIMEOUT = 10 * 1000;\nconst SCREENRECORD_BINARY = 'screenrecord';\nconst DEFAULT_EXT = '.mp4';\nconst MIN_EMULATOR_API_LEVEL = 27;\nconst FFMPEG_BINARY = `ffmpeg${system.isWindows() ? '.exe' : ''}`;\n\nasync function uploadRecordedMedia (localFile, remotePath = null, uploadOptions = {}) {\n if (_.isEmpty(remotePath)) {\n return (await util.toInMemoryBase64(localFile)).toString();\n }\n\n const {user, pass, method, headers, fileFieldName, formFields} = uploadOptions;\n const options = {\n method: method || 'PUT',\n headers,\n fileFieldName,\n formFields,\n };\n if (user && pass) {\n options.auth = {user, pass};\n }\n await net.uploadFile(localFile, remotePath, options);\n return '';\n}\n\nasync function verifyScreenRecordIsSupported (adb, isEmulator) {\n const apiLevel = await adb.getApiLevel();\n if (isEmulator && apiLevel < MIN_EMULATOR_API_LEVEL) {\n throw new Error(`Screen recording does not work on emulators running Android API level less than ${MIN_EMULATOR_API_LEVEL}`);\n }\n if (apiLevel < 19) {\n throw new Error(`Screen recording not available on API Level ${apiLevel}. Minimum API Level is 19.`);\n }\n}\n\nasync function scheduleScreenRecord (adb, recordingProperties, log = null) {\n if (recordingProperties.stopped) {\n return;\n }\n\n const {\n timer,\n videoSize,\n bitRate,\n timeLimit,\n bugReport,\n } = recordingProperties;\n\n let currentTimeLimit = MAX_RECORDING_TIME_SEC;\n if (util.hasValue(recordingProperties.currentTimeLimit)) {\n const currentTimeLimitInt = parseInt(recordingProperties.currentTimeLimit, 10);\n if (!isNaN(currentTimeLimitInt) && currentTimeLimitInt < MAX_RECORDING_TIME_SEC) {\n currentTimeLimit = currentTimeLimitInt;\n }\n }\n const pathOnDevice = `/sdcard/${util.uuidV4().substring(0, 8)}${DEFAULT_EXT}`;\n const recordingProc = adb.screenrecord(pathOnDevice, {\n videoSize,\n bitRate,\n timeLimit: currentTimeLimit,\n bugReport,\n });\n\n recordingProc.on('end', () => {\n if (recordingProperties.stopped || !util.hasValue(timeLimit)) {\n return;\n }\n const currentDuration = timer.getDuration().asSeconds.toFixed(0);\n log?.debug(`The overall screen recording duration is ${currentDuration}s so far`);\n const timeLimitInt = parseInt(timeLimit, 10);\n if (isNaN(timeLimitInt) || currentDuration >= timeLimitInt) {\n log?.debug('There is no need to start the next recording chunk');\n return;\n }\n\n recordingProperties.currentTimeLimit = timeLimitInt - currentDuration;\n const chunkDuration = recordingProperties.currentTimeLimit < MAX_RECORDING_TIME_SEC\n ? recordingProperties.currentTimeLimit\n : MAX_RECORDING_TIME_SEC;\n log?.debug(`Starting the next ${chunkDuration}s-chunk ` +\n `of screen recording in order to achieve ${timeLimitInt}s total duration`);\n (async () => {\n try {\n await scheduleScreenRecord(adb, recordingProperties, log);\n } catch (e) {\n log?.error(e.stack);\n recordingProperties.stopped = true;\n }\n })();\n });\n\n await recordingProc.start(0);\n try {\n await waitForCondition(async () => await adb.fileExists(pathOnDevice),\n {waitMs: RETRY_TIMEOUT, intervalMs: RETRY_PAUSE});\n } catch (e) {\n throw new Error(`The expected screen record file '${pathOnDevice}' does not exist after ${RETRY_TIMEOUT}ms. ` +\n `Is ${SCREENRECORD_BINARY} utility available and operational on the device under test?`);\n }\n\n recordingProperties.records.push(pathOnDevice);\n recordingProperties.recordingProcess = recordingProc;\n}\n\nasync function mergeScreenRecords (mediaFiles, log = null) {\n try {\n await fs.which(FFMPEG_BINARY);\n } catch (e) {\n throw new Error(`${FFMPEG_BINARY} utility is not available in PATH. Please install it from https://www.ffmpeg.org/`);\n }\n const configContent = mediaFiles\n .map((x) => `file '${x}'`)\n .join('\\n');\n const configFile = path.resolve(path.dirname(mediaFiles[0]), 'config.txt');\n await fs.writeFile(configFile, configContent, 'utf8');\n log?.debug(`Generated ffmpeg merging config '${configFile}' with items:\\n${configContent}`);\n const result = path.resolve(path.dirname(mediaFiles[0]), `merge_${Math.floor(new Date())}${DEFAULT_EXT}`);\n const args = ['-safe', '0', '-f', 'concat', '-i', configFile, '-c', 'copy', result];\n log?.info(`Initiating screen records merging using the command '${FFMPEG_BINARY} ${args.join(' ')}'`);\n await exec(FFMPEG_BINARY, args);\n return result;\n}\n\nasync function terminateBackgroundScreenRecording (adb, force = true) {\n const pids = (await adb.getPIDsByName(SCREENRECORD_BINARY))\n .map((p) => `${p}`);\n if (_.isEmpty(pids)) {\n return false;\n }\n\n try {\n await adb.shell(['kill', force ? '-15' : '-2', ...pids]);\n await waitForCondition(async () => _.isEmpty(await adb.getPIDsByName(SCREENRECORD_BINARY)), {\n waitMs: PROCESS_SHUTDOWN_TIMEOUT,\n intervalMs: 500,\n });\n return true;\n } catch (err) {\n throw new Error(`Unable to stop the background screen recording: ${err.message}`);\n }\n}\n\n\n/**\n * @typedef {Object} StartRecordingOptions\n *\n * @property {?string} remotePath - The path to the remote location, where the captured video should be uploaded.\n * The following protocols are supported: http/https, ftp.\n * Null or empty string value (the default setting) means the content of resulting\n * file should be encoded as Base64 and passed as the endpount response value.\n * An exception will be thrown if the generated media file is too big to\n * fit into the available process memory.\n * This option only has an effect if there is screen recording process in progreess\n * and `forceRestart` parameter is not set to `true`.\n * @property {?string} user - The name of the user for the remote authentication. Only works if `remotePath` is provided.\n * @property {?string} pass - The password for the remote authentication. Only works if `remotePath` is provided.\n * @property {?string} method [PUT] - The http multipart upload method name. Only works if `remotePath` is provided.\n * @property {?Object} headers - Additional headers mapping for multipart http(s) uploads\n * @property {?string} fileFieldName [file] - The name of the form field, where the file content BLOB should be stored for\n * http(s) uploads\n * @property {?Object|Array<Pair>} formFields - Additional form fields for multipart http(s) uploads\n * @property {?string} videoSize - The format is widthxheight.\n * The default value is the device's native display resolution (if supported),\n * 1280x720 if not. For best results,\n * use a size supported by your device's Advanced Video Coding (AVC) encoder.\n * For example, \"1280x720\"\n * @property {?boolean} bugReport - Set it to `true` in order to display additional information on the video overlay,\n * such as a timestamp, that is helpful in videos captured to illustrate bugs.\n * This option is only supported since API level 27 (Android P).\n * @property {?string|number} timeLimit - The maximum recording time, in seconds. The default value is 180 (3 minutes).\n * The maximum value is 1800 (30 minutes). If the passed value is greater than 180 then\n * the algorithm will try to schedule multiple screen recording chunks and merge the\n * resulting videos into a single media file using `ffmpeg` utility.\n * If the utility is not available in PATH then the most recent screen recording chunk is\n * going to be returned.\n * @property {?string|number} bitRate - The video bit rate for the video, in bits per second.\n * The default value is 4000000 (4 Mbit/s). You can increase the bit rate to improve video quality,\n * but doing so results in larger movie files.\n * @property {?boolean} forceRestart - Whether to try to catch and upload/return the currently running screen recording\n * (`false`, the default setting) or ignore the result of it and start a new recording\n * immediately (`true`).\n */\n\n/**\n * Record the display of a real devices running Android 4.4 (API level 19) and higher.\n * Emulators are supported since API level 27 (Android P).\n * It records screen activity to an MPEG-4 file. Audio is not recorded with the video file.\n * If screen recording has been already started then the command will stop it forcefully and start a new one.\n * The previously recorded video file will be deleted.\n *\n * @param {?StartRecordingOptions} options - The available options.\n * @returns {string} Base64-encoded content of the recorded media file if\n * any screen recording is currently running or an empty string.\n * @throws {Error} If screen recording has failed to start or is not supported on the device under test.\n */\ncommands.startRecordingScreen = async function startRecordingScreen (options = {}) {\n await verifyScreenRecordIsSupported(this.adb, this.isEmulator());\n\n let result = '';\n const {videoSize, timeLimit = DEFAULT_RECORDING_TIME_SEC, bugReport, bitRate, forceRestart} = options;\n if (!forceRestart) {\n result = await this.stopRecordingScreen(options);\n }\n\n if (await terminateBackgroundScreenRecording(this.adb, true)) {\n this.log.warn(`There were some ${SCREENRECORD_BINARY} process leftovers running ` +\n `in the background. Make sure you stop screen recording each time after it is started, ` +\n `otherwise the recorded media might quickly exceed all the free space on the device under test.`);\n }\n\n if (!_.isEmpty(this._screenRecordingProperties)) {\n for (const record of (this._screenRecordingProperties.records || [])) {\n await this.adb.rimraf(record);\n }\n this._screenRecordingProperties = null;\n }\n\n const timeout = parseFloat(timeLimit);\n if (isNaN(timeout) || timeout > MAX_TIME_SEC || timeout <= 0) {\n throw new Error(`The timeLimit value must be in range [1, ${MAX_TIME_SEC}] seconds. ` +\n `The value of '${timeLimit}' has been passed instead.`);\n }\n\n this._screenRecordingProperties = {\n timer: new timing.Timer().start(),\n videoSize,\n timeLimit,\n currentTimeLimit: timeLimit,\n bitRate,\n bugReport,\n records: [],\n recordingProcess: null,\n stopped: false,\n };\n await scheduleScreenRecord(this.adb, this._screenRecordingProperties, this.log);\n return result;\n};\n\n/**\n * @typedef {Object} StopRecordingOptions\n *\n * @property {?string} remotePath - The path to the remote location, where the resulting video should be uploaded.\n * The following protocols are supported: http/https, ftp.\n * Null or empty string value (the default setting) means the content of resulting\n * file should be encoded as Base64 and passed as the endpount response value.\n * An exception will be thrown if the generated media file is too big to\n * fit into the available process memory.\n * @property {?string} user - The name of the user for the remote authentication.\n * @property {?string} pass - The password for the remote authentication.\n * @property {?string} method - The http multipart upload method name. The 'PUT' one is used by default.\n * @property {?Object} headers - Additional headers mapping for multipart http(s) uploads\n * @property {?string} fileFieldName [file] - The name of the form field, where the file content BLOB should be stored for\n * http(s) uploads\n * @property {?Object|Array<Pair>} formFields - Additional form fields for multipart http(s) uploads\n */\n\n/**\n * Stop recording the screen.\n * If no screen recording has been started before then the method returns an empty string.\n *\n * @param {?StopRecordingOptions} options - The available options.\n * @returns {string} Base64-encoded content of the recorded media file if 'remotePath'\n * parameter is falsy or an empty string.\n * @throws {Error} If there was an error while getting the name of a media file\n * or the file content cannot be uploaded to the remote location\n * or screen recording is not supported on the device under test.\n */\ncommands.stopRecordingScreen = async function stopRecordingScreen (options = {}) {\n await verifyScreenRecordIsSupported(this.adb, this.isEmulator());\n\n if (!_.isEmpty(this._screenRecordingProperties)) {\n this._screenRecordingProperties.stopped = true;\n }\n\n try {\n await terminateBackgroundScreenRecording(this.adb, false);\n } catch (err) {\n this.log.warn(err.message);\n if (!_.isEmpty(this._screenRecordingProperties)) {\n this.log.warn('The resulting video might be corrupted');\n }\n }\n\n if (_.isEmpty(this._screenRecordingProperties)) {\n this.log.info(`Screen recording has not been previously started by Appium. There is nothing to stop`);\n return '';\n }\n\n if (this._screenRecordingProperties.recordingProcess && this._screenRecordingProperties.recordingProcess.isRunning) {\n try {\n await this._screenRecordingProperties.recordingProcess.stop('SIGINT', PROCESS_SHUTDOWN_TIMEOUT);\n } catch (e) {\n this.log.errorAndThrow(`Unable to stop screen recording within ${PROCESS_SHUTDOWN_TIMEOUT}ms`);\n }\n this._screenRecordingProperties.recordingProcess = null;\n }\n\n if (_.isEmpty(this._screenRecordingProperties.records)) {\n this.log.errorAndThrow(`No screen recordings have been stored on the device so far. ` +\n `Are you sure the ${SCREENRECORD_BINARY} utility works as expected?`);\n }\n\n const tmpRoot = await tempDir.openDir();\n try {\n const localRecords = [];\n for (const pathOnDevice of this._screenRecordingProperties.records) {\n localRecords.push(path.resolve(tmpRoot, path.posix.basename(pathOnDevice)));\n await this.adb.pull(pathOnDevice, _.last(localRecords));\n await this.adb.rimraf(pathOnDevice);\n }\n let resultFilePath = _.last(localRecords);\n if (localRecords.length > 1) {\n this.log.info(`Got ${localRecords.length} screen recordings. Trying to merge them`);\n try {\n resultFilePath = await mergeScreenRecords(localRecords, this.log);\n } catch (e) {\n this.log.warn(`Cannot merge the recorded files. The most recent screen recording is going to be returned as the result. ` +\n `Original error: ${e.message}`);\n }\n }\n if (_.isEmpty(options.remotePath)) {\n const {size} = await fs.stat(resultFilePath);\n this.log.debug(`The size of the resulting screen recording is ${util.toReadableSizeString(size)}`);\n }\n return await uploadRecordedMedia(resultFilePath, options.remotePath, options);\n } finally {\n await fs.rimraf(tmpRoot);\n this._screenRecordingProperties = null;\n }\n};\n\n\nexport { commands };\nexport default commands;\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAGA,MAAMK,QAAQ,GAAG,CAAC,CAAC;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AAEpB,MAAME,WAAW,GAAG,GAAG;AACvB,MAAMC,aAAa,GAAG,IAAI;AAC1B,MAAMC,sBAAsB,GAAG,EAAE,GAAG,CAAC;AACrC,MAAMC,YAAY,GAAG,EAAE,GAAG,EAAE;AAC5B,MAAMC,0BAA0B,GAAGF,sBAAsB;AACzD,MAAMG,wBAAwB,GAAG,EAAE,GAAG,IAAI;AAC1C,MAAMC,mBAAmB,GAAG,cAAc;AAC1C,MAAMC,WAAW,GAAG,MAAM;AAC1B,MAAMC,sBAAsB,GAAG,EAAE;AACjC,MAAMC,aAAa,GAAI,SAAQC,eAAM,CAACC,SAAS,CAAC,CAAC,GAAG,MAAM,GAAG,EAAG,EAAC;AAEjE,eAAeC,mBAAmBA,CAAEC,SAAS,EAAEC,UAAU,GAAG,IAAI,EAAEC,aAAa,GAAG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Y,CAAC,CAAC;QAC1C,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,MAAM,0CAA0C,CAAC,CAAC;YACpF,IAAI;gBACF,cAAc,GAAG,MAAM,kBAAkB,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;aACnE;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,2GAA2G;oBACvH,mBAAmB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;aACnC;SACF;QACD,IAAI,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACjC,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,YAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC7C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iDAAiD,cAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACpG;QACD,OAAO,MAAM,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;KAC/E;YAAS;QACR,MAAM,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzB,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC;KACxC;AACH,CAAC,CAAC;AAIF,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../lib/commands/shell.js"],"names":[],"mappings":";;IAQA;;;mBAmCC"}
|
|
@@ -1,49 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
require("
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _driver = require("appium/driver");
|
|
13
|
-
var _utils = require("../utils");
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.commands = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const teen_process_1 = require("teen_process");
|
|
9
|
+
const support_1 = require("@appium/support");
|
|
10
|
+
const driver_1 = require("appium/driver");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
14
12
|
const commands = {};
|
|
15
13
|
exports.commands = commands;
|
|
16
14
|
commands.mobileShell = async function mobileShell(opts = {}) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
command
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
15
|
+
this.ensureFeatureEnabled(utils_1.ADB_SHELL_FEATURE);
|
|
16
|
+
const { command, args = [], timeout = 20000, includeStderr, } = opts;
|
|
17
|
+
if (!lodash_1.default.isString(command)) {
|
|
18
|
+
throw new driver_1.errors.InvalidArgumentError(`The 'command' argument is mandatory`);
|
|
19
|
+
}
|
|
20
|
+
const adbArgs = [
|
|
21
|
+
...this.adb.executable.defaultArgs,
|
|
22
|
+
'shell',
|
|
23
|
+
command,
|
|
24
|
+
...(lodash_1.default.isArray(args) ? args : [args])
|
|
25
|
+
];
|
|
26
|
+
this.log.debug(`Running '${this.adb.executable.path} ${support_1.util.quote(adbArgs)}'`);
|
|
27
|
+
try {
|
|
28
|
+
const { stdout, stderr } = await (0, teen_process_1.exec)(this.adb.executable.path, adbArgs, { timeout });
|
|
29
|
+
if (includeStderr) {
|
|
30
|
+
return {
|
|
31
|
+
stdout,
|
|
32
|
+
stderr
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return stdout;
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
this.log.errorAndThrow(`Cannot execute the '${command}' shell command. ` +
|
|
39
|
+
`Original error: ${err.message}. ` +
|
|
40
|
+
`StdOut: ${err.stdout}. StdErr: ${err.stderr}`);
|
|
41
41
|
}
|
|
42
|
-
return stdout;
|
|
43
|
-
} catch (err) {
|
|
44
|
-
this.log.errorAndThrow(`Cannot execute the '${command}' shell command. ` + `Original error: ${err.message}. ` + `StdOut: ${err.stdout}. StdErr: ${err.stderr}`);
|
|
45
|
-
}
|
|
46
42
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbG9kYXNoIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsInJlcXVpcmUiLCJfdGVlbl9wcm9jZXNzIiwiX3N1cHBvcnQiLCJfZHJpdmVyIiwiX3V0aWxzIiwiY29tbWFuZHMiLCJleHBvcnRzIiwibW9iaWxlU2hlbGwiLCJvcHRzIiwiZW5zdXJlRmVhdHVyZUVuYWJsZWQiLCJBREJfU0hFTExfRkVBVFVSRSIsImNvbW1hbmQiLCJhcmdzIiwidGltZW91dCIsImluY2x1ZGVTdGRlcnIiLCJfIiwiaXNTdHJpbmciLCJlcnJvcnMiLCJJbnZhbGlkQXJndW1lbnRFcnJvciIsImFkYkFyZ3MiLCJhZGIiLCJleGVjdXRhYmxlIiwiZGVmYXVsdEFyZ3MiLCJpc0FycmF5IiwibG9nIiwiZGVidWciLCJwYXRoIiwidXRpbCIsInF1b3RlIiwic3Rkb3V0Iiwic3RkZXJyIiwiZXhlYyIsImVyciIsImVycm9yQW5kVGhyb3ciLCJtZXNzYWdlIiwiX2RlZmF1bHQiLCJkZ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Q0FBQztJQUNIO0lBQ0EsT0FBT0QsTUFBTTtFQUNmLENBQUMsQ0FBQyxPQUFPRyxHQUFHLEVBQUU7SUFDWixJQUFJLENBQUNSLEdBQUcsQ0FBQ1MsYUFBYSxDQUFFLHVCQUFzQnRCLE9BQVEsbUJBQWtCLEdBQ3JFLG1CQUFrQnFCLEdBQUcsQ0FBQ0UsT0FBUSxJQUFHLEdBQ2pDLFdBQVVGLEdBQUcsQ0FBQ0gsTUFBTyxhQUFZRyxHQUFHLENBQUNGLE1BQU8sRUFBQyxDQUFDO0VBQ25EO0FBQ0YsQ0FBQztBQUFDLElBQUFLLFFBQUEsR0FHYTlCLFFBQVE7QUFBQUMsT0FBQSxDQUFBOEIsT0FBQSxHQUFBRCxRQUFBIn0=
|
|
43
|
+
exports.default = commands;
|
|
44
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../lib/commands/shell.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,+CAAoC;AACpC,6CAAuC;AACvC,0CAAuC;AACvC,oCAA6C;AAE7C,MAAM,QAAQ,GAAG,EAAE,CAAC;AAuCX,4BAAQ;AArCjB,QAAQ,CAAC,WAAW,GAAG,KAAK,UAAU,WAAW,CAAE,IAAI,GAAG,EAAE;IAC1D,IAAI,CAAC,oBAAoB,CAAC,yBAAiB,CAAC,CAAC;IAE7C,MAAM,EACJ,OAAO,EACP,IAAI,GAAG,EAAE,EACT,OAAO,GAAG,KAAK,EACf,aAAa,GACd,GAAG,IAAI,CAAC;IAET,IAAI,CAAC,gBAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACxB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,qCAAqC,CAAC,CAAC;KAC9E;IAED,MAAM,OAAO,GAAG;QACd,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW;QAClC,OAAO;QACP,OAAO;QACP,GAAG,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;KACrC,CAAC;IACF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,cAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/E,IAAI;QACF,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,MAAM,IAAA,mBAAI,EAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,EAAC,OAAO,EAAC,CAAC,CAAC;QAClF,IAAI,aAAa,EAAE;YACjB,OAAO;gBACL,MAAM;gBACN,MAAM;aACP,CAAC;SACH;QACD,OAAO,MAAM,CAAC;KACf;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,uBAAuB,OAAO,mBAAmB;YACtE,mBAAmB,GAAG,CAAC,OAAO,IAAI;YAClC,WAAW,GAAG,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;KACnD;AACH,CAAC,CAAC;AAGF,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export default commands;
|
|
2
|
+
export type StartScreenStreamingOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* - The scaled width of the device's screen. If unset then the script will assign it
|
|
5
|
+
* to the actual screen width measured in pixels.
|
|
6
|
+
*/
|
|
7
|
+
width: number | null;
|
|
8
|
+
/**
|
|
9
|
+
* - The scaled height of the device's screen. If unset then the script will assign it
|
|
10
|
+
* to the actual screen height measured in pixels.
|
|
11
|
+
*/
|
|
12
|
+
height: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* - The video bit rate for the video, in bits per second.
|
|
15
|
+
* The default value is 4000000 (4 Mb/s). You can increase the bit rate to improve video quality,
|
|
16
|
+
* but doing so results in larger movie files.
|
|
17
|
+
*/
|
|
18
|
+
bitRate: number | null;
|
|
19
|
+
/**
|
|
20
|
+
* [127.0.0.1] - The IP address/host name to start the MJPEG server on.
|
|
21
|
+
* You can set it to `0.0.0.0` to trigger the broadcast on all available network interfaces.
|
|
22
|
+
*/
|
|
23
|
+
host: string | null;
|
|
24
|
+
/**
|
|
25
|
+
* - The HTTP request path the MJPEG server should be available on.
|
|
26
|
+
* If unset then any pathname on the given `host`/`port` combination will work. Note that the value
|
|
27
|
+
* should always start with a single slash: `/`
|
|
28
|
+
*/
|
|
29
|
+
pathname: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* [8094] - The port number to start the internal TCP MJPEG broadcast on.
|
|
32
|
+
* This type of broadcast always starts on the loopback interface (`127.0.0.1`).
|
|
33
|
+
*/
|
|
34
|
+
tcpPort: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* [8093] - The port number to start the MJPEG server on.
|
|
37
|
+
*/
|
|
38
|
+
port: number | null;
|
|
39
|
+
/**
|
|
40
|
+
* [70] - The quality value for the streamed JPEG images.
|
|
41
|
+
* This number should be in range [1, 100], where 100 is the best quality.
|
|
42
|
+
*/
|
|
43
|
+
quality: number | null;
|
|
44
|
+
/**
|
|
45
|
+
* [false] - If set to `true` then GStreamer pipeline will
|
|
46
|
+
* increase the dimensions of the resulting images to properly fit images in both landscape and
|
|
47
|
+
* portrait orientations. Set it to `true` if the device rotation is not going to be the same during the
|
|
48
|
+
* broadcasting session.
|
|
49
|
+
*/
|
|
50
|
+
considerRotation: boolean | null;
|
|
51
|
+
/**
|
|
52
|
+
* [false] - Whether to log GStreamer pipeline events into
|
|
53
|
+
* the standard log output. Might be useful for debugging purposes.
|
|
54
|
+
*/
|
|
55
|
+
logPipelineDetails: boolean | null;
|
|
56
|
+
};
|
|
57
|
+
declare namespace commands {
|
|
58
|
+
/**
|
|
59
|
+
* @typedef {Object} StartScreenStreamingOptions
|
|
60
|
+
*
|
|
61
|
+
* @property {?number} width - The scaled width of the device's screen. If unset then the script will assign it
|
|
62
|
+
* to the actual screen width measured in pixels.
|
|
63
|
+
* @property {?number} height - The scaled height of the device's screen. If unset then the script will assign it
|
|
64
|
+
* to the actual screen height measured in pixels.
|
|
65
|
+
* @property {?number} bitRate - The video bit rate for the video, in bits per second.
|
|
66
|
+
* The default value is 4000000 (4 Mb/s). You can increase the bit rate to improve video quality,
|
|
67
|
+
* but doing so results in larger movie files.
|
|
68
|
+
* @property {?string} host [127.0.0.1] - The IP address/host name to start the MJPEG server on.
|
|
69
|
+
* You can set it to `0.0.0.0` to trigger the broadcast on all available network interfaces.
|
|
70
|
+
* @property {?string} pathname - The HTTP request path the MJPEG server should be available on.
|
|
71
|
+
* If unset then any pathname on the given `host`/`port` combination will work. Note that the value
|
|
72
|
+
* should always start with a single slash: `/`
|
|
73
|
+
* @property {?number} tcpPort [8094] - The port number to start the internal TCP MJPEG broadcast on.
|
|
74
|
+
* This type of broadcast always starts on the loopback interface (`127.0.0.1`).
|
|
75
|
+
* @property {?number} port [8093] - The port number to start the MJPEG server on.
|
|
76
|
+
* @property {?number} quality [70] - The quality value for the streamed JPEG images.
|
|
77
|
+
* This number should be in range [1, 100], where 100 is the best quality.
|
|
78
|
+
* @property {?boolean} considerRotation [false] - If set to `true` then GStreamer pipeline will
|
|
79
|
+
* increase the dimensions of the resulting images to properly fit images in both landscape and
|
|
80
|
+
* portrait orientations. Set it to `true` if the device rotation is not going to be the same during the
|
|
81
|
+
* broadcasting session.
|
|
82
|
+
* @property {?boolean} logPipelineDetails [false] - Whether to log GStreamer pipeline events into
|
|
83
|
+
* the standard log output. Might be useful for debugging purposes.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Starts device screen broadcast by creating MJPEG server.
|
|
87
|
+
* Multiple calls to this method have no effect unless the previous streaming
|
|
88
|
+
* session is stopped.
|
|
89
|
+
* This method only works if the `adb_screen_streaming` feature is
|
|
90
|
+
* enabled on the server side.
|
|
91
|
+
*
|
|
92
|
+
* @param {?StartScreenStreamingOptions} options - The available options.
|
|
93
|
+
* @throws {Error} If screen streaming has failed to start or
|
|
94
|
+
* is not supported on the host system or
|
|
95
|
+
* the corresponding server feature is not enabled.
|
|
96
|
+
*/
|
|
97
|
+
function mobileStartScreenStreaming(options?: StartScreenStreamingOptions | null): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Stop screen streaming.
|
|
100
|
+
* If no screen streaming server has been started then nothing is done.
|
|
101
|
+
*/
|
|
102
|
+
function mobileStopScreenStreaming(): Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=streamscreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamscreen.d.ts","sourceRoot":"","sources":["../../../lib/commands/streamscreen.js"],"names":[],"mappings":";;;;;;WA2Oe,MAAM;;;;;YAEN,MAAM;;;;;;aAEN,MAAM;;;;;UAGN,MAAM;;;;;;cAEN,MAAM;;;;;aAGN,MAAM;;;;UAEN,MAAM;;;;;aACN,MAAM;;;;;;;sBAEN,OAAO;;;;;wBAIP,OAAO;;;IAxBtB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IAEH;;;;;;;;;;;OAWG;IACH,iGAoIC;IAED;;;OAGG;IACH,oDAuCC"}
|