FBApplication.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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/XCUIApplication.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface FBApplication : XCUIApplication
  12. /**
  13. Constructor used to get current active application
  14. */
  15. + (instancetype)fb_activeApplication;
  16. /**
  17. Constructor used to get current active application
  18. @param bundleId The bundle identifier of an app, which should be selected as active by default
  19. if it is present in the list of active applications
  20. */
  21. + (instancetype)fb_activeApplicationWithDefaultBundleId:(nullable NSString *)bundleId;
  22. /**
  23. Constructor used to get the system application (e.g. Springboard on iOS)
  24. */
  25. + (instancetype)fb_systemApplication;
  26. /**
  27. Retrieves the list of all currently active applications
  28. */
  29. + (NSArray<FBApplication *> *)fb_activeApplications;
  30. /**
  31. Switch to system app (called Springboard on iOS)
  32. @param error If there is an error, upon return contains an NSError object that describes the problem.
  33. @return YES if the operation succeeds, otherwise NO.
  34. */
  35. + (BOOL)fb_switchToSystemApplicationWithError:(NSError **)error;
  36. @end
  37. NS_ASSUME_NONNULL_END