appium-xcuitest-driver 10.8.3 → 10.8.4

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 (66) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/lib/commands/app-management.js +1 -1
  3. package/build/lib/commands/app-management.js.map +1 -1
  4. package/build/lib/commands/file-movement.d.ts.map +1 -1
  5. package/build/lib/commands/file-movement.js +4 -4
  6. package/build/lib/commands/file-movement.js.map +1 -1
  7. package/build/lib/commands/memory.js +1 -1
  8. package/build/lib/commands/memory.js.map +1 -1
  9. package/build/lib/commands/performance.d.ts.map +1 -1
  10. package/build/lib/commands/performance.js +13 -4
  11. package/build/lib/commands/performance.js.map +1 -1
  12. package/build/lib/commands/xctest-record-screen.js +1 -1
  13. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  14. package/build/lib/device/device-connections-factory.d.ts +18 -0
  15. package/build/lib/device/device-connections-factory.d.ts.map +1 -0
  16. package/build/lib/{device-connections-factory.js → device/device-connections-factory.js} +57 -41
  17. package/build/lib/device/device-connections-factory.js.map +1 -0
  18. package/build/lib/device/real-device-management.d.ts +146 -0
  19. package/build/lib/device/real-device-management.d.ts.map +1 -0
  20. package/build/lib/device/real-device-management.js +727 -0
  21. package/build/lib/device/real-device-management.js.map +1 -0
  22. package/build/lib/device/simulator-management.d.ts +65 -0
  23. package/build/lib/device/simulator-management.d.ts.map +1 -0
  24. package/build/lib/{simulator-management.js → device/simulator-management.js} +23 -42
  25. package/build/lib/device/simulator-management.js.map +1 -0
  26. package/build/lib/driver.d.ts +1 -1
  27. package/build/lib/driver.d.ts.map +1 -1
  28. package/build/lib/driver.js +5 -6
  29. package/build/lib/driver.js.map +1 -1
  30. package/lib/commands/app-management.js +1 -1
  31. package/lib/commands/file-movement.js +8 -4
  32. package/lib/commands/memory.js +1 -1
  33. package/lib/commands/performance.js +12 -1
  34. package/lib/commands/xctest-record-screen.js +1 -1
  35. package/lib/{device-connections-factory.js → device/device-connections-factory.ts} +96 -60
  36. package/lib/device/real-device-management.ts +818 -0
  37. package/lib/{simulator-management.js → device/simulator-management.ts} +68 -61
  38. package/lib/driver.js +3 -5
  39. package/npm-shrinkwrap.json +2 -2
  40. package/package.json +1 -1
  41. package/build/lib/device-connections-factory.d.ts +0 -13
  42. package/build/lib/device-connections-factory.d.ts.map +0 -1
  43. package/build/lib/device-connections-factory.js.map +0 -1
  44. package/build/lib/ios-fs-helpers.d.ts +0 -75
  45. package/build/lib/ios-fs-helpers.d.ts.map +0 -1
  46. package/build/lib/ios-fs-helpers.js +0 -370
  47. package/build/lib/ios-fs-helpers.js.map +0 -1
  48. package/build/lib/real-device-management.d.ts +0 -53
  49. package/build/lib/real-device-management.d.ts.map +0 -1
  50. package/build/lib/real-device-management.js +0 -128
  51. package/build/lib/real-device-management.js.map +0 -1
  52. package/build/lib/real-device.d.ts +0 -112
  53. package/build/lib/real-device.d.ts.map +0 -1
  54. package/build/lib/real-device.js +0 -352
  55. package/build/lib/real-device.js.map +0 -1
  56. package/build/lib/simulator-management.d.ts +0 -96
  57. package/build/lib/simulator-management.d.ts.map +0 -1
  58. package/build/lib/simulator-management.js.map +0 -1
  59. package/build/lib/xcrun.d.ts +0 -3
  60. package/build/lib/xcrun.d.ts.map +0 -1
  61. package/build/lib/xcrun.js +0 -17
  62. package/build/lib/xcrun.js.map +0 -1
  63. package/lib/ios-fs-helpers.js +0 -355
  64. package/lib/real-device-management.js +0 -133
  65. package/lib/real-device.js +0 -347
  66. package/lib/xcrun.js +0 -16
