appium-webdriveragent 9.5.2 → 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.
- package/CHANGELOG.md +6 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.m +2 -2
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +3 -3
- package/WebDriverAgentLib/Categories/XCUIElement+FBAccessibility.m +1 -1
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +1 -1
- package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +1 -1
- package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +8 -8
- package/WebDriverAgentLib/Categories/XCUIElement+FBTyping.m +4 -4
- package/WebDriverAgentLib/Categories/XCUIElement+FBUID.m +2 -2
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +25 -3
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +12 -2
- package/WebDriverAgentLib/Categories/XCUIElement+FBVisibleFrame.m +1 -1
- package/WebDriverAgentLib/Categories/XCUIElement+FBWebDriverAttributes.m +26 -19
- package/WebDriverAgentLib/Commands/FBElementCommands.m +3 -2
- package/WebDriverAgentLib/Commands/FBFindElementCommands.m +1 -1
- package/WebDriverAgentLib/FBAlert.m +5 -5
- package/WebDriverAgentLib/Info.plist +2 -2
- package/WebDriverAgentLib/Routing/FBElementCache.m +1 -1
- package/WebDriverAgentLib/Routing/FBResponsePayload.m +6 -2
- package/WebDriverAgentLib/Utilities/FBXPath.m +4 -4
- package/WebDriverAgentTests/IntegrationTests/FBW3CTouchActionsIntegrationTests.m +1 -1
- package/WebDriverAgentTests/IntegrationTests/FBXPathIntegrationTests.m +4 -4
- package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHelperTests.m +9 -9
- package/WebDriverAgentTests/IntegrationTests/XCElementSnapshotHitPointTests.m +2 -1
- package/WebDriverAgentTests/IntegrationTests/XCUIElementHelperIntegrationTests.m +1 -1
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.h +2 -1
- package/WebDriverAgentTests/UnitTests/Doubles/XCUIElementDouble.m +6 -1
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.h +2 -1
- package/WebDriverAgentTests/UnitTests_tvOS/Doubles/XCUIElementDouble.m +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
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
|
+
|
|
1
7
|
## [9.5.2](https://github.com/appium/WebDriverAgent/compare/v9.5.1...v9.5.2) (2025-04-19)
|
|
2
8
|
|
|
3
9
|
### 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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>)
|
|
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)
|
|
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 =
|
|
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];
|
|
@@ -28,12 +28,16 @@
|
|
|
28
28
|
|
|
29
29
|
- (id<FBXCElementSnapshot>)fb_snapshotForAttributeName:(NSString *)name
|
|
30
30
|
{
|
|
31
|
-
|
|
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
|
-
|
|
34
|
-
||
|
|
35
|
-
|
|
36
|
-
return [self fb_takeSnapshot:inDepth];
|
|
38
|
+
|| [name isEqualToString:FBStringify(XCUIElement, wdIndex)]
|
|
39
|
+
|| isValueRequest;
|
|
40
|
+
return isCustomSnapshot ? [self fb_customSnapshot] : [self fb_standardSnapshot];
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
- (id)fb_valueForWDAttributeName:(NSString *)name
|
|
@@ -66,6 +70,15 @@
|
|
|
66
70
|
return [self valueForKey:[FBElementUtils wdAttributeNameForAttributeName:name]];
|
|
67
71
|
}
|
|
68
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
|
+
|
|
69
82
|
- (NSString *)wdValue
|
|
70
83
|
{
|
|
71
84
|
id value = self.value;
|
|
@@ -78,10 +91,7 @@
|
|
|
78
91
|
value = FBFirstNonEmptyValue(value, isSelected);
|
|
79
92
|
} else if (elementType == XCUIElementTypeSwitch) {
|
|
80
93
|
value = @([value boolValue]);
|
|
81
|
-
} else if (
|
|
82
|
-
elementType == XCUIElementTypeTextField ||
|
|
83
|
-
elementType == XCUIElementTypeSearchField ||
|
|
84
|
-
elementType == XCUIElementTypeSecureTextField) {
|
|
94
|
+
} else if (self.fb_supportsInnerText) {
|
|
85
95
|
NSString *placeholderValue = self.placeholderValue;
|
|
86
96
|
value = FBFirstNonEmptyValue(value, placeholderValue);
|
|
87
97
|
}
|
|
@@ -109,21 +119,18 @@
|
|
|
109
119
|
|
|
110
120
|
- (NSString *)wdLabel
|
|
111
121
|
{
|
|
112
|
-
NSString *label = self.label;
|
|
113
122
|
XCUIElementType elementType = self.elementType;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
return (elementType == XCUIElementTypeTextField
|
|
124
|
+
|| elementType == XCUIElementTypeSecureTextField)
|
|
125
|
+
? self.label
|
|
126
|
+
: FBTransferEmptyStringToNil(self.label);
|
|
118
127
|
}
|
|
119
128
|
|
|
120
129
|
- (NSString *)wdPlaceholderValue
|
|
121
130
|
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
return FBTransferEmptyStringToNil(placehlderValue);
|
|
131
|
+
return self.fb_supportsInnerText
|
|
132
|
+
? self.placeholderValue
|
|
133
|
+
: FBTransferEmptyStringToNil(self.placeholderValue);
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
- (NSString *)wdType
|
|
@@ -151,8 +151,9 @@
|
|
|
151
151
|
{
|
|
152
152
|
FBElementCache *elementCache = request.session.elementCache;
|
|
153
153
|
XCUIElement *element = [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]];
|
|
154
|
-
//
|
|
155
|
-
|
|
154
|
+
// https://github.com/appium/appium-xcuitest-driver/issues/2552
|
|
155
|
+
id<FBXCElementSnapshot> snapshot = [element fb_customSnapshot];
|
|
156
|
+
FBXCElementSnapshotWrapper *wrappedSnapshot = [FBXCElementSnapshotWrapper ensureWrapped:snapshot];
|
|
156
157
|
id text = FBFirstNonEmptyValue(wrappedSnapshot.wdValue, wrappedSnapshot.wdLabel);
|
|
157
158
|
return FBResponseWithObject(text ?: @"");
|
|
158
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
18
|
+
<string>9.6.0</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>9.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
495
|
-
|
|
496
|
-
|
|
494
|
+
return [root isKindOfClass:XCUIApplication.class]
|
|
495
|
+
? [(XCUIElement *)root fb_standardSnapshot]
|
|
496
|
+
: [(XCUIElement *)root fb_customSnapshot];
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
@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
|
|
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
|
|
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\"
|
|
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\"
|
|
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=\"%@\"
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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)
|
|
42
|
+
- (id _Nonnull)fb_standardSnapshot;
|
|
43
|
+
- (id _Nonnull)fb_customSnapshot;
|
|
43
44
|
- (nullable id)query;
|
|
44
45
|
|
|
45
46
|
// Checks
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
@property (nonatomic, readwrite, getter=isWDAccessibilityContainer) BOOL wdAccessibilityContainer;
|
|
38
38
|
|
|
39
39
|
- (void)resolve;
|
|
40
|
-
- (id _Nonnull)
|
|
40
|
+
- (id _Nonnull)fb_standardSnapshot;
|
|
41
|
+
- (id _Nonnull)fb_customSnapshot;
|
|
41
42
|
|
|
42
43
|
// Checks
|
|
43
44
|
@property (nonatomic, assign, readonly) BOOL didResolve;
|