FBXCodeCompatibility.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 <WebDriverAgentLib/WebDriverAgentLib.h>
  10. #import "XCPointerEvent.h"
  11. @class FBXCElementSnapshot;
  12. /**
  13. The version of testmanagerd process which is running on the device.
  14. Potentially, we can handle processes based on this version instead of iOS versions,
  15. iOS 10.1 -> 6
  16. iOS 11.0.1 -> 18
  17. iOS 11.4 -> 22
  18. iOS 12.1, 12.4 -> 26
  19. iOS 13.0, 13.4.1 -> 28
  20. tvOS 13.3 -> 28
  21. @return The version of testmanagerd
  22. */
  23. NSInteger FBTestmanagerdVersion(void);
  24. NS_ASSUME_NONNULL_BEGIN
  25. @interface XCUIElementQuery (FBCompatibility)
  26. /* Performs short-circuit UI tree traversion in iOS 11+ to get the first element matched by the query. Equals to nil if no matching elements are found */
  27. @property(nullable, readonly) XCUIElement *fb_firstMatch;
  28. /*
  29. This is the local wrapper for bounded elements extraction.
  30. It uses either indexed or bounded binding based on the `boundElementsByIndex` configuration
  31. flag value.
  32. */
  33. @property(readonly) NSArray<XCUIElement *> *fb_allMatches;
  34. /**
  35. Returns single unique matching snapshot for the given query
  36. @param error The error instance if there was a failure while retrieveing the snapshot
  37. @returns The cached unqiue snapshot or nil if the element is stale
  38. */
  39. - (nullable id<FBXCElementSnapshot>)fb_uniqueSnapshotWithError:(NSError **)error;
  40. @end
  41. @interface XCPointerEvent (FBCompatibility)
  42. - (BOOL)fb_areKeyEventsSupported;
  43. @end
  44. @interface XCUIElement (FBCompatibility)
  45. /**
  46. Determines whether current iOS SDK supports non modal elements inlusion into snapshots
  47. @return Either YES or NO
  48. */
  49. + (BOOL)fb_supportsNonModalElementsInclusion;
  50. /**
  51. Retrieves element query
  52. @return Element query property extended with non modal elements depending on the actual configuration
  53. */
  54. - (XCUIElementQuery *)fb_query;
  55. @end
  56. NS_ASSUME_NONNULL_END