Fix failures faster with Xcode test reports

A tour of test reports in Xcode

Structuring tests

  • Test methods are individual tests
  • Test classes – are groups of test methods
  • Test Bundles – one or more test class
  • Unit vs. UI tests
    • Unit Test – Source doe
    • UI – User actions
  • Test Plan – runs over the app and has both unit and UI
  • Configurations – say how to setup the environment for your test
    • Language and location
    • Code coverage
    • Test repetitions
  • Run Destinations
    • Devices to run on 
    • In the IDE you can run against 1 destination
    • In Xcode cloud you can choose many
  • Sample test plan
  • One line is a single test run

Explore the test report

  • The report provides a high-level summary of your test run, highlighting important patterns
  • One stop shop
  • Richer failure information for UI testing
  • You can run within CI and get a report
  • Here’s a sample run report, can see insights to see the notable issues across all configurations and runs. Further down you can get the actual test errors.
  • In the run view you can actually find the failure message and the call stack so you can go directly to your source code.
  • For UI tests you can actually get a video of the test at the point where it failed so you can see the failure in context.  Of course you also have the video of the entire test so you can see the full behavior. 
  • Clicking on an event takes you to that point in the test run and shows the video scrubber