FBElementTypeTransformer.h 1.3 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 <Foundation/Foundation.h>
  10. #import <XCTest/XCUIElementTypes.h>
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. Class used to translate between XCUIElementType and string name
  14. */
  15. @interface FBElementTypeTransformer : NSObject
  16. /**
  17. Converts string to XCUIElementType
  18. @param typeName converted string to XCUIElementType
  19. @return Proper XCUIElementType or XCUIElementTypeAny if typeName is nil or unrecognised
  20. */
  21. + (XCUIElementType)elementTypeWithTypeName:(NSString *__nullable)typeName;
  22. /**
  23. Converts XCUIElementType to string
  24. @param type converted XCUIElementType to string
  25. @return XCUIElementType as NSString
  26. */
  27. + (NSString *)stringWithElementType:(XCUIElementType)type;
  28. /**
  29. Converts XCUIElementType to short string by striping `XCUIElementType` from it
  30. @param type converted XCUIElementType to string
  31. @return XCUIElementType as NSString with stripped `XCUIElementType`
  32. */
  33. + (NSString *)shortStringWithElementType:(XCUIElementType)type;
  34. @end
  35. NS_ASSUME_NONNULL_END