Skip to content

Commit

Permalink
feat: Make isFocused attribute available for iOS elements (#692)
Browse files Browse the repository at this point in the history
* feat: Make isFocused attribute available for iOS elements

* Extra line break
  • Loading branch information
mykola-mokhnach authored May 4, 2023
1 parent d280750 commit 0ec74ce
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
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

0 comments on commit 0ec74ce

Please sign in to comment.