FBXCodeCompatibility.h 2.0 KB

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