XCUIApplicationProcessDelay.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 <Foundation/Foundation.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. In certain cases WebDriverAgent fails to create a session because -[XCUIApplication launch] doesn't return
  13. since it waits for the target app to be quiescenced.
  14. The reason for this seems to be that 'testmanagerd' doesn't send the events WebDriverAgent is waiting for.
  15. The expected events would trigger calls to '-[XCUIApplicationProcess setEventLoopHasIdled:]' and
  16. '-[XCUIApplicationProcess setAnimationsHaveFinished:]', which are the properties that are checked to
  17. determine whether an app has quiescenced or not.
  18. Delaying the call to on of the setters can fix this issue.
  19. */
  20. @interface XCUIApplicationProcessDelay : NSObject
  21. /**
  22. Delays the invocation of '-[XCUIApplicationProcess setEventLoopHasIdled:]' by the timer interval passed
  23. @param delay The duration of the sleep before the original method is called
  24. */
  25. + (void)setEventLoopHasIdledDelay:(NSTimeInterval)delay;
  26. /**
  27. Disables the delayed invocation of '-[XCUIApplicationProcess setEventLoopHasIdled:]'.
  28. */
  29. + (void)disableEventLoopDelay;
  30. @end
  31. NS_ASSUME_NONNULL_END