FBKeyboard.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. NS_ASSUME_NONNULL_BEGIN
  11. @interface FBKeyboard : NSObject
  12. #if (!TARGET_OS_TV && __clang_major__ >= 15)
  13. /**
  14. Transforms key name to its string representation, which could be used with XCTest
  15. @param name one of available keyboard key names defined in https://developer.apple.com/documentation/xctest/xcuikeyboardkey?language=objc
  16. @return Either the key value or nil if no matches have been found
  17. */
  18. + (nullable NSString *)keyValueForName:(NSString *)name;
  19. #endif
  20. /**
  21. Waits until the keyboard is visible on the screen or a timeout happens
  22. @param app that should be typed
  23. @param timeout the maximum duration in seconds to wait until the keyboard is visible. If the timeout value is equal or less than zero then immediate visibility verification is going to be performed.
  24. @param error If there is an error, upon return contains an NSError object that describes the problem.
  25. @return YES if the keyboard is visible after the timeout, otherwise NO.
  26. */
  27. + (BOOL)waitUntilVisibleForApplication:(XCUIApplication *)app timeout:(NSTimeInterval)timeout error:(NSError **)error;
  28. @end
  29. NS_ASSUME_NONNULL_END