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.
Files changed (151) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/index.js +43 -40
  3. package/build/lib/android-helpers.d.ts +136 -0
  4. package/build/lib/android-helpers.d.ts.map +1 -0
  5. package/build/lib/android-helpers.js +760 -679
  6. package/build/lib/android-helpers.js.map +1 -1
  7. package/build/lib/bootstrap.d.ts +29 -0
  8. package/build/lib/bootstrap.d.ts.map +1 -0
  9. package/build/lib/bootstrap.js +192 -179
  10. package/build/lib/bootstrap.js.map +1 -1
  11. package/build/lib/commands/actions.d.ts +209 -0
  12. package/build/lib/commands/actions.d.ts.map +1 -0
  13. package/build/lib/commands/actions.js +327 -265
  14. package/build/lib/commands/actions.js.map +1 -1
  15. package/build/lib/commands/alert.d.ts +10 -0
  16. package/build/lib/commands/alert.d.ts.map +1 -0
  17. package/build/lib/commands/alert.js +12 -18
  18. package/build/lib/commands/alert.js.map +1 -1
  19. package/build/lib/commands/app-management.d.ts +314 -0
  20. package/build/lib/commands/app-management.d.ts.map +1 -0
  21. package/build/lib/commands/app-management.js +278 -110
  22. package/build/lib/commands/app-management.js.map +1 -1
  23. package/build/lib/commands/context.d.ts +94 -0
  24. package/build/lib/commands/context.d.ts.map +1 -0
  25. package/build/lib/commands/context.js +412 -260
  26. package/build/lib/commands/context.js.map +1 -1
  27. package/build/lib/commands/coverage.d.ts +5 -0
  28. package/build/lib/commands/coverage.d.ts.map +1 -0
  29. package/build/lib/commands/coverage.js +14 -17
  30. package/build/lib/commands/coverage.js.map +1 -1
  31. package/build/lib/commands/element.d.ts +36 -0
  32. package/build/lib/commands/element.d.ts.map +1 -0
  33. package/build/lib/commands/element.js +97 -127
  34. package/build/lib/commands/element.js.map +1 -1
  35. package/build/lib/commands/emu-console.d.ts +49 -0
  36. package/build/lib/commands/emu-console.d.ts.map +1 -0
  37. package/build/lib/commands/emu-console.js +36 -25
  38. package/build/lib/commands/emu-console.js.map +1 -1
  39. package/build/lib/commands/execute.d.ts +6 -0
  40. package/build/lib/commands/execute.d.ts.map +1 -0
  41. package/build/lib/commands/execute.js +68 -69
  42. package/build/lib/commands/execute.js.map +1 -1
  43. package/build/lib/commands/file-actions.d.ts +129 -0
  44. package/build/lib/commands/file-actions.d.ts.map +1 -0
  45. package/build/lib/commands/file-actions.js +321 -178
  46. package/build/lib/commands/file-actions.js.map +1 -1
  47. package/build/lib/commands/find.d.ts +13 -0
  48. package/build/lib/commands/find.d.ts.map +1 -0
  49. package/build/lib/commands/find.js +69 -51
  50. package/build/lib/commands/find.js.map +1 -1
  51. package/build/lib/commands/general.d.ts +133 -0
  52. package/build/lib/commands/general.d.ts.map +1 -0
  53. package/build/lib/commands/general.js +275 -216
  54. package/build/lib/commands/general.js.map +1 -1
  55. package/build/lib/commands/ime.d.ts +11 -0
  56. package/build/lib/commands/ime.d.ts.map +1 -0
  57. package/build/lib/commands/ime.js +27 -33
  58. package/build/lib/commands/ime.js.map +1 -1
  59. package/build/lib/commands/index.d.ts +3 -0
  60. package/build/lib/commands/index.d.ts.map +1 -0
  61. package/build/lib/commands/index.js +32 -35
  62. package/build/lib/commands/index.js.map +1 -1
  63. package/build/lib/commands/intent.d.ts +418 -0
  64. package/build/lib/commands/intent.d.ts.map +1 -0
  65. package/build/lib/commands/intent.js +281 -151
  66. package/build/lib/commands/intent.js.map +1 -1
  67. package/build/lib/commands/keyboard.d.ts +6 -0
  68. package/build/lib/commands/keyboard.d.ts.map +1 -0
  69. package/build/lib/commands/keyboard.js +6 -14
  70. package/build/lib/commands/keyboard.js.map +1 -1
  71. package/build/lib/commands/log.d.ts +45 -0
  72. package/build/lib/commands/log.d.ts.map +1 -0
  73. package/build/lib/commands/log.js +117 -103
  74. package/build/lib/commands/log.js.map +1 -1
  75. package/build/lib/commands/media-projection.d.ts +144 -0
  76. package/build/lib/commands/media-projection.d.ts.map +1 -0
  77. package/build/lib/commands/media-projection.js +228 -171
  78. package/build/lib/commands/media-projection.js.map +1 -1
  79. package/build/lib/commands/network.d.ts +139 -0
  80. package/build/lib/commands/network.d.ts.map +1 -0
  81. package/build/lib/commands/network.js +249 -181
  82. package/build/lib/commands/network.js.map +1 -1
  83. package/build/lib/commands/performance.d.ts +101 -0
  84. package/build/lib/commands/performance.d.ts.map +1 -0
  85. package/build/lib/commands/performance.js +390 -236
  86. package/build/lib/commands/performance.js.map +1 -1
  87. package/build/lib/commands/permissions.d.ts +93 -0
  88. package/build/lib/commands/permissions.d.ts.map +1 -0
  89. package/build/lib/commands/permissions.js +133 -93
  90. package/build/lib/commands/permissions.js.map +1 -1
  91. package/build/lib/commands/recordscreen.d.ts +194 -0
  92. package/build/lib/commands/recordscreen.d.ts.map +1 -0
  93. package/build/lib/commands/recordscreen.js +293 -224
  94. package/build/lib/commands/recordscreen.js.map +1 -1
  95. package/build/lib/commands/shell.d.ts +8 -0
  96. package/build/lib/commands/shell.d.ts.map +1 -0
  97. package/build/lib/commands/shell.js +38 -43
  98. package/build/lib/commands/shell.js.map +1 -1
  99. package/build/lib/commands/streamscreen.d.ts +104 -0
  100. package/build/lib/commands/streamscreen.d.ts.map +1 -0
  101. package/build/lib/commands/streamscreen.js +364 -305
  102. package/build/lib/commands/streamscreen.js.map +1 -1
  103. package/build/lib/commands/system-bars.d.ts +100 -0
  104. package/build/lib/commands/system-bars.d.ts.map +1 -0
  105. package/build/lib/commands/system-bars.js +148 -90
  106. package/build/lib/commands/system-bars.js.map +1 -1
  107. package/build/lib/commands/touch.d.ts +30 -0
  108. package/build/lib/commands/touch.d.ts.map +1 -0
  109. package/build/lib/commands/touch.js +311 -287
  110. package/build/lib/commands/touch.js.map +1 -1
  111. package/build/lib/desired-caps.d.ts +353 -0
  112. package/build/lib/desired-caps.d.ts.map +1 -0
  113. package/build/lib/desired-caps.js +291 -292
  114. package/build/lib/desired-caps.js.map +1 -1
  115. package/build/lib/driver.d.ts +430 -0
  116. package/build/lib/driver.d.ts.map +1 -0
  117. package/build/lib/driver.js +449 -384
  118. package/build/lib/driver.js.map +1 -1
  119. package/build/lib/logger.d.ts +3 -0
  120. package/build/lib/logger.d.ts.map +1 -0
  121. package/build/lib/logger.js +5 -11
  122. package/build/lib/logger.js.map +1 -1
  123. package/build/lib/method-map.d.ts +389 -0
  124. package/build/lib/method-map.d.ts.map +1 -0
  125. package/build/lib/method-map.js +220 -394
  126. package/build/lib/method-map.js.map +1 -1
  127. package/build/lib/stubs.d.ts +8 -0
  128. package/build/lib/stubs.d.ts.map +1 -0
  129. package/build/lib/stubs.js +5 -0
  130. package/build/lib/stubs.js.map +1 -0
  131. package/build/lib/uiautomator.d.ts +24 -0
  132. package/build/lib/uiautomator.d.ts.map +1 -0
  133. package/build/lib/uiautomator.js +86 -82
  134. package/build/lib/uiautomator.js.map +1 -1
  135. package/build/lib/unlock-helpers.d.ts +38 -0
  136. package/build/lib/unlock-helpers.d.ts.map +1 -0
  137. package/build/lib/unlock-helpers.js +228 -204
  138. package/build/lib/unlock-helpers.js.map +1 -1
  139. package/build/lib/utils.d.ts +11 -0
  140. package/build/lib/utils.d.ts.map +1 -0
  141. package/build/lib/utils.js +23 -18
  142. package/build/lib/utils.js.map +1 -1
  143. package/build/lib/webview-helpers.d.ts +223 -0
  144. package/build/lib/webview-helpers.d.ts.map +1 -0
  145. package/build/lib/webview-helpers.js +476 -298
  146. package/build/lib/webview-helpers.js.map +1 -1
  147. package/index.js +3 -1
  148. package/lib/android-helpers.js +2 -1
  149. package/lib/stubs.ts +8 -0
  150. package/lib/unlock-helpers.js +2 -2
  151. package/package.json +23 -14
