XCUIElement+FBPickerWheel.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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/XCUIElement.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface XCUIElement (FBPickerWheel)
  12. /**
  13. Selects the next available option in Picker Wheel
  14. @param offset the value in range [0.01, 0.5]. It defines how far from picker
  15. wheel's center the click should happen. The actual distance is culculated by
  16. multiplying this value to the actual picker wheel height. Too small offset value
  17. may not change the picker wheel value and too high value may cause the wheel to switch
  18. two or more values at once. Usually the optimal value is located in range [0.15, 0.3]
  19. @param error returns error object if there was an error while selecting the
  20. next picker value
  21. @return YES if the current option has been successfully switched. Otherwise NO
  22. */
  23. - (BOOL)fb_selectNextOptionWithOffset:(CGFloat)offset error:(NSError **)error;
  24. /**
  25. Selects the previous available option in Picker Wheel
  26. @param offset the value in range [0.01, 0.5]. It defines how far from picker
  27. wheel's center the click should happen. The actual distance is culculated by
  28. multiplying this value to the actual picker wheel height. Too small offset value
  29. may not change the picker wheel value and too high value may cause the wheel to switch
  30. two or more values at once. Usually the optimal value is located in range [0.15, 0.3]
  31. @param error returns error object if there was an error while selecting the
  32. previous picker value
  33. @return YES if the current option has been successfully switched. Otherwise NO
  34. */
  35. - (BOOL)fb_selectPreviousOptionWithOffset:(CGFloat)offset error:(NSError **)error;
  36. @end
  37. NS_ASSUME_NONNULL_END