FBW3CActionsHelpers.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <Foundation/Foundation.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. * Extracts value property for a key action
  13. *
  14. * @param actionItem Action item dictionary
  15. * @param error Contains the acttual error in case of failure
  16. * @returns Either the extracted value or nil in case of failure
  17. */
  18. NSString *_Nullable FBRequireValue(NSDictionary<NSString *, id> *actionItem, NSError **error);
  19. /**
  20. * Extracts duration property for an action
  21. *
  22. * @param actionItem Action item dictionary
  23. * @param defaultValue The default duration value if it is not present. If nil then the error will be set
  24. * @param error Contains the acttual error in case of failure
  25. * @returns Either the extracted value or nil in case of failure
  26. */
  27. NSNumber *_Nullable FBOptDuration(NSDictionary<NSString *, id> *actionItem, NSNumber *_Nullable defaultValue, NSError **error);
  28. /**
  29. * Maps W3C meta modifier to XCUITest compatible-one
  30. * See https://w3c.github.io/webdriver/#keyboard-actions
  31. *
  32. * @param value key action value
  33. * @returns the mapped modifier value or the same input character
  34. * if no mapped value could be found for it.
  35. */
  36. NSString * FBMapIfSpecialCharacter(NSString *value);
  37. NS_ASSUME_NONNULL_END