FBXCAXClientProxy.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import <XCTest/XCTest.h>
  10. #import "FBXCElementSnapshot.h"
  11. @protocol FBXCAccessibilityElement;
  12. NS_ASSUME_NONNULL_BEGIN
  13. /**
  14. This class acts as a proxy between WDA and XCAXClient_iOS.
  15. Other classes are obliged to use its methods instead of directly accessing XCAXClient_iOS,
  16. since Apple resticted the interface of XCAXClient_iOS class since Xcode10.2
  17. */
  18. @interface FBXCAXClientProxy : NSObject
  19. + (instancetype)sharedClient;
  20. - (BOOL)setAXTimeout:(NSTimeInterval)timeout error:(NSError **)error;
  21. - (nullable id<FBXCElementSnapshot>)snapshotForElement:(id<FBXCAccessibilityElement>)element
  22. attributes:(nullable NSArray<NSString *> *)attributes
  23. inDepth:(BOOL)inDepth
  24. error:(NSError **)error;
  25. - (NSArray<id<FBXCAccessibilityElement>> *)activeApplications;
  26. - (id<FBXCAccessibilityElement>)systemApplication;
  27. - (NSDictionary *)defaultParameters;
  28. - (void)notifyWhenNoAnimationsAreActiveForApplication:(XCUIApplication *)application
  29. reply:(void (^)(void))reply;
  30. - (nullable NSDictionary *)attributesForElement:(id<FBXCAccessibilityElement>)element
  31. attributes:(NSArray *)attributes
  32. error:(NSError**)error;
  33. - (nullable XCUIApplication *)monitoredApplicationWithProcessIdentifier:(int)pid;
  34. @end
  35. NS_ASSUME_NONNULL_END