appium-webdriveragent 9.5.1 → 9.6.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 (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.m +2 -2
  3. package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +3 -3
  4. package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.m +1 -1
  5. package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +1 -1
  6. package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +1 -1
  7. package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +8 -8
  8. package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +4 -4
  9. package/WebDriverAgentLib/Categories/XCUIElement+FBUID.m +2 -2
  10. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +25 -3
  11. package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +12 -2
  12. package/WebDriverAgentLib/Categories/XCUIElement+FBVisibleFrame.m +1 -1
  13. package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +26 -17
  14. package/WebDriverAgentLib/Commands/FBElementCommands.m +3 -1
  15. package/WebDriverAgentLib/Commands/FBFindElementCommands.m +1 -1
  16. package/WebDriverAgentLib/FBAlert.m +5 -5
  17. package/WebDriverAgentLib/Info.plist +2 -2
  18. package/WebDriverAgentLib/Routing/FBElementCache.m +1 -1
  19. package/WebDriverAgentLib/Routing/FBResponsePayload.m +6 -2
  20. package/WebDriverAgentLib/Utilities/FBXPath.m +4 -4
  21. package/WebDriverAgentTests/IntegrationApp/Resources/Base.lproj/Main.storyboard +39 -32
  22. package/WebDriverAgentTests/IntegrationTests/FBElementAttributeTests.m +1 -1
  23. package/WebDriverAgentTests/IntegrationTests/FBW3CTouchActionsIntegrationTests.m +1 -1
  24. package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +4 -4
  25. package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHelperTests.m +9 -9
  26. package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHitPointTests.m +2 -1
  27. package/WebDriverAgentTests/IntegrationTests/XCUIElementHelperIntegrationTests.m +1 -1
  28. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +2 -1
  29. package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +6 -1
  30. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +2 -1
  31. package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +6 -1
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [9.6.0](https://github.com/appium/WebDriverAgent/compare/v9.5.2...v9.6.0) (2025-04-20)
2
+
3
+ ### Features
4
+
5
+ * Split custom and standard snapshotting methods ([#1008](https://github.com/appium/WebDriverAgent/issues/1008)) ([8358856](https://github.com/appium/WebDriverAgent/commit/8358856f5968977b13d5cbdafac97f3053dae56e))
6
+
7
+ ## [9.5.2](https://github.com/appium/WebDriverAgent/compare/v9.5.1...v9.5.2) (2025-04-19)
8
+
9
+ ### Bug Fixes
10
+
11
+ * Missing text in long text for get text/value ([#1007](https://github.com/appium/WebDriverAgent/issues/1007)) ([6603a0b](https://github.com/appium/WebDriverAgent/commit/6603a0ba384917d39389509958ccac03ad174610))
12
+
1
13
  ## [9.5.1](https://github.com/appium/WebDriverAgent/compare/v9.5.0...v9.5.1) (2025-04-10)
2
14
 
3
15
  ### Bug Fixes
@@ -52,7 +52,7 @@ NSString *const FB_SAFARI_APP_NAME = @"Safari";
52
52
  // and conatins at least one text view
53
53
  __block NSUInteger buttonsCount = 0;
54
54
  __block NSUInteger textViewsCount = 0;
55
- id<FBXCElementSnapshot> snapshot = candidate.fb_cachedSnapshot ?: [candidate fb_takeSnapshot:YES];
55
+ id<FBXCElementSnapshot> snapshot = candidate.fb_cachedSnapshot ?: [candidate fb_customSnapshot];
56
56
  [snapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
57
57
  XCUIElementType curType = descendant.elementType;
58
58
  if (curType == XCUIElementTypeButton) {
@@ -73,7 +73,7 @@ NSString *const FB_SAFARI_APP_NAME = @"Safari";
73
73
  if (nil == alert) {
74
74
  return nil;
75
75
  }
76
- id<FBXCElementSnapshot> alertSnapshot = alert.fb_cachedSnapshot ?: [alert fb_takeSnapshot:YES];
76
+ id<FBXCElementSnapshot> alertSnapshot = alert.fb_cachedSnapshot ?: [alert fb_customSnapshot];
77
77
 
78
78
  if (alertSnapshot.elementType == XCUIElementTypeAlert) {
79
79
  return alert;
@@ -176,7 +176,7 @@ NSDictionary<NSString *, NSString *> *customExclusionAttributesMap(void) {
176
176
 
177
177
  - (NSDictionary *)fb_tree:(nullable NSSet<NSString *> *)excludedAttributes
178
178
  {
179
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
179
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
180
180
  return [self.class dictionaryForElement:snapshot
181
181
  recursive:YES
182
182
  excludedAttributes:excludedAttributes];
@@ -184,7 +184,7 @@ NSDictionary<NSString *, NSString *> *customExclusionAttributesMap(void) {
184
184
 
185
185
  - (NSDictionary *)fb_accessibilityTree
186
186
  {
187
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
187
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
188
188
  return [self.class accessibilityInfoForElement:snapshot];
189
189
  }
190
190
 
@@ -434,7 +434,7 @@ NSDictionary<NSString *, NSString *> *customExclusionAttributesMap(void) {
434
434
 
435
435
  id extractedElement = extractIssueProperty(issue, @"element");
436
436
 
437
- id<FBXCElementSnapshot> elementSnapshot = [extractedElement fb_cachedSnapshot] ?: [extractedElement fb_takeSnapshot:NO];
437
+ id<FBXCElementSnapshot> elementSnapshot = [extractedElement fb_cachedSnapshot] ?: [extractedElement fb_standardSnapshot];
438
438
  NSDictionary *elementAttributes = elementSnapshot
439
439
  ? [self.class dictionaryForElement:elementSnapshot
440
440
  recursive:NO
@@ -18,7 +18,7 @@
18
18
 
19
19
  - (BOOL)fb_isAccessibilityElement
20
20
  {
21
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:NO];
21
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
22
22
  return [FBXCElementSnapshotWrapper ensureWrapped:snapshot].fb_isAccessibilityElement;
23
23
  }
24
24
 
@@ -26,7 +26,7 @@ NSNumber* _Nullable fetchSnapshotVisibility(id<FBXCElementSnapshot> snapshot)
26
26
  - (BOOL)fb_isVisible
27
27
  {
28
28
  @autoreleasepool {
29
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:NO];
29
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
30
30
  return [FBXCElementSnapshotWrapper ensureWrapped:snapshot].fb_isVisible;
31
31
  }
32
32
  }
@@ -24,7 +24,7 @@ static const NSTimeInterval VALUE_CHANGE_TIMEOUT = 2;
24
24
 
25
25
  - (BOOL)fb_scrollWithOffset:(CGFloat)relativeHeightOffset error:(NSError **)error
26
26
  {
27
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:NO];
27
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
28
28
  NSString *previousValue = snapshot.value;
29
29
  XCUICoordinate *startCoord = [self coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.5)];
30
30
  XCUICoordinate *endCoord = [startCoord coordinateWithOffset:CGVectorMake(0.0, relativeHeightOffset * snapshot.frame.size.height)];
@@ -49,35 +49,35 @@ const CGFloat FBScrollTouchProportion = 0.75f;
49
49
 
50
50
  - (BOOL)fb_nativeScrollToVisibleWithError:(NSError **)error
51
51
  {
52
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
52
+ id<FBXCElementSnapshot> snapshot = [self fb_customSnapshot];
53
53
  return nil != [self _hitPointByAttemptingToScrollToVisibleSnapshot:snapshot
54
54
  error:error];
55
55
  }
56
56
 
57
57
  - (void)fb_scrollUpByNormalizedDistance:(CGFloat)distance
58
58
  {
59
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
59
+ id<FBXCElementSnapshot> snapshot = [self fb_customSnapshot];
60
60
  [[FBXCElementSnapshotWrapper ensureWrapped:snapshot] fb_scrollUpByNormalizedDistance:distance
61
61
  inApplication:self.application];
62
62
  }
63
63
 
64
64
  - (void)fb_scrollDownByNormalizedDistance:(CGFloat)distance
65
65
  {
66
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
66
+ id<FBXCElementSnapshot> snapshot = [self fb_customSnapshot];
67
67
  [[FBXCElementSnapshotWrapper ensureWrapped:snapshot] fb_scrollDownByNormalizedDistance:distance
68
68
  inApplication:self.application];
69
69
  }
70
70
 
71
71
  - (void)fb_scrollLeftByNormalizedDistance:(CGFloat)distance
72
72
  {
73
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
73
+ id<FBXCElementSnapshot> snapshot = [self fb_customSnapshot];
74
74
  [[FBXCElementSnapshotWrapper ensureWrapped:snapshot] fb_scrollLeftByNormalizedDistance:distance
75
75
  inApplication:self.application];
76
76
  }
77
77
 
78
78
  - (void)fb_scrollRightByNormalizedDistance:(CGFloat)distance
79
79
  {
80
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:YES];
80
+ id<FBXCElementSnapshot> snapshot = [self fb_customSnapshot];
81
81
  [[FBXCElementSnapshotWrapper ensureWrapped:snapshot] fb_scrollRightByNormalizedDistance:distance
82
82
  inApplication:self.application];
83
83
  }
@@ -99,7 +99,7 @@ const CGFloat FBScrollTouchProportion = 0.75f;
99
99
  scrollDirection:(FBXCUIElementScrollDirection)scrollDirection
100
100
  error:(NSError **)error
101
101
  {
102
- FBXCElementSnapshotWrapper *prescrollSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:[self fb_takeSnapshot:YES]];
102
+ FBXCElementSnapshotWrapper *prescrollSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:[self fb_customSnapshot]];
103
103
 
104
104
  if (prescrollSnapshot.isWDVisible) {
105
105
  return YES;
@@ -209,7 +209,7 @@ const CGFloat FBScrollTouchProportion = 0.75f;
209
209
  // Cell is now visible, but it might be only partialy visible, scrolling till whole frame is visible.
210
210
  // Sometimes, attempting to grab the parent snapshot of the target cell after scrolling is complete causes a stale element reference exception.
211
211
  // Trying fb_cachedSnapshot first
212
- FBXCElementSnapshotWrapper *targetCellSnapshotWrapped = [FBXCElementSnapshotWrapper ensureWrapped:[self fb_takeSnapshot:YES]];
212
+ FBXCElementSnapshotWrapper *targetCellSnapshotWrapped = [FBXCElementSnapshotWrapper ensureWrapped:[self fb_customSnapshot]];
213
213
  targetCellSnapshot = [targetCellSnapshotWrapped fb_parentCellSnapshot];
214
214
  CGRect visibleFrame = [FBXCElementSnapshotWrapper ensureWrapped:targetCellSnapshot].fb_visibleFrame;
215
215
 
@@ -229,7 +229,7 @@ const CGFloat FBScrollTouchProportion = 0.75f;
229
229
  return YES;
230
230
  }
231
231
 
232
- id<FBXCElementSnapshot> appSnapshot = [self.application fb_takeSnapshot:YES];
232
+ id<FBXCElementSnapshot> appSnapshot = [self.application fb_standardSnapshot];
233
233
  for (id<FBXCElementSnapshot> elementSnapshot in appSnapshot._allDescendants.copy) {
234
234
  FBXCElementSnapshotWrapper *wrappedElementSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:elementSnapshot];
235
235
  // We are comparing pre-scroll snapshot so frames are irrelevant.
@@ -91,7 +91,7 @@ BOOL FBTypeText(NSString *text, NSUInteger typingSpeed, NSError **error)
91
91
  [FBLogger logFmt:@"Trying to tap the \"%@\" element to have it focused", snapshot.fb_description];
92
92
  [self tap];
93
93
  // It might take some time to update the UI
94
- [self fb_takeSnapshot:NO];
94
+ [self fb_standardSnapshot];
95
95
  #endif
96
96
  }
97
97
 
@@ -110,7 +110,7 @@ BOOL FBTypeText(NSString *text, NSUInteger typingSpeed, NSError **error)
110
110
  frequency:(NSUInteger)frequency
111
111
  error:(NSError **)error
112
112
  {
113
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:NO];
113
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
114
114
  FBXCElementSnapshotWrapper *wrapped = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
115
115
  [self fb_prepareForTextInputWithSnapshot:wrapped];
116
116
  if (shouldClear && ![self fb_clearTextWithSnapshot:wrapped shouldPrepareForInput:NO error:error]) {
@@ -121,7 +121,7 @@ BOOL FBTypeText(NSString *text, NSUInteger typingSpeed, NSError **error)
121
121
 
122
122
  - (BOOL)fb_clearTextWithError:(NSError **)error
123
123
  {
124
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:NO];
124
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
125
125
  return [self fb_clearTextWithSnapshot:[FBXCElementSnapshotWrapper ensureWrapped:snapshot]
126
126
  shouldPrepareForInput:YES
127
127
  error:error];
@@ -178,7 +178,7 @@ BOOL FBTypeText(NSString *text, NSUInteger typingSpeed, NSError **error)
178
178
  return NO;
179
179
  }
180
180
 
181
- currentValue = [self fb_takeSnapshot:NO].value;
181
+ currentValue = [self fb_standardSnapshot].value;
182
182
  if (nil != placeholderValue && [currentValue isEqualToString:placeholderValue]) {
183
183
  // Short circuit if only the placeholder value left
184
184
  return YES;
@@ -22,14 +22,14 @@
22
22
  {
23
23
  return [FBElementUtils idWithAccessibilityElement:([self isKindOfClass:XCUIApplication.class]
24
24
  ? [(XCUIApplication *)self accessibilityElement]
25
- : [self fb_takeSnapshot:NO].accessibilityElement)];
25
+ : [self fb_standardSnapshot].accessibilityElement)];
26
26
  }
27
27
 
28
28
  - (NSString *)fb_uid
29
29
  {
30
30
  return [self isKindOfClass:XCUIApplication.class]
31
31
  ? [FBElementUtils uidWithAccessibilityElement:[(XCUIApplication *)self accessibilityElement]]
32
- : [FBXCElementSnapshotWrapper ensureWrapped:[self fb_takeSnapshot:NO]].fb_uid;
32
+ : [FBXCElementSnapshotWrapper ensureWrapped:[self fb_standardSnapshot]].fb_uid;
33
33
  }
34
34
 
35
35
  @end
@@ -15,17 +15,39 @@ NS_ASSUME_NONNULL_BEGIN
15
15
 
16
16
  @interface XCUIElement (FBUtilities)
17
17
 
18
+ /**
19
+ Gets the most recent snapshot of the current element. The element will be
20
+ automatically resolved if the snapshot is not available yet.
21
+ Calls to this method mutate the `lastSnapshot` instance property.
22
+ The snapshot is taken by the native API provided by XCTest.
23
+ The maximum snapshot tree depth is set by `FBConfiguration.snapshotMaxDepth`
24
+
25
+ Snapshot specifics:
26
+ - Most performant
27
+ - Memory-friedly
28
+ - `children` property is set to `nil` if not taken from XCUIApplication
29
+ - `value` property is cut off to max 512 bytes
30
+
31
+ @return The recent snapshot of the element
32
+ @throws FBStaleElementException if the element is not present in DOM and thus no snapshot could be made
33
+ */
34
+ - (id<FBXCElementSnapshot>)fb_standardSnapshot;
35
+
18
36
  /**
19
37
  Gets the most recent snapshot of the current element. The element will be
20
38
  automatically resolved if the snapshot is not available yet.
21
39
  Calls to this method mutate the `lastSnapshot` instance property..
40
+ The maximum snapshot tree depth is set by `FBConfiguration.snapshotMaxDepth`
41
+
42
+ Snapshot specifics:
43
+ - Less performant in comparison to the standard one
44
+ - `children` property is always defined
45
+ - `value` property is not cut off
22
46
 
23
- @param inDepth Whether to resolve snapshot parents and children. Setting it to NO
24
- would improve the snapshotting performance
25
47
  @return The recent snapshot of the element
26
48
  @throws FBStaleElementException if the element is not present in DOM and thus no snapshot could be made
27
49
  */
28
- - (id<FBXCElementSnapshot>)fb_takeSnapshot:(BOOL)inDepth;
50
+ - (id<FBXCElementSnapshot>)fb_customSnapshot;
29
51
 
30
52
  /**
31
53
  Extracts the cached element snapshot from its query.
@@ -44,12 +44,12 @@
44
44
 
45
45
  @implementation XCUIElement (FBUtilities)
46
46
 
47
- - (id<FBXCElementSnapshot>)fb_takeSnapshot:(BOOL)inDepth
47
+ - (id<FBXCElementSnapshot>)fb_takeSnapshot:(BOOL)isCustom
48
48
  {
49
49
  __block id<FBXCElementSnapshot> snapshot = nil;
50
50
  @autoreleasepool {
51
51
  NSError *error = nil;
52
- snapshot = inDepth && ![self isKindOfClass:XCUIApplication.class]
52
+ snapshot = isCustom
53
53
  ? [self.fb_query fb_uniqueSnapshotWithError:&error]
54
54
  : (id<FBXCElementSnapshot>)[self snapshotWithError:&error];
55
55
  if (nil == snapshot) {
@@ -69,6 +69,16 @@
69
69
  return self.lastSnapshot;
70
70
  }
71
71
 
72
+ - (id<FBXCElementSnapshot>)fb_standardSnapshot
73
+ {
74
+ return [self fb_takeSnapshot:NO];
75
+ }
76
+
77
+ - (id<FBXCElementSnapshot>)fb_customSnapshot
78
+ {
79
+ return [self fb_takeSnapshot:YES];
80
+ }
81
+
72
82
  - (id<FBXCElementSnapshot>)fb_cachedSnapshot
73
83
  {
74
84
  return [self.query fb_cachedSnapshot];
@@ -18,7 +18,7 @@
18
18
 
19
19
  - (CGRect)fb_visibleFrame
20
20
  {
21
- id<FBXCElementSnapshot> snapshot = [self fb_takeSnapshot:NO];
21
+ id<FBXCElementSnapshot> snapshot = [self fb_standardSnapshot];
22
22
  return [FBXCElementSnapshotWrapper ensureWrapped:snapshot].fb_visibleFrame;
23
23
  }
24
24
 
@@ -28,10 +28,16 @@
28
28
 
29
29
  - (id<FBXCElementSnapshot>)fb_snapshotForAttributeName:(NSString *)name
30
30
  {
31
- BOOL inDepth = [name isEqualToString:FBStringify(XCUIElement, isWDAccessible)]
31
+ // https://github.com/appium/appium-xcuitest-driver/issues/2552
32
+ BOOL isValueRequest = [name isEqualToString:FBStringify(XCUIElement, wdValue)];
33
+ if ([self isKindOfClass:XCUIApplication.class] && !isValueRequest) {
34
+ return [self fb_standardSnapshot];
35
+ }
36
+ BOOL isCustomSnapshot = [name isEqualToString:FBStringify(XCUIElement, isWDAccessible)]
32
37
  || [name isEqualToString:FBStringify(XCUIElement, isWDAccessibilityContainer)]
33
- || [name isEqualToString:FBStringify(XCUIElement, wdIndex)];
34
- return [self fb_takeSnapshot:inDepth];
38
+ || [name isEqualToString:FBStringify(XCUIElement, wdIndex)]
39
+ || isValueRequest;
40
+ return isCustomSnapshot ? [self fb_customSnapshot] : [self fb_standardSnapshot];
35
41
  }
36
42
 
37
43
  - (id)fb_valueForWDAttributeName:(NSString *)name
@@ -64,6 +70,15 @@
64
70
  return [self valueForKey:[FBElementUtils wdAttributeNameForAttributeName:name]];
65
71
  }
66
72
 
73
+ - (BOOL)fb_supportsInnerText
74
+ {
75
+ XCUIElementType elementType = self.elementType;
76
+ return elementType == XCUIElementTypeTextView
77
+ || elementType == XCUIElementTypeTextField
78
+ || elementType == XCUIElementTypeSearchField
79
+ || elementType == XCUIElementTypeSecureTextField;
80
+ }
81
+
67
82
  - (NSString *)wdValue
68
83
  {
69
84
  id value = self.value;
@@ -76,10 +91,7 @@
76
91
  value = FBFirstNonEmptyValue(value, isSelected);
77
92
  } else if (elementType == XCUIElementTypeSwitch) {
78
93
  value = @([value boolValue]);
79
- } else if (elementType == XCUIElementTypeTextView ||
80
- elementType == XCUIElementTypeTextField ||
81
- elementType == XCUIElementTypeSearchField ||
82
- elementType == XCUIElementTypeSecureTextField) {
94
+ } else if (self.fb_supportsInnerText) {
83
95
  NSString *placeholderValue = self.placeholderValue;
84
96
  value = FBFirstNonEmptyValue(value, placeholderValue);
85
97
  }
@@ -107,21 +119,18 @@
107
119
 
108
120
  - (NSString *)wdLabel
109
121
  {
110
- NSString *label = self.label;
111
122
  XCUIElementType elementType = self.elementType;
112
- if (elementType == XCUIElementTypeTextField || elementType == XCUIElementTypeSecureTextField ) {
113
- return label;
114
- }
115
- return FBTransferEmptyStringToNil(label);
123
+ return (elementType == XCUIElementTypeTextField
124
+ || elementType == XCUIElementTypeSecureTextField)
125
+ ? self.label
126
+ : FBTransferEmptyStringToNil(self.label);
116
127
  }
117
128
 
118
129
  - (NSString *)wdPlaceholderValue
119
130
  {
120
- NSString *placehlderValue = self.placeholderValue;
121
- if (nil != placehlderValue) {
122
- return placehlderValue;
123
- }
124
- return FBTransferEmptyStringToNil(placehlderValue);
131
+ return self.fb_supportsInnerText
132
+ ? self.placeholderValue
133
+ : FBTransferEmptyStringToNil(self.placeholderValue);
125
134
  }
126
135
 
127
136
  - (NSString *)wdType
@@ -151,7 +151,9 @@
151
151
  {
152
152
  FBElementCache *elementCache = request.session.elementCache;
153
153
  XCUIElement *element = [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]];
154
- FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:[element fb_takeSnapshot:NO]];
154
+ // https://github.com/appium/appium-xcuitest-driver/issues/2552
155
+ id<FBXCElementSnapshot> snapshot = [element fb_customSnapshot];
156
+ FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
155
157
  id text = FBFirstNonEmptyValue(wrappedSnapshot.wdValue, wrappedSnapshot.wdLabel);
156
158
  return FBResponseWithObject(text ?: @"");
157
159
  }
@@ -81,7 +81,7 @@ static id<FBResponsePayload> FBNoSuchElementErrorResponseForRequest(FBRouteReque
81
81
  {
82
82
  FBElementCache *elementCache = request.session.elementCache;
83
83
  XCUIElement *element = [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]];
84
- id<FBXCElementSnapshot> snapshot = [element fb_takeSnapshot:YES];
84
+ id<FBXCElementSnapshot> snapshot = [element fb_customSnapshot];
85
85
  NSArray<id<FBXCElementSnapshot>> *visibleCellSnapshots = [snapshot descendantsByFilteringWithBlock:^BOOL(id<FBXCElementSnapshot> shot) {
86
86
  return shot.elementType == XCUIElementTypeCell
87
87
  && [FBXCElementSnapshotWrapper ensureWrapped:shot].wdVisible;
@@ -50,7 +50,7 @@
50
50
  if (nil == self.alertElement) {
51
51
  return NO;
52
52
  }
53
- [self.alertElement fb_takeSnapshot:YES];
53
+ [self.alertElement fb_customSnapshot];
54
54
  return YES;
55
55
  } @catch (NSException *) {
56
56
  return NO;
@@ -82,7 +82,7 @@
82
82
  }
83
83
 
84
84
  NSMutableArray<NSString *> *resultText = [NSMutableArray array];
85
- id<FBXCElementSnapshot> snapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_takeSnapshot:YES];
85
+ id<FBXCElementSnapshot> snapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_customSnapshot];
86
86
  BOOL isSafariAlert = [self.class isSafariWebAlertWithSnapshot:snapshot];
87
87
  [snapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
88
88
  XCUIElementType elementType = descendant.elementType;
@@ -145,7 +145,7 @@
145
145
  }
146
146
 
147
147
  NSMutableArray<NSString *> *labels = [NSMutableArray array];
148
- id<FBXCElementSnapshot> alertSnapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_takeSnapshot:YES];
148
+ id<FBXCElementSnapshot> alertSnapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_customSnapshot];
149
149
  [alertSnapshot enumerateDescendantsUsingBlock:^(id<FBXCElementSnapshot> descendant) {
150
150
  if (descendant.elementType != XCUIElementTypeButton) {
151
151
  return;
@@ -164,7 +164,7 @@
164
164
  return [self notPresentWithError:error];
165
165
  }
166
166
 
167
- id<FBXCElementSnapshot> alertSnapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_takeSnapshot:YES];
167
+ id<FBXCElementSnapshot> alertSnapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_customSnapshot];
168
168
  XCUIElement *acceptButton = nil;
169
169
  if (FBConfiguration.acceptAlertButtonSelector.length) {
170
170
  NSString *errorReason = nil;
@@ -205,7 +205,7 @@
205
205
  return [self notPresentWithError:error];
206
206
  }
207
207
 
208
- id<FBXCElementSnapshot> alertSnapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_takeSnapshot:YES];
208
+ id<FBXCElementSnapshot> alertSnapshot = self.alertElement.lastSnapshot ?: [self.alertElement fb_customSnapshot];
209
209
  XCUIElement *dismissButton = nil;
210
210
  if (FBConfiguration.dismissAlertButtonSelector.length) {
211
211
  NSString *errorReason = nil;
@@ -15,11 +15,11 @@
15
15
  <key>CFBundlePackageType</key>
16
16
  <string>FMWK</string>
17
17
  <key>CFBundleShortVersionString</key>
18
- <string>9.5.1</string>
18
+ <string>9.6.0</string>
19
19
  <key>CFBundleSignature</key>
20
20
  <string>????</string>
21
21
  <key>CFBundleVersion</key>
22
- <string>9.5.1</string>
22
+ <string>9.6.0</string>
23
23
  <key>NSPrincipalClass</key>
24
24
  <string/>
25
25
  </dict>
@@ -74,7 +74,7 @@ const int ELEMENT_CACHE_SIZE = 1024;
74
74
  }
75
75
  if (checkStaleness) {
76
76
  @try {
77
- [element fb_takeSnapshot:NO];
77
+ [element fb_standardSnapshot];
78
78
  } @catch (NSException *exception) {
79
79
  // if the snapshot method threw FBStaleElementException (implying the element is stale) we need to explicitly remove it from the cache, PR: https://github.com/appium/WebDriverAgent/pull/985
80
80
  if ([exception.name isEqualToString:FBStaleElementException]) {
@@ -44,7 +44,9 @@ XCUIElement *maybeStable(XCUIElement *element)
44
44
  }
45
45
 
46
46
  XCUIElement *result = element;
47
- id<FBXCElementSnapshot> snapshot = element.lastSnapshot ?: [element fb_cachedSnapshot] ?: [element fb_takeSnapshot:NO];
47
+ id<FBXCElementSnapshot> snapshot = element.lastSnapshot
48
+ ?: element.fb_cachedSnapshot
49
+ ?: [element fb_standardSnapshot];
48
50
  NSString *uid = [FBXCElementSnapshotWrapper wdUIDWithSnapshot:snapshot];
49
51
  if (nil != uid) {
50
52
  result = [element fb_stableInstanceWithUid:uid];
@@ -108,7 +110,9 @@ inline NSDictionary *FBDictionaryResponseWithElement(XCUIElement *element, BOOL
108
110
  {
109
111
  __block NSDictionary *elementResponse = nil;
110
112
  @autoreleasepool {
111
- id<FBXCElementSnapshot> snapshot = element.lastSnapshot ?: element.fb_cachedSnapshot ?: [element fb_takeSnapshot:YES];
113
+ id<FBXCElementSnapshot> snapshot = element.lastSnapshot
114
+ ?: element.fb_cachedSnapshot
115
+ ?: [element fb_customSnapshot];
112
116
  NSDictionary *compactResult = FBToElementDict((NSString *)[FBXCElementSnapshotWrapper wdUIDWithSnapshot:snapshot]);
113
117
  if (compact) {
114
118
  elementResponse = compactResult;
@@ -206,7 +206,7 @@ static NSString *const topNodeIndexPath = @"top";
206
206
  lookupScopeSnapshot = [self snapshotWithRoot:[(XCUIElement *)root application]];
207
207
  contextRootSnapshot = [root isKindOfClass:XCUIApplication.class]
208
208
  ? nil
209
- : [(XCUIElement *)root fb_takeSnapshot:YES];
209
+ : ([(XCUIElement *)root lastSnapshot] ?: [(XCUIElement *)root fb_customSnapshot]);
210
210
  } else {
211
211
  lookupScopeSnapshot = (id<FBXCElementSnapshot>)root;
212
212
  contextRootSnapshot = nil == lookupScopeSnapshot.parent ? nil : (id<FBXCElementSnapshot>)root;
@@ -491,9 +491,9 @@ static NSString *const topNodeIndexPath = @"top";
491
491
  // If the app is not idle state while we retrieve the visiblity state
492
492
  // then the snapshot retrieval operation might freeze and time out
493
493
  [[(XCUIElement *)root application] fb_waitUntilStableWithTimeout:FBConfiguration.animationCoolOffTimeout];
494
- @autoreleasepool {
495
- return [(XCUIElement *)root fb_takeSnapshot:YES];
496
- }
494
+ return [root isKindOfClass:XCUIApplication.class]
495
+ ? [(XCUIElement *)root fb_standardSnapshot]
496
+ : [(XCUIElement *)root fb_customSnapshot];
497
497
  }
498
498
 
499
499
  @end
@@ -1,9 +1,10 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="nJd-IZ-bfU">
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="nJd-IZ-bfU">
3
3
  <device id="retina6_5" orientation="portrait" appearance="light"/>
4
4
  <dependencies>
5
5
  <deployment identifier="iOS"/>
6
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
6
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
7
+ <capability name="System colors in document resources" minToolsVersion="11.0"/>
7
8
  <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
8
9
  </dependencies>
9
10
  <scenes>
@@ -19,7 +20,7 @@
19
20
  <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
20
21
  <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21
22
  <subviews>
22
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nbp-zX-Om1">
23
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nbp-zX-Om1">
23
24
  <rect key="frame" x="186.66666666666666" y="117" width="41" height="30"/>
24
25
  <constraints>
25
26
  <constraint firstAttribute="height" constant="30" id="GzF-4f-MaH"/>
@@ -29,7 +30,7 @@
29
30
  <segue destination="gK5-IX-eJx" kind="show" animates="NO" id="8RT-ON-yXm"/>
30
31
  </connections>
31
32
  </button>
32
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YgP-SF-TkS">
33
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YgP-SF-TkS">
33
34
  <rect key="frame" x="159.66666666666666" y="155" width="95" height="30"/>
34
35
  <constraints>
35
36
  <constraint firstAttribute="height" constant="30" id="wTu-YB-p22"/>
@@ -40,7 +41,7 @@
40
41
  <action selector="showAlert:" destination="BYZ-38-t0r" eventType="touchUpInside" id="FEN-VX-MMc"/>
41
42
  </connections>
42
43
  </button>
43
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M2N-Yn-ytb">
44
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M2N-Yn-ytb">
44
45
  <rect key="frame" x="173" y="193" width="68" height="30"/>
45
46
  <constraints>
46
47
  <constraint firstAttribute="height" constant="30" id="Sf6-pE-ROp"/>
@@ -50,7 +51,7 @@
50
51
  <segue destination="65L-2T-0zt" kind="show" animates="NO" id="7cJ-OE-YWn"/>
51
52
  </connections>
52
53
  </button>
53
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S56-6U-3gG">
54
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S56-6U-3gG">
54
55
  <rect key="frame" x="177" y="231" width="60" height="30"/>
55
56
  <constraints>
56
57
  <constraint firstAttribute="height" constant="30" id="7sH-TN-BNa"/>
@@ -66,7 +67,7 @@
66
67
  <nil key="textColor"/>
67
68
  <nil key="highlightedColor"/>
68
69
  </label>
69
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1Ht-AF-MGW">
70
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1Ht-AF-MGW">
70
71
  <rect key="frame" x="186" y="298" width="42" height="30"/>
71
72
  <state key="normal" title="Touch"/>
72
73
  <connections>
@@ -114,28 +115,28 @@
114
115
  <subviews>
115
116
  <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="C6B-Wo-jWm" customClass="TouchableView">
116
117
  <rect key="frame" x="16" y="96.000000000000028" width="382" height="356.66666666666674"/>
117
- <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
118
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
118
119
  <accessibility key="accessibilityConfiguration" identifier="touchableView"/>
119
120
  <constraints>
120
121
  <constraint firstAttribute="width" secondItem="C6B-Wo-jWm" secondAttribute="height" multiplier="288:269" id="LeW-u7-tWl"/>
121
122
  </constraints>
122
123
  </view>
123
124
  <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Taps" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IV8-Ak-Z8e">
124
- <rect key="frame" x="139" y="460.66666666666669" width="131" height="21"/>
125
+ <rect key="frame" x="139" y="458.66666666666669" width="131" height="21"/>
125
126
  <accessibility key="accessibilityConfiguration" identifier="numberOfTapsLabel"/>
126
127
  <fontDescription key="fontDescription" type="system" pointSize="17"/>
127
128
  <nil key="textColor"/>
128
129
  <nil key="highlightedColor"/>
129
130
  </label>
130
131
  <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Touches" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q4X-EY-aSL">
131
- <rect key="frame" x="125" y="489.33333333333331" width="159" height="21"/>
132
+ <rect key="frame" x="125" y="487.33333333333331" width="159" height="21"/>
132
133
  <accessibility key="accessibilityConfiguration" identifier="numberOfTouchesLabel"/>
133
134
  <fontDescription key="fontDescription" type="system" pointSize="17"/>
134
135
  <nil key="textColor"/>
135
136
  <nil key="highlightedColor"/>
136
137
  </label>
137
138
  </subviews>
138
- <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
139
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
139
140
  <constraints>
140
141
  <constraint firstItem="C6B-Wo-jWm" firstAttribute="top" secondItem="gEY-Ha-hqz" secondAttribute="bottom" constant="8" id="1PW-tn-oTF"/>
141
142
  <constraint firstAttribute="trailing" secondItem="IV8-Ak-Z8e" secondAttribute="trailing" constant="144" id="5Tn-XG-5OD"/>
@@ -197,18 +198,19 @@
197
198
  <rect key="frame" x="161" y="324" width="39" height="37"/>
198
199
  <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
199
200
  </pageControl>
200
- <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" text="Text Field long text" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="LZF-72-rfb">
201
- <rect key="frame" x="20" y="497" width="374" height="329"/>
201
+ <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="LZF-72-rfb">
202
+ <rect key="frame" x="20" y="499" width="374" height="327"/>
203
+ <mutableString key="text">1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901</mutableString>
202
204
  <fontDescription key="fontDescription" type="system" pointSize="14"/>
203
205
  <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
204
206
  </textView>
205
207
  <datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="dateAndTime" minuteInterval="1" style="wheels" translatesAutoresizingMaskIntoConstraints="NO" id="dxw-sJ-Dkr">
206
- <rect key="frame" x="20" y="363" width="374" height="126"/>
208
+ <rect key="frame" x="20" y="365" width="374" height="126"/>
207
209
  <constraints>
208
210
  <constraint firstAttribute="height" constant="126" id="QRU-5e-MQt"/>
209
211
  </constraints>
210
212
  </datePicker>
211
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Exq-MB-zeu">
213
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Exq-MB-zeu">
212
214
  <rect key="frame" x="103.66666666666667" y="201" width="46.000000000000014" height="30"/>
213
215
  <constraints>
214
216
  <constraint firstAttribute="height" constant="30" id="Otl-5O-2Nq"/>
@@ -250,7 +252,7 @@
250
252
  </constraints>
251
253
  </switch>
252
254
  <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="w6h-ic-qpa">
253
- <rect key="frame" x="134" y="353" width="150" height="2"/>
255
+ <rect key="frame" x="134" y="353" width="150" height="4"/>
254
256
  <constraints>
255
257
  <constraint firstAttribute="width" constant="150" id="7Tf-hh-LKX"/>
256
258
  </constraints>
@@ -263,7 +265,7 @@
263
265
  </constraints>
264
266
  </stepper>
265
267
  <label opaque="NO" userInteractionEnabled="NO" alpha="0.0" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="alpha_invisible" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ucg-0s-c50">
266
- <rect key="frame" x="225" y="197" width="110" height="21"/>
268
+ <rect key="frame" x="224.33333333333334" y="197" width="111.66666666666666" height="21"/>
267
269
  <color key="backgroundColor" red="1" green="0.0" blue="0.041046944598614132" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
268
270
  <constraints>
269
271
  <constraint firstAttribute="height" constant="21" id="664-Z3-V7W"/>
@@ -273,7 +275,7 @@
273
275
  <nil key="highlightedColor"/>
274
276
  </label>
275
277
  <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="hidden_invisible" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vt6-b1-U0h">
276
- <rect key="frame" x="222.66666666666663" y="226" width="121" height="21"/>
278
+ <rect key="frame" x="221.66666666666666" y="226" width="122.66666666666666" height="21"/>
277
279
  <constraints>
278
280
  <constraint firstAttribute="height" constant="21" id="51j-sl-XYd"/>
279
281
  </constraints>
@@ -281,8 +283,8 @@
281
283
  <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
282
284
  <nil key="highlightedColor"/>
283
285
  </label>
284
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GsS-jO-scK">
285
- <rect key="frame" x="174" y="248" width="101" height="30"/>
286
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GsS-jO-scK">
287
+ <rect key="frame" x="174" y="248" width="103" height="30"/>
286
288
  <accessibility key="accessibilityConfiguration">
287
289
  <bool key="isElement" value="NO"/>
288
290
  </accessibility>
@@ -374,8 +376,8 @@
374
376
  <fontDescription key="fontDescription" type="system" pointSize="14"/>
375
377
  <textInputTraits key="textInputTraits"/>
376
378
  </textField>
377
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4VK-4B-FEF">
378
- <rect key="frame" x="149" y="194" width="115" height="30"/>
379
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4VK-4B-FEF">
380
+ <rect key="frame" x="149.66666666666666" y="194" width="113.99999999999997" height="30"/>
379
381
  <constraints>
380
382
  <constraint firstAttribute="height" constant="30" id="xsL-Fq-mly"/>
381
383
  </constraints>
@@ -384,7 +386,7 @@
384
386
  <action selector="createAppAlert:" destination="gK5-IX-eJx" eventType="touchUpInside" id="t44-BA-HSi"/>
385
387
  </connections>
386
388
  </button>
387
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OQt-5y-Tft">
389
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OQt-5y-Tft">
388
390
  <rect key="frame" x="124" y="232" width="166" height="30"/>
389
391
  <constraints>
390
392
  <constraint firstAttribute="height" constant="30" id="Y5y-Th-63a"/>
@@ -394,7 +396,7 @@
394
396
  <action selector="createNotificationAlert:" destination="gK5-IX-eJx" eventType="touchUpInside" id="haL-pV-hTV"/>
395
397
  </connections>
396
398
  </button>
397
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rG5-3k-LFe">
399
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rG5-3k-LFe">
398
400
  <rect key="frame" x="122" y="270" width="169" height="30"/>
399
401
  <constraints>
400
402
  <constraint firstAttribute="height" constant="30" id="im5-w3-Pgi"/>
@@ -404,7 +406,7 @@
404
406
  <action selector="createCameraRollAccessAlert:" destination="gK5-IX-eJx" eventType="touchUpInside" id="T8R-HK-sEe"/>
405
407
  </connections>
406
408
  </button>
407
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ntr-45-Ycd">
409
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ntr-45-Ycd">
408
410
  <rect key="frame" x="123" y="308" width="168" height="30"/>
409
411
  <constraints>
410
412
  <constraint firstAttribute="height" constant="30" id="4B7-LM-UwV"/>
@@ -414,7 +416,7 @@
414
416
  <action selector="createGPSAccessAlert:" destination="gK5-IX-eJx" eventType="touchUpInside" id="gcM-Ip-10b"/>
415
417
  </connections>
416
418
  </button>
417
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CZ1-7J-OGl">
419
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CZ1-7J-OGl">
418
420
  <rect key="frame" x="66.666666666666671" y="176" width="46" height="30"/>
419
421
  <accessibility key="accessibilityConfiguration" identifier="button"/>
420
422
  <constraints>
@@ -432,8 +434,8 @@
432
434
  <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
433
435
  <nil key="highlightedColor"/>
434
436
  </label>
435
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Zk-wE-jwj">
436
- <rect key="frame" x="143.66666666666666" y="346" width="126.99999999999997" height="30"/>
437
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Zk-wE-jwj">
438
+ <rect key="frame" x="144" y="346" width="126" height="30"/>
437
439
  <constraints>
438
440
  <constraint firstAttribute="height" constant="30" id="Mk4-bk-Y0L"/>
439
441
  </constraints>
@@ -442,7 +444,7 @@
442
444
  <action selector="createAppSheet:" destination="gK5-IX-eJx" eventType="touchUpInside" id="U6X-fw-xU2"/>
443
445
  </connections>
444
446
  </button>
445
- <button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="D7g-22-s49">
447
+ <button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="D7g-22-s49">
446
448
  <rect key="frame" x="116" y="384" width="182" height="30"/>
447
449
  <constraints>
448
450
  <constraint firstAttribute="height" constant="30" id="TzV-CY-64y"/>
@@ -490,7 +492,7 @@
490
492
  <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
491
493
  <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
492
494
  <subviews>
493
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vYb-QB-vwU">
495
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vYb-QB-vwU">
494
496
  <rect key="frame" x="172.66666666666666" y="108" width="69" height="30"/>
495
497
  <constraints>
496
498
  <constraint firstAttribute="height" constant="30" id="ymh-D3-SCA"/>
@@ -500,7 +502,7 @@
500
502
  <segue destination="3ur-D9-8FT" kind="show" animates="NO" id="yJb-Fl-2fY"/>
501
503
  </connections>
502
504
  </button>
503
- <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FdB-fa-0bl">
505
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FdB-fa-0bl">
504
506
  <rect key="frame" x="171" y="146" width="72" height="30"/>
505
507
  <constraints>
506
508
  <constraint firstAttribute="height" constant="30" id="Xas-AZ-Nyw"/>
@@ -535,7 +537,7 @@
535
537
  <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
536
538
  <prototypes>
537
539
  <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" textLabel="2mC-E2-VxB" style="IBUITableViewCellStyleDefault" id="wCs-18-PFf">
538
- <rect key="frame" x="0.0" y="28" width="414" height="44"/>
540
+ <rect key="frame" x="0.0" y="50" width="414" height="44"/>
539
541
  <autoresizingMask key="autoresizingMask"/>
540
542
  <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="wCs-18-PFf" id="0KF-km-gbT">
541
543
  <rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
@@ -607,4 +609,9 @@
607
609
  <point key="canvasLocation" x="2302" y="746"/>
608
610
  </scene>
609
611
  </scenes>
612
+ <resources>
613
+ <systemColor name="systemBackgroundColor">
614
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
615
+ </systemColor>
616
+ </resources>
610
617
  </document>
@@ -190,7 +190,7 @@
190
190
  XCTAssertEqualObjects(element.wdType, @"XCUIElementTypeTextView");
191
191
  XCTAssertNil(element.wdName);
192
192
  XCTAssertNil(element.wdLabel);
193
- XCTAssertEqualObjects(element.wdValue, @"Text Field long text");
193
+ XCTAssertEqualObjects(element.wdValue, @"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901");
194
194
  }
195
195
 
196
196
  @end
@@ -424,7 +424,7 @@
424
424
  timeout:2.0]
425
425
  timeoutErrorMessage:@"Picker wheel value has not been changed after 2 seconds timeout"]
426
426
  spinUntilTrue:^BOOL{
427
- return ![[self.pickerWheel fb_takeSnapshot:NO].value isEqualToString:previousValue];
427
+ return ![[self.pickerWheel fb_standardSnapshot].value isEqualToString:previousValue];
428
428
  }
429
429
  error:&error]);
430
430
  XCTAssertNil(error);
@@ -43,7 +43,7 @@
43
43
  - (id<FBXCElementSnapshot>)destinationSnapshot
44
44
  {
45
45
  XCUIElement *matchingElement = self.testedView.buttons.allElementsBoundByIndex.firstObject;
46
- id<FBXCElementSnapshot> snapshot = [matchingElement fb_takeSnapshot:YES];
46
+ id<FBXCElementSnapshot> snapshot = [matchingElement fb_customSnapshot];
47
47
  // Over iOS13, snapshot returns a child.
48
48
  // The purpose of here is return a single element to replace children with an empty array for testing.
49
49
  snapshot.children = @[];
@@ -57,7 +57,7 @@
57
57
  NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
58
58
  options:nil];
59
59
  XCTAssertNotNil(xmlStr);
60
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" placeholderValue=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, wrappedSnapshot.wdPlaceholderValue];
60
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex];
61
61
  XCTAssertEqualObjects(xmlStr, expectedXml);
62
62
  }
63
63
 
@@ -70,7 +70,7 @@
70
70
  NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
71
71
  options:options];
72
72
  XCTAssertNotNil(xmlStr);
73
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@>\n <%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\" placeholderValue=\"%@\"/>\n</%@>\n", scope, wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, wrappedSnapshot.wdPlaceholderValue, scope];
73
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@>\n <%@ type=\"%@\" name=\"%@\" label=\"%@\" enabled=\"%@\" visible=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" index=\"%lu\"/>\n</%@>\n", scope, wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdEnabled), FBBoolToString(wrappedSnapshot.wdVisible), FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdIndex, scope];
74
74
  XCTAssertEqualObjects(xmlStr, expectedXml);
75
75
  }
76
76
 
@@ -83,7 +83,7 @@
83
83
  NSString *xmlStr = [FBXPath xmlStringWithRootElement:wrappedSnapshot
84
84
  options:options];
85
85
  XCTAssertNotNil(xmlStr);
86
- NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\" placeholderValue=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue], wrappedSnapshot.wdPlaceholderValue];
86
+ NSString *expectedXml = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<%@ type=\"%@\" name=\"%@\" label=\"%@\" accessible=\"%@\" x=\"%@\" y=\"%@\" width=\"%@\" height=\"%@\"/>\n", wrappedSnapshot.wdType, wrappedSnapshot.wdType, wrappedSnapshot.wdName, wrappedSnapshot.wdLabel, FBBoolToString(wrappedSnapshot.wdAccessible), [wrappedSnapshot.wdRect[@"x"] stringValue], [wrappedSnapshot.wdRect[@"y"] stringValue], [wrappedSnapshot.wdRect[@"width"] stringValue], [wrappedSnapshot.wdRect[@"height"] stringValue]];
87
87
  XCTAssertEqualObjects(xmlStr, expectedXml);
88
88
  }
89
89
 
@@ -45,7 +45,7 @@
45
45
  @"Touch",
46
46
  ]];
47
47
  NSArray<id<FBXCElementSnapshot>> *matchingSnapshots = [[FBXCElementSnapshotWrapper ensureWrapped:
48
- [self.testedView fb_takeSnapshot:YES]]
48
+ [self.testedView fb_customSnapshot]]
49
49
  fb_descendantsMatchingType:XCUIElementTypeButton];
50
50
  XCTAssertEqual(matchingSnapshots.count, expectedLabels.count);
51
51
  NSArray<NSString *> *labels = [matchingSnapshots valueForKeyPath:@"@distinctUnionOfObjects.label"];
@@ -61,7 +61,7 @@
61
61
  XCUIElement *button = self.testedApplication.buttons[@"Alerts"];
62
62
  FBAssertWaitTillBecomesTrue(button.exists);
63
63
  id<FBXCElementSnapshot> windowSnapshot = [[FBXCElementSnapshotWrapper ensureWrapped:
64
- [self.testedView fb_takeSnapshot:YES]]
64
+ [self.testedView fb_customSnapshot]]
65
65
  fb_parentMatchingType:XCUIElementTypeWindow];
66
66
  XCTAssertNotNil(windowSnapshot);
67
67
  XCTAssertEqual(windowSnapshot.elementType, XCUIElementTypeWindow);
@@ -89,7 +89,7 @@
89
89
  XCUIElement *todayPickerWheel = self.testedApplication.pickerWheels[@"Today"];
90
90
  FBAssertWaitTillBecomesTrue(todayPickerWheel.exists);
91
91
  id<FBXCElementSnapshot> datePicker = [[FBXCElementSnapshotWrapper ensureWrapped:
92
- [todayPickerWheel fb_takeSnapshot:YES]]
92
+ [todayPickerWheel fb_customSnapshot]]
93
93
  fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeDatePicker), @(XCUIElementTypeWindow)]];
94
94
  XCTAssertNotNil(datePicker);
95
95
  XCTAssertEqual(datePicker.elementType, XCUIElementTypeDatePicker);
@@ -100,7 +100,7 @@
100
100
  XCUIElement *todayPickerWheel = self.testedApplication.pickerWheels[@"Today"];
101
101
  FBAssertWaitTillBecomesTrue(todayPickerWheel.exists);
102
102
  id<FBXCElementSnapshot> otherSnapshot =[[FBXCElementSnapshotWrapper ensureWrapped:
103
- [todayPickerWheel fb_takeSnapshot:YES]]
103
+ [todayPickerWheel fb_customSnapshot]]
104
104
  fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeAny)]];
105
105
  XCTAssertNotNil(otherSnapshot);
106
106
  }
@@ -110,7 +110,7 @@
110
110
  XCUIElement *todayPickerWheel = self.testedApplication.pickerWheels[@"Today"];
111
111
  FBAssertWaitTillBecomesTrue(todayPickerWheel.exists);
112
112
  id<FBXCElementSnapshot> otherSnapshot = [[FBXCElementSnapshotWrapper ensureWrapped:
113
- [todayPickerWheel fb_takeSnapshot:YES]]
113
+ [todayPickerWheel fb_customSnapshot]]
114
114
  fb_parentMatchingOneOfTypes:@[@(XCUIElementTypeTab), @(XCUIElementTypeLink)]];
115
115
  XCTAssertNil(otherSnapshot);
116
116
  }
@@ -142,7 +142,7 @@
142
142
  @(XCUIElementTypeTable),
143
143
  ];
144
144
  id<FBXCElementSnapshot> scrollView = [[FBXCElementSnapshotWrapper ensureWrapped:
145
- [threeStaticText fb_takeSnapshot:YES]]
145
+ [threeStaticText fb_customSnapshot]]
146
146
  fb_parentMatchingOneOfTypes:acceptedParents
147
147
  filter:^BOOL(id<FBXCElementSnapshot> snapshot) {
148
148
  return [[FBXCElementSnapshotWrapper ensureWrapped:snapshot] isWDVisible];
@@ -160,7 +160,7 @@
160
160
  @(XCUIElementTypeTable),
161
161
  ];
162
162
  id<FBXCElementSnapshot> scrollView = [[FBXCElementSnapshotWrapper ensureWrapped:
163
- [threeStaticText fb_takeSnapshot:YES]]
163
+ [threeStaticText fb_customSnapshot]]
164
164
  fb_parentMatchingOneOfTypes:acceptedParents
165
165
  filter:^BOOL(id<FBXCElementSnapshot> snapshot) {
166
166
  return NO;
@@ -173,7 +173,7 @@
173
173
  XCUIElement *scrollView = self.testedApplication.scrollViews[@"scrollView"];
174
174
  FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible);
175
175
  NSArray *cells = [[FBXCElementSnapshotWrapper ensureWrapped:
176
- [scrollView fb_takeSnapshot:YES]]
176
+ [scrollView fb_customSnapshot]]
177
177
  fb_descendantsCellSnapshots];
178
178
  XCTAssertGreaterThanOrEqual(cells.count, 10);
179
179
  id<FBXCElementSnapshot> element = cells.firstObject;
@@ -202,7 +202,7 @@
202
202
  FBAssertWaitTillBecomesTrue(self.testedApplication.staticTexts[@"3"].fb_isVisible);
203
203
  XCUIElement *threeStaticText = self.testedApplication.staticTexts[@"3"];
204
204
  id<FBXCElementSnapshot> xcuiElementCell = [[FBXCElementSnapshotWrapper ensureWrapped:
205
- [threeStaticText fb_takeSnapshot:YES]]
205
+ [threeStaticText fb_customSnapshot]]
206
206
  fb_parentCellSnapshot];
207
207
  XCTAssertEqual(xcuiElementCell.elementType, 75);
208
208
  }
@@ -23,7 +23,8 @@
23
23
  [self launchApplication];
24
24
  [self goToAttributesPage];
25
25
  XCUIElement *dstBtn = self.testedApplication.buttons[@"not_accessible"];
26
- CGPoint hitPoint = [FBXCElementSnapshotWrapper ensureWrapped:[dstBtn fb_takeSnapshot:NO]].fb_hitPoint.CGPointValue;
26
+ CGPoint hitPoint = [FBXCElementSnapshotWrapper
27
+ ensureWrapped:[dstBtn fb_standardSnapshot]].fb_hitPoint.CGPointValue;
27
28
  XCTAssertTrue(hitPoint.x > 0 && hitPoint.y > 0);
28
29
  }
29
30
 
@@ -41,7 +41,7 @@
41
41
  [allElements addObjectsFromArray:windows];
42
42
 
43
43
  NSMutableArray<id<FBXCElementSnapshot>> *buttonSnapshots = [NSMutableArray array];
44
- [buttonSnapshots addObject:[buttons.firstObject fb_takeSnapshot:YES]];
44
+ [buttonSnapshots addObject:[buttons.firstObject fb_customSnapshot]];
45
45
 
46
46
  NSArray<XCUIElement *> *result = [self.testedApplication fb_filterDescendantsWithSnapshots:buttonSnapshots
47
47
  onlyChildren:NO];
@@ -39,7 +39,8 @@
39
39
  @property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
40
40
 
41
41
  - (void)resolve;
42
- - (id _Nonnull)fb_takeSnapshot:(BOOL)inDepth;
42
+ - (id _Nonnull)fb_standardSnapshot;
43
+ - (id _Nonnull)fb_customSnapshot;
43
44
  - (nullable id)query;
44
45
 
45
46
  // Checks
@@ -69,7 +69,12 @@
69
69
  self.didResolve = YES;
70
70
  }
71
71
 
72
- - (id _Nonnull)fb_takeSnapshot:(BOOL)inDepth;
72
+ - (id _Nonnull)fb_standardSnapshot;
73
+ {
74
+ return [self lastSnapshot];
75
+ }
76
+
77
+ - (id _Nonnull)fb_customSnapshot;
73
78
  {
74
79
  return [self lastSnapshot];
75
80
  }
@@ -37,7 +37,8 @@
37
37
  @property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
38
38
 
39
39
  - (void)resolve;
40
- - (id _Nonnull)fb_takeSnapshot;
40
+ - (id _Nonnull)fb_standardSnapshot;
41
+ - (id _Nonnull)fb_customSnapshot;
41
42
 
42
43
  // Checks
43
44
  @property (nonatomic, assign, readonly) BOOL didResolve;
@@ -52,7 +52,12 @@
52
52
  return @"test";
53
53
  }
54
54
 
55
- - (id)fb_takeSnapshot
55
+ - (id)fb_standardSnapshot
56
+ {
57
+ return [self lastSnapshot];
58
+ }
59
+
60
+ - (id)fb_customSnapshot
56
61
  {
57
62
  return [self lastSnapshot];
58
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-webdriveragent",
3
- "version": "9.5.1",
3
+ "version": "9.6.0",
4
4
  "description": "Package bundling WebDriverAgent",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",