lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
246 stars 17 forks source link

25562105: Repeating animations cause UI tests to hang, and ultimately fail #7927

Open openradar-mirror opened 8 years ago

openradar-mirror commented 8 years ago

Description

Summary: When there are active animations on any views within the main window hierarchy, the test framework determines that the application isn't idled. For repeating animations, this means that the test framework will hang until it hits a timeout and fail with "App failed to quiesce within 60s"

Steps to Reproduce:

  1. Start a new single-view iOS application project in Xcode with UI Testing enabled
  2. Add a button and an additional view to the View Controller nib in Main.storyboard and wire IBOutlets to ViewController.m (we'll call them "button" and "animatingView"
  3. In ViewController.m, modify viewDidLoad:

override func viewDidLoad() { super.viewDidLoad()

UIView.animateWithDuration(1,
                           delay: 0,
                           options: [.CurveEaseInOut, .Autoreverse, .Repeat],
                           animations: {
    self.animatingView.alpha = 0
    }, completion: nil)

}

  1. In the provided sample UI test file, add a dummy test:

func testThatFailsDueToRepeatingAnimation() { XCUIApplication().buttons.elementBoundByIndex(0).tap() }

  1. Run the test. Notice that the test fails with the following log:

UI Testing Failure - App failed to quiesce within 60s

  1. Remove the .Repeat option from the animation code in ViewController.m
  2. Re-run the test. Notice that it passes after the animation completes.

Expected Results: Repeating animations are ignored, or XCTest provides functionality to do so

Actual Results: Repeating animations cause tests to hang, and eventually fail

Version: 9.3 (13E234)

Configuration: iPhone 6S 64GB AT&T, using LTE

Product Version: 9.3 Created: 2016-04-05T21:46:45.138640 Originated: 2016-04-05T00:00:00 Open Radar Link: http://www.openradar.me/25562105

amjad-Alhusseini commented 8 years ago

Is it related to UIRefreshControl as well?

openradar-mirror commented 8 years ago

Modified: 2016-04-05T21:46:45.138810