A scheme can run the same UI tests with different languages and launch settings. An Xcode test plan saves those choices and the XCUITest targets in a reusable .xctestplan file.

The scheme still controls the build and run destination. The plan controls which tests run, and its configurations can override Shared Settings without changing the app's usual language or region.

An existing UI test target is required, such as MyAppUITests in an open MyApp iOS project. The app scheme and an installed iPhone Simulator should already be selected; one configuration named CI is enough for an initial plan.

Steps to create an XCUITest test plan in Xcode:

  1. Choose Product → Test Plan → New Test Plan.
  2. Enter MyAppUITests in the Save As field.
  3. Click Create to save the plan in the project directory.

    The new plan opens in the editor and becomes the scheme's active test plan.

  4. Click Choose Targets on the Tests tab.
  5. Select the MyAppUITests checkbox.
  6. Click Choose to include the selected UI test target.
  7. Open the Configurations tab.
  8. Rename Configuration 1 to CI.

    A double-click on the configuration name enables editing, and Return commits the name. Shared Settings supplies defaults to every configuration.

  9. Select CI in the configuration list.
  10. Set Application Language to English in the CI configuration.
  11. Set Application Region to Americas → United States.
  12. Save the plan with Command-S.
  13. Run the plan with Product → Test or Command-U.

    MyAppUITests is the active plan in the Test navigator. Xcode builds the app and test runner, launches the selected Simulator, and runs the included tests. Related: How to run XCUITest tests locally
    Related: How to run XCUITest with xcodebuild in CI

  14. Open the Report navigator with Command-9.
  15. Select Tests under the latest run in the Report navigator.
  16. Confirm that the MyAppUITests plan completed with the CI configuration and passing tests.
Share this guide