@@ -0,0 +1,101 @@
1
+ export default commands;
2
+ export type PerformanceDataOptions = {
3
+ /**
4
+ * The name of the package identifier to fetch the data for
5
+ */
6
+ packageName: string;
7
+ /**
8
+ * One of supported subsystem
9
+ * to fetch the data for.
10
+ */
11
+ dataType: 'batteryinfo' | 'cpuinfo' | 'memoryinfo' | 'networkinfo';
12
+ };
13
+ export namespace commands {
14
+ function getPerformanceDataTypes(): string[];
15
+ /**
16
+ * @returns The information type of the system state which is supported to read as like cpu, memory, network traffic, and battery.
17
+ * input - (packageName) the package name of the application
18
+ * (dataType) the type of system state which wants to read. It should be one of the keys of the SUPPORTED_PERFORMANCE_DATA_TYPES
19
+ * (dataReadTimeout) the number of attempts to read
20
+ * output - table of the performance data, The first line of the table represents the type of data. The remaining lines represent the values of the data.
21
+ *
22
+ * in case of battery info : [[power], [23]]
23
+ * in case of memory info : [[totalPrivateDirty, nativePrivateDirty, dalvikPrivateDirty, eglPrivateDirty, glPrivateDirty, totalPss,
24
+ * nativePss, dalvikPss, eglPss, glPss, nativeHeapAllocatedSize, nativeHeapSize], [18360, 8296, 6132, null, null, 42588, 8406, 7024, null, null, 26519, 10344]]
25
+ * in case of network info : [[bucketStart, activeTime, rxBytes, rxPackets, txBytes, txPackets, operations, bucketDuration,],
26
+ * [1478091600000, null, 1099075, 610947, 928, 114362, 769, 0, 3600000], [1478095200000, null, 1306300, 405997, 509, 46359, 370, 0, 3600000]]
27
+ * in case of network info : [[st, activeTime, rb, rp, tb, tp, op, bucketDuration], [1478088000, null, null, 32115296, 34291, 2956805, 25705, 0, 3600],
28
+ * [1478091600, null, null, 2714683, 11821, 1420564, 12650, 0, 3600], [1478095200, null, null, 10079213, 19962, 2487705, 20015, 0, 3600],
29
+ * [1478098800, null, null, 4444433, 10227, 1430356, 10493, 0, 3600]]
30
+ * in case of cpu info : [[user, kernel], [0.9, 1.3]]
31
+ */
32
+ function getPerformanceData(packageName: any, dataType: any, retries?: number): Promise<any>;
33
+ /**
34
+ * @typedef {Object} PerformanceDataOptions
35
+ * @property {string} packageName The name of the package identifier to fetch the data for
36
+ * @property {'batteryinfo' | 'cpuinfo' | 'memoryinfo' | 'networkinfo'} dataType One of supported subsystem
37
+ * to fetch the data for.
38
+ */
39
+ /**
40
+ * Retrieves performance data about the given Android subsystem.
41
+ * The data is parsed from the output of the dumpsys utility.
42
+ *
43
+ * @param {PerformanceDataOptions} opts
44
+ * @returns {Promise<any[][]>} The output depends on the selected subsystem.
45
+ * It is orginized into a table, where the first row represent column names
46
+ * and the following rows represent the sampled data for each column.
47
+ * Example output for different data types:
48
+ * - batteryinfo: [[power], [23]]
49
+ * - memory info: [[totalPrivateDirty, nativePrivateDirty, dalvikPrivateDirty, eglPrivateDirty, glPrivateDirty, totalPss,
50
+ * nativePss, dalvikPss, eglPss, glPss, nativeHeapAllocatedSize, nativeHeapSize], [18360, 8296, 6132, null, null, 42588, 8406, 7024, null, null, 26519, 10344]]
51
+ * - networkinfo: [[bucketStart, activeTime, rxBytes, rxPackets, txBytes, txPackets, operations, bucketDuration,],
52
+ * [1478091600000, null, 1099075, 610947, 928, 114362, 769, 0, 3600000], [1478095200000, null, 1306300, 405997, 509, 46359, 370, 0, 3600000]]
53
+ *
54
+ * [[st, activeTime, rb, rp, tb, tp, op, bucketDuration], [1478088000, null, null, 32115296, 34291, 2956805, 25705, 0, 3600],
55
+ * [1478091600, null, null, 2714683, 11821, 1420564, 12650, 0, 3600], [1478095200, null, null, 10079213, 19962, 2487705, 20015, 0, 3600],
56
+ * [1478098800, null, null, 4444433, 10227, 1430356, 10493, 0, 3600]]
57
+ * - cpuinfo: [[user, kernel], [0.9, 1.3]]
58
+ */
59
+ function mobileGetPerformanceData(opts?: PerformanceDataOptions): Promise<any[][]>;
60
+ }
61
+ export const SUPPORTED_PERFORMANCE_DATA_TYPES: Readonly<{
62
+ cpuinfo: "the amount of cpu by user and kernel process - cpu information for applications on real devices and simulators";
63
+ memoryinfo: "the amount of memory used by the process - memory information for applications on real devices and simulators";
64
+ batteryinfo: "the remaining battery power - battery power information for applications on real devices and simulators";
65
+ networkinfo: "the network statistics - network rx/tx information for applications on real devices and simulators";
66
+ }>;
67
+ export const CPU_KEYS: string[];
68
+ export const MEMORY_KEYS: string[];
69
+ export const BATTERY_KEYS: string[];
70
+ export const NETWORK_KEYS: string[][];
71
+ export function getMemoryInfo(packageName: any, retries?: number): Promise<any[][] | null>;
72
+ /**
73
+ * @this {AndroidDriver}
74
+ * @param {number} retries
75
+ */
76
+ export function getNetworkTrafficInfo(this: AndroidDriver, retries?: number): Promise<any[][] | null>;
77
+ /**
78
+ * Return the CPU information related to the given packageName.
79
+ * It raises an exception if the dumped CPU information did not include the given packageName
80
+ * or the format was wrong.
81
+ * The CPU information's sampling interval depends on the device under test.
82
+ * For example, some devices have 5 minutes interval. When you get the information
83
+ * from 2023-02-07 11:59:40.468 to 2023-02-07 12:04:40.556, then the next will be
84
+ * from 2023-02-07 12:04:40.556 to 2023-02-07 12:09:40.668. No process information
85
+ * exists in the result if the process was not running during the period.
86
+ *
87
+ * @this {AndroidDriver}
88
+ * @param {string} packageName The package name to get the CPU information.
89
+ * @param {number} retries The number of retry count.
90
+ * @returns {Array} The array of the parsed CPU upsage percentages.
91
+ * e.g. ['cpuinfo', ['14.3', '28.2']]
92
+ * '14.3' is usage by the user (%), '28.2' is usage by the kernel (%)
93
+ * @throw {Error} If it failed to parse the result of dumpsys, or no package name exists.
94
+ */
95
+ export function getCPUInfo(this: AndroidDriver, packageName: string, retries?: number): any[];
96
+ /**
97
+ * @this {AndroidDriver}
98
+ * @param {number} retries
99
+ */
100
+ export function getBatteryInfo(this: AndroidDriver, retries?: number): Promise<string[][] | null>;
101
+ //# sourceMappingURL=performance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../lib/commands/performance.js"],"names":[],"mappings":";;;;;iBAgZc,MAAM;;;;;cACN,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa;;;IAxCtE,6CAEC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,6FAcC;IAED;;;;;OAKG;IAEH;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mFAGC;;AAzZD;;;;;GAKG;AAdH,gCAAoC;AAEpC,mCAME;AAPF,oCAA+B;AAL/B,sCAGE;AAyFF,2FAgCC;AAED;;;GAGG;AACH,qEAFW,MAAM,2BAyJhB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,6DAPW,MAAM,YACN,MAAM,SAiChB;AAED;;;GAGG;AACH,8DAFW,MAAM,8BAgBhB"}