@@ -0,0 +1,146 @@
1
+ import { Devicectl } from 'node-devicectl';
2
+ import type { AppiumLogger } from '@appium/types';
3
+ import type { XCUITestDriver } from '../driver';
4
+ export declare const IO_TIMEOUT_MS: number;
5
+ /**
6
+ * Retrieve a file from a real device
7
+ *
8
+ * @param afcService Apple File Client service instance from
9
+ * 'appium-ios-device' module
10
+ * @param remotePath Relative path to the file on the device
11
+ * @returns The file content as a buffer
12
+ */
13
+ export declare function pullFile(afcService: any, remotePath: string): Promise<Buffer>;
14
+ /**
15
+ * Retrieve a folder from a real device
16
+ *
17
+ * @param afcService Apple File Client service instance from
18
+ * 'appium-ios-device' module
19
+ * @param remoteRootPath Relative path to the folder on the device
20
+ * @returns The folder content as a zipped base64-encoded buffer
21
+ */
22
+ export declare function pullFolder(afcService: any, remoteRootPath: string): Promise<Buffer>;
23
+ /**
24
+ * Pushes a file to a real device
25
+ *
26
+ * @param afcService afcService Apple File Client service instance from
27
+ * 'appium-ios-device' module
28
+ * @param localPathOrPayload Either full path to the source file
29
+ * or a buffer payload to be written into the remote destination
30
+ * @param remotePath Relative path to the file on the device. The remote
31
+ * folder structure is created automatically if necessary.
32
+ * @param opts Push file options
33
+ */
34
+ export declare function pushFile(afcService: any, localPathOrPayload: string | Buffer, remotePath: string, opts?: PushFileOptions): Promise<void>;
35
+ /**
36
+ * Pushes a folder to a real device
37
+ *
38
+ * @param afcService Apple File Client service instance from
39
+ * 'appium-ios-device' module
40
+ * @param srcRootPath The full path to the source folder
41
+ * @param dstRootPath The relative path to the destination folder. The folder
42
+ * will be deleted if already exists.
43
+ * @param opts Push folder options
44
+ */
45
+ export declare function pushFolder(afcService: any, srcRootPath: string, dstRootPath: string, opts?: PushFolderOptions): Promise<void>;
46
+ /**
47
+ * Get list of connected devices
48
+ */
49
+ export declare function getConnectedDevices(): Promise<string[]>;
50
+ export declare class RealDevice {
51
+ readonly udid: string;
52
+ private readonly _log;
53
+ readonly devicectl: Devicectl;
54
+ constructor(udid: string, logger?: AppiumLogger);
55
+ get log(): AppiumLogger;
56
+ remove(bundleId: string): Promise<void>;
57
+ removeApp(bundleId: string): Promise<void>;
58
+ install(appPath: string, bundleId: string, opts?: RealDeviceInstallOptions): Promise<void>;
59
+ installOrUpgradeApplication(bundlePathOnPhone: string, opts: InstallOrUpgradeOptions): Promise<void>;
60
+ /**
61
+ * Alias for {@linkcode install}
62
+ */
63
+ installApp(appPath: string, bundleId: string, opts?: RealDeviceInstallOptions): Promise<void>;
64
+ /**
65
+ * Return an application object if test app has 'bundleid'.
66
+ * The target bundleid can be User and System apps.
67
+ *
68
+ * @param bundleId The bundleId to ensure it is installed
69
+ * @returns Returns True if the app is installed on the device under test.
70
+ */
71
+ isAppInstalled(bundleId: string): Promise<boolean>;
72
+ /**
73
+ * Fetches various attributes, like bundle id, version, entitlements etc. of
74
+ * an installed application.
75
+ *
76
+ * @param bundleId the bundle identifier of an app to check
77
+ * @param returnAttributes If provided then
78
+ * only fetches the requested attributes of the app into the resulting object.
79
+ * Some apps may have too many attributes, so it makes sense to limit these
80
+ * by default if you don't need all of them.
81
+ * @returns Either app info as an object or undefined if the app is not found.
82
+ */
83
+ fetchAppInfo(bundleId: string, returnAttributes?: string | string[]): Promise<Record<string, any> | undefined>;
84
+ terminateApp(bundleId: string, platformVersion: string): Promise<boolean>;
85
+ /**
86
+ * @param bundleName The name of CFBundleName in Info.plist
87
+ *
88
+ * @returns A list of User level apps' bundle ids which has
89
+ * 'CFBundleName' attribute as 'bundleName'.
90
+ */
91
+ getUserInstalledBundleIdsByBundleName(bundleName: string): Promise<string[]>;
92
+ getPlatformVersion(): Promise<string>;
93
+ reset(opts: {
94
+ bundleId?: string;
95
+ fullReset?: boolean;
96
+ }): Promise<void>;
97
+ }
98
+ /**
99
+ * Install app to real device
100
+ */
101
+ export declare function installToRealDevice(this: XCUITestDriver, app: string, bundleId?: string, opts?: ManagementInstallOptions): Promise<void>;
102
+ /**
103
+ * Run real device reset
104
+ */
105
+ export declare function runRealDeviceReset(this: XCUITestDriver): Promise<void>;
106
+ /**
107
+ * Configures Safari startup options based on the given session capabilities.
108
+ *
109
+ * !!! This method mutates driver options.
110
+ *
111
+ * @returns true if process arguments have been modified
112
+ */
113
+ export declare function applySafariStartupArgs(this: XCUITestDriver): boolean;
114
+ /**
115
+ * Auto-detect device UDID
116
+ */
117
+ export declare function detectUdid(this: XCUITestDriver): Promise<string>;
118
+ export interface PushFileOptions {
119
+ /** The maximum count of milliceconds to wait until file push is completed. Cannot be lower than 60000ms */
120
+ timeoutMs?: number;
121
+ }
122
+ export interface PushFolderOptions {
123
+ /** The maximum timeout to wait until a single file is copied */
124
+ timeoutMs?: number;
125
+ /** Whether to push files in parallel. This usually gives better performance, but might sometimes be less stable. */
126
+ enableParallelPush?: boolean;
127
+ }
128
+ export interface RealDeviceInstallOptions {
129
+ /** Application installation timeout in milliseconds */
130
+ timeoutMs?: number;
131
+ }
132
+ export interface InstallOrUpgradeOptions {
133
+ /** Install/upgrade timeout in milliseconds */
134
+ timeout: number;
135
+ /** Whether it is an app upgrade or a new install */
136
+ isUpgrade: boolean;
137
+ }
138
+ export interface ManagementInstallOptions {
139
+ /** Whether to skip app uninstall before installing it */
140
+ skipUninstall?: boolean;
141
+ /** App install timeout */
142
+ timeout?: number;
143
+ /** Whether to enforce the app uninstallation. e.g. fullReset, or enforceAppInstall is true */
144
+ shouldEnforceUninstall?: boolean;
145
+ }
146
+ //# sourceMappingURL=real-device-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"real-device-management.d.ts","sourceRoot":"","sources":["../../../lib/device/real-device-management.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,eAAO,MAAM,aAAa,QAAgB,CAAC;AAU3C;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAUnF;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwEzF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,GAA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