Skip to content

Commit 3281454

Browse files
Merge branch 'feat/add_placeholderValue_to_page_source' of https://github.com/ikharebashviliGD/WebDriverAgent into feat/add_placeholderValue_to_page_source
# Conflicts: # WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m
2 parents 7e9dbb4 + 407a856 commit 3281454

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

WebDriverAgentLib/Categories/FBXCElementSnapshotWrapper+Helpers.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ NS_ASSUME_NONNULL_BEGIN
9696
*/
9797
- (nullable NSValue *)fb_hitPoint;
9898

99+
/**
100+
@return YES, if the element type is one that supports placeholder text
101+
*/
102+
- (BOOL)fb_supportsPlaceholder;
103+
99104
@end
100105

101106
NS_ASSUME_NONNULL_END

WebDriverAgentLib/Categories/FBXCElementSnapshotWrapper+Helpers.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ - (NSValue *)fb_hitPoint
162162
return [NSValue valueWithCGPoint:result.hitPoint];
163163
}
164164

165+
- (BOOL)fb_supportsPlaceholder {
166+
XCUIElementType elementType = self.elementType;
167+
return elementType == XCUIElementTypeTextField
168+
|| elementType == XCUIElementTypeSearchField
169+
|| elementType == XCUIElementTypeSecureTextField;
170+
}
171+
165172
@end
166173

167174
inline static BOOL isSnapshotTypeAmongstGivenTypes(id<FBXCElementSnapshot> snapshot, NSArray<NSNumber *> *types)

0 commit comments

Comments
 (0)