Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make isFocused attribute available for iOS elements #692

Merged
merged 2 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ + (NSDictionary *)dictionaryForElement:(id<FBXCElementSnapshot>)snapshot recursi
info[@"isEnabled"] = [@([wrappedSnapshot isWDEnabled]) stringValue];
info[@"isVisible"] = [@([wrappedSnapshot isWDVisible]) stringValue];
info[@"isAccessible"] = [@([wrappedSnapshot isWDAccessible]) stringValue];
#if TARGET_OS_TV
info[@"isFocused"] = [@([wrappedSnapshot isWDFocused]) stringValue];
#endif

if (!recursive) {
return info.copy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,10 @@ - (BOOL)isWDVisible
return self.fb_isVisible;
}

#if TARGET_OS_TV
- (BOOL)isWDFocused
{
return self.hasFocus;
}
#endif

- (BOOL)isWDAccessible
{
Expand Down
2 changes: 0 additions & 2 deletions WebDriverAgentLib/Routing/FBElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ NS_ASSUME_NONNULL_BEGIN
/*! Whether element is an accessibility container (contains children of any depth that are accessible) */
@property (nonatomic, readonly, getter = isWDAccessibilityContainer) BOOL wdAccessibilityContainer;

#if TARGET_OS_TV
/*! Whether element is focused */
@property (nonatomic, readonly, getter = isWDFocused) BOOL wdFocused;
#endif

/*! Element's index relatively to its parent. Starts from zero */
@property (nonatomic, readonly) NSUInteger wdIndex;
Expand Down