appium-webdriveragent 3.9.2 → 3.12.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.
Files changed (65) hide show
  1. package/PrivateHeaders/.DS_Store +0 -0
  2. package/PrivateHeaders/XCTest/XCTestManager_ManagerInterface-Protocol.h +3 -0
  3. package/README.md +0 -1
  4. package/WebDriverAgent.xcodeproj/project.pbxproj +56 -56
  5. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/elf.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  6. package/WebDriverAgent.xcodeproj/xcuserdata/elf.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +51 -0
  7. package/WebDriverAgent.xcodeproj/xcuserdata/{kazuaki.xcuserdatad → elf.xcuserdatad}/xcschemes/xcschememanagement.plist +23 -8
  8. package/WebDriverAgentLib/.DS_Store +0 -0
  9. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +0 -17
  10. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +0 -16
  11. package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +28 -14
  12. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.h +37 -0
  13. package/WebDriverAgentLib/Categories/XCUIElement+FBResolve.m +51 -0
  14. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +8 -2
  15. package/WebDriverAgentLib/Commands/FBElementCommands.m +3 -1
  16. package/WebDriverAgentLib/Commands/FBOrientationCommands.m +20 -9
  17. package/WebDriverAgentLib/Commands/FBSessionCommands.m +119 -99
  18. package/WebDriverAgentLib/FBApplication.m +1 -1
  19. package/WebDriverAgentLib/Routing/FBElementCache.m +42 -11
  20. package/WebDriverAgentLib/Routing/FBResponsePayload.m +9 -3
  21. package/WebDriverAgentLib/Routing/FBSession.h +6 -0
  22. package/WebDriverAgentLib/Routing/FBSession.m +45 -55
  23. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.h +1 -3
  24. package/WebDriverAgentLib/Utilities/FBAlertsMonitor.m +6 -13
  25. package/WebDriverAgentLib/Utilities/FBCapabilities.h +23 -0
  26. package/WebDriverAgentLib/Utilities/FBCapabilities.m +23 -0
  27. package/WebDriverAgentLib/Utilities/FBConfiguration.m +6 -1
  28. package/WebDriverAgentLib/Utilities/FBScreenshot.m +125 -14
  29. package/WebDriverAgentLib/Utilities/FBSettings.h +23 -23
  30. package/WebDriverAgentLib/Utilities/FBSettings.m +23 -23
  31. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +16 -0
  32. package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +16 -0
  33. package/WebDriverAgentLib/Utilities/FBXPath.m +15 -44
  34. package/WebDriverAgentLib/Utilities/LRUCache/.DS_Store +0 -0
  35. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.h +59 -0
  36. package/WebDriverAgentLib/Utilities/LRUCache/LRUCache.m +104 -0
  37. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.h +43 -0
  38. package/WebDriverAgentLib/Utilities/LRUCache/LRUCacheNode.m +59 -0
  39. package/WebDriverAgentLib/Vendor/.DS_Store +0 -0
  40. package/WebDriverAgentRunner/.DS_Store +0 -0
  41. package/WebDriverAgentRunner-Runner.app.zip +0 -0
  42. package/WebDriverAgentTests/IntegrationApp/Resources/.DS_Store +0 -0
  43. package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +20 -16
  44. package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +2 -1
  45. package/WebDriverAgentTests/IntegrationTests/XCUIElementFBFindTests.m +11 -0
  46. package/WebDriverAgentTests/UnitTests/Doubles/FBApplicationDouble.h +3 -0
  47. package/WebDriverAgentTests/UnitTests/Doubles/FBApplicationDouble.m +15 -0
  48. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +1 -0
  49. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +1 -0
  50. package/WebDriverAgentTests/UnitTests/FBSessionTests.m +11 -1
  51. package/WebDriverAgentTests/UnitTests/FBXPathTests.m +3 -1
  52. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +1 -0
  53. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +1 -0
  54. package/package.json +3 -3
  55. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  56. package/WebDriverAgent.xcodeproj/project.xcworkspace/xcuserdata/kazuaki.xcuserdatad/WorkspaceSettings.xcsettings +0 -20
  57. package/WebDriverAgent.xcodeproj/xcuserdata/kazuaki.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -906
  58. package/WebDriverAgentLib/Vendor/YYCache/YYCache.h +0 -206
  59. package/WebDriverAgentLib/Vendor/YYCache/YYCache.m +0 -140
  60. package/WebDriverAgentLib/Vendor/YYCache/YYDiskCache.h +0 -412
  61. package/WebDriverAgentLib/Vendor/YYCache/YYDiskCache.m +0 -462
  62. package/WebDriverAgentLib/Vendor/YYCache/YYKVStorage.h +0 -325
  63. package/WebDriverAgentLib/Vendor/YYCache/YYKVStorage.m +0 -1068
  64. package/WebDriverAgentLib/Vendor/YYCache/YYMemoryCache.h +0 -213
  65. package/WebDriverAgentLib/Vendor/YYCache/YYMemoryCache.m +0 -508
@@ -1,325 +0,0 @@
1
- //
2
- // YYKVStorage.h
3
- // YYCache <https://github.com/ibireme/YYCache>
4
- //
5
- // Created by ibireme on 15/4/22.
6
- // Copyright (c) 2015 ibireme.
7
- //
8
- // This source code is licensed under the MIT-style license found in the
9
- // LICENSE file in the root directory of this source tree.
10
- //
11
-
12
- #import <Foundation/Foundation.h>
13
-
14
- NS_ASSUME_NONNULL_BEGIN
15
-
16
- /**
17
- YYKVStorageItem is used by `YYKVStorage` to store key-value pair and meta data.
18
- Typically, you should not use this class directly.
19
- */
20
- @interface YYKVStorageItem : NSObject
21
- @property (nonatomic, strong) NSString *key; ///< key
22
- @property (nonatomic, strong) NSData *value; ///< value
23
- @property (nullable, nonatomic, strong) NSString *filename; ///< filename (nil if inline)
24
- @property (nonatomic) int size; ///< value's size in bytes
25
- @property (nonatomic) int modTime; ///< modification unix timestamp
26
- @property (nonatomic) int accessTime; ///< last access unix timestamp
27
- @property (nullable, nonatomic, strong) NSData *extendedData; ///< extended data (nil if no extended data)
28
- @end
29
-
30
- /**
31
- Storage type, indicated where the `YYKVStorageItem.value` stored.
32
-
33
- @discussion Typically, write data to sqlite is faster than extern file, but
34
- reading performance is dependent on data size. In my test (on iPhone 6 64G),
35
- read data from extern file is faster than from sqlite when the data is larger
36
- than 20KB.
37
-
38
- * If you want to store large number of small datas (such as contacts cache),
39
- use YYKVStorageTypeSQLite to get better performance.
40
- * If you want to store large files (such as image cache),
41
- use YYKVStorageTypeFile to get better performance.
42
- * You can use YYKVStorageTypeMixed and choice your storage type for each item.
43
-
44
- See <http://www.sqlite.org/intern-v-extern-blob.html> for more information.
45
- */
46
- typedef NS_ENUM(NSUInteger, YYKVStorageType) {
47
-
48
- /// The `value` is stored as a file in file system.
49
- YYKVStorageTypeFile = 0,
50
-
51
- /// The `value` is stored in sqlite with blob type.
52
- YYKVStorageTypeSQLite = 1,
53
-
54
- /// The `value` is stored in file system or sqlite based on your choice.
55
- YYKVStorageTypeMixed = 2,
56
- };
57
-
58
-
59
-
60
- /**
61
- YYKVStorage is a key-value storage based on sqlite and file system.
62
- Typically, you should not use this class directly.
63
-
64
- @discussion The designated initializer for YYKVStorage is `initWithPath:type:`.
65
- After initialized, a directory is created based on the `path` to hold key-value data.
66
- Once initialized you should not read or write this directory without the instance.
67
-
68
- You may compile the latest version of sqlite and ignore the libsqlite3.dylib in
69
- iOS system to get 2x~4x speed up.
70
-
71
- @warning The instance of this class is *NOT* thread safe, you need to make sure
72
- that there's only one thread to access the instance at the same time. If you really
73
- need to process large amounts of data in multi-thread, you should split the data
74
- to multiple KVStorage instance (sharding).
75
- */
76
- @interface YYKVStorage : NSObject
77
-
78
- #pragma mark - Attribute
79
- ///=============================================================================
80
- /// @name Attribute
81
- ///=============================================================================
82
-
83
- @property (nonatomic, readonly) NSString *path; ///< The path of this storage.
84
- @property (nonatomic, readonly) YYKVStorageType type; ///< The type of this storage.
85
- @property (nonatomic) BOOL errorLogsEnabled; ///< Set `YES` to enable error logs for debug.
86
-
87
- #pragma mark - Initializer
88
- ///=============================================================================
89
- /// @name Initializer
90
- ///=============================================================================
91
- - (instancetype)init UNAVAILABLE_ATTRIBUTE;
92
- + (instancetype)new UNAVAILABLE_ATTRIBUTE;
93
-
94
- /**
95
- The designated initializer.
96
-
97
- @param path Full path of a directory in which the storage will write data. If
98
- the directory is not exists, it will try to create one, otherwise it will
99
- read the data in this directory.
100
- @param type The storage type. After first initialized you should not change the
101
- type of the specified path.
102
- @return A new storage object, or nil if an error occurs.
103
- @warning Multiple instances with the same path will make the storage unstable.
104
- */
105
- - (nullable instancetype)initWithPath:(NSString *)path type:(YYKVStorageType)type NS_DESIGNATED_INITIALIZER;
106
-
107
-
108
- #pragma mark - Save Items
109
- ///=============================================================================
110
- /// @name Save Items
111
- ///=============================================================================
112
-
113
- /**
114
- Save an item or update the item with 'key' if it already exists.
115
-
116
- @discussion This method will save the item.key, item.value, item.filename and
117
- item.extendedData to disk or sqlite, other properties will be ignored. item.key
118
- and item.value should not be empty (nil or zero length).
119
-
120
- If the `type` is YYKVStorageTypeFile, then the item.filename should not be empty.
121
- If the `type` is YYKVStorageTypeSQLite, then the item.filename will be ignored.
122
- It the `type` is YYKVStorageTypeMixed, then the item.value will be saved to file
123
- system if the item.filename is not empty, otherwise it will be saved to sqlite.
124
-
125
- @param item An item.
126
- @return Whether succeed.
127
- */
128
- - (BOOL)saveItem:(YYKVStorageItem *)item;
129
-
130
- /**
131
- Save an item or update the item with 'key' if it already exists.
132
-
133
- @discussion This method will save the key-value pair to sqlite. If the `type` is
134
- YYKVStorageTypeFile, then this method will failed.
135
-
136
- @param key The key, should not be empty (nil or zero length).
137
- @param value The key, should not be empty (nil or zero length).
138
- @return Whether succeed.
139
- */
140
- - (BOOL)saveItemWithKey:(NSString *)key value:(NSData *)value;
141
-
142
- /**
143
- Save an item or update the item with 'key' if it already exists.
144
-
145
- @discussion
146
- If the `type` is YYKVStorageTypeFile, then the `filename` should not be empty.
147
- If the `type` is YYKVStorageTypeSQLite, then the `filename` will be ignored.
148
- It the `type` is YYKVStorageTypeMixed, then the `value` will be saved to file
149
- system if the `filename` is not empty, otherwise it will be saved to sqlite.
150
-
151
- @param key The key, should not be empty (nil or zero length).
152
- @param value The key, should not be empty (nil or zero length).
153
- @param filename The filename.
154
- @param extendedData The extended data for this item (pass nil to ignore it).
155
-
156
- @return Whether succeed.
157
- */
158
- - (BOOL)saveItemWithKey:(NSString *)key
159
- value:(NSData *)value
160
- filename:(nullable NSString *)filename
161
- extendedData:(nullable NSData *)extendedData;
162
-
163
- #pragma mark - Remove Items
164
- ///=============================================================================
165
- /// @name Remove Items
166
- ///=============================================================================
167
-
168
- /**
169
- Remove an item with 'key'.
170
-
171
- @param key The item's key.
172
- @return Whether succeed.
173
- */
174
- - (BOOL)removeItemForKey:(NSString *)key;
175
-
176
- /**
177
- Remove items with an array of keys.
178
-
179
- @param keys An array of specified keys.
180
-
181
- @return Whether succeed.
182
- */
183
- - (BOOL)removeItemForKeys:(NSArray<NSString *> *)keys;
184
-
185
- /**
186
- Remove all items which `value` is larger than a specified size.
187
-
188
- @param size The maximum size in bytes.
189
- @return Whether succeed.
190
- */
191
- - (BOOL)removeItemsLargerThanSize:(int)size;
192
-
193
- /**
194
- Remove all items which last access time is earlier than a specified timestamp.
195
-
196
- @param time The specified unix timestamp.
197
- @return Whether succeed.
198
- */
199
- - (BOOL)removeItemsEarlierThanTime:(int)time;
200
-
201
- /**
202
- Remove items to make the total size not larger than a specified size.
203
- The least recently used (LRU) items will be removed first.
204
-
205
- @param maxSize The specified size in bytes.
206
- @return Whether succeed.
207
- */
208
- - (BOOL)removeItemsToFitSize:(int)maxSize;
209
-
210
- /**
211
- Remove items to make the total count not larger than a specified count.
212
- The least recently used (LRU) items will be removed first.
213
-
214
- @param maxCount The specified item count.
215
- @return Whether succeed.
216
- */
217
- - (BOOL)removeItemsToFitCount:(int)maxCount;
218
-
219
- /**
220
- Remove all items in background queue.
221
-
222
- @discussion This method will remove the files and sqlite database to a trash
223
- folder, and then clear the folder in background queue. So this method is much
224
- faster than `removeAllItemsWithProgressBlock:endBlock:`.
225
-
226
- @return Whether succeed.
227
- */
228
- - (BOOL)removeAllItems;
229
-
230
- /**
231
- Remove all items.
232
-
233
- @warning You should not send message to this instance in these blocks.
234
- @param progress This block will be invoked during removing, pass nil to ignore.
235
- @param end This block will be invoked at the end, pass nil to ignore.
236
- */
237
- - (void)removeAllItemsWithProgressBlock:(nullable void(^)(int removedCount, int totalCount))progress
238
- endBlock:(nullable void(^)(BOOL error))end;
239
-
240
-
241
- #pragma mark - Get Items
242
- ///=============================================================================
243
- /// @name Get Items
244
- ///=============================================================================
245
-
246
- /**
247
- Get item with a specified key.
248
-
249
- @param key A specified key.
250
- @return Item for the key, or nil if not exists / error occurs.
251
- */
252
- - (nullable YYKVStorageItem *)getItemForKey:(NSString *)key;
253
-
254
- /**
255
- Get item information with a specified key.
256
- The `value` in this item will be ignored.
257
-
258
- @param key A specified key.
259
- @return Item information for the key, or nil if not exists / error occurs.
260
- */
261
- - (nullable YYKVStorageItem *)getItemInfoForKey:(NSString *)key;
262
-
263
- /**
264
- Get item value with a specified key.
265
-
266
- @param key A specified key.
267
- @return Item's value, or nil if not exists / error occurs.
268
- */
269
- - (nullable NSData *)getItemValueForKey:(NSString *)key;
270
-
271
- /**
272
- Get items with an array of keys.
273
-
274
- @param keys An array of specified keys.
275
- @return An array of `YYKVStorageItem`, or nil if not exists / error occurs.
276
- */
277
- - (nullable NSArray<YYKVStorageItem *> *)getItemForKeys:(NSArray<NSString *> *)keys;
278
-
279
- /**
280
- Get item infomartions with an array of keys.
281
- The `value` in items will be ignored.
282
-
283
- @param keys An array of specified keys.
284
- @return An array of `YYKVStorageItem`, or nil if not exists / error occurs.
285
- */
286
- - (nullable NSArray<YYKVStorageItem *> *)getItemInfoForKeys:(NSArray<NSString *> *)keys;
287
-
288
- /**
289
- Get items value with an array of keys.
290
-
291
- @param keys An array of specified keys.
292
- @return A dictionary which key is 'key' and value is 'value', or nil if not
293
- exists / error occurs.
294
- */
295
- - (nullable NSDictionary<NSString *, NSData *> *)getItemValueForKeys:(NSArray<NSString *> *)keys;
296
-
297
- #pragma mark - Get Storage Status
298
- ///=============================================================================
299
- /// @name Get Storage Status
300
- ///=============================================================================
301
-
302
- /**
303
- Whether an item exists for a specified key.
304
-
305
- @param key A specified key.
306
-
307
- @return `YES` if there's an item exists for the key, `NO` if not exists or an error occurs.
308
- */
309
- - (BOOL)itemExistsForKey:(NSString *)key;
310
-
311
- /**
312
- Get total item count.
313
- @return Total item count, -1 when an error occurs.
314
- */
315
- - (int)getItemsCount;
316
-
317
- /**
318
- Get item value's total size in bytes.
319
- @return Total size in bytes, -1 when an error occurs.
320
- */
321
- - (int)getItemsSize;
322
-
323
- @end
324
-
325
- NS_ASSUME_NONNULL_END