# Viewing Xcode test results in rich HTML format

To use it, your build needs to do two things:

- Run your Xcode tests and place the `.xcresult` file in the correct location. The **Xcode Test for iOS** and the **Xcode Test for Building** Steps do this by default and require no further configuration. You can also use other Steps, for example, **fastlane**, but you need to specify where Xcode should place the `.xcresult` file.
- Run the **Generate Xcode HTML report** Step: it takes the `.xcresult` file and generates the report. If you use the **Xcode Test for iOS** Step to run your tests, this Step requires no configuration. When using other Steps, you have to manually set the location of your `.xcresult` file.

We strongly recommend using the official **Xcode Test for iOS** Step to run your tests: this Step generates an `.xcresult` file and the **Generate Xcode HTML report** Step finds it without any additional configuration.

To view the rich test results:

**Workflow Editor**

1. Add a Step that runs your Xcode tests to your Workflow.

   :::note[We recommend using the Xcode Test for iOS Step]

   Using our **Xcode Test for iOS** Step (as well as the **Xcode Test without building** Step) means you don't need any additional configuration to export your results.

   You can use other Steps to run your tests and then view the rich results afterwards. In that case, you have to make sure that the Step generates an `.xcresult` file and point the **Generate Xcode HTML report** Step to its location. For example, you can use the **fastlane** Step or your own **Script** Step.

   :::

   For more information on configuring the Step to run your Xcode tests, see [Running unit and UI tests for iOS apps](/bitrise-ci/testing/testing-ios-apps/running-unit-and-ui-tests-for-ios-apps).
1. Add the **Generate Xcode HTML report** Step to your Workflow.

   It should, of course, come after the Step that runs your tests.
1. Make sure the **Xcresult file paths** input points to the location of your `.xcresult` files.

   You can add multiple `.xcresult` files to this input, either by specifying one or more directories or by specifying filepaths, separated by a newline (/n). Each file will have its own report.

   :::important[No configuration required]

   If you use the **Xcode Test for iOS** Step, you don't have to modify this input!

   :::

   ![generate-xcode-reports_input.png](/img/_paligo/uuid-a928eed7-d498-758b-6a6c-5a8ef7b202d1.png)
1. Make sure the Workflow includes the **Deploy to Bitrise.io** Step at the end.

   Without this Step, the results won't be exported.

   :::important[Version requirement]

   The Step must be version 2.7.2 or newer.

   :::
1. After the build is finished, go to the build summary page.

   :::note[Failed builds]

   The test results will be available even if the build fails.

   :::
1. Select the **Tests** tab to view the results.

   :::important[Expiry date]

   The HTML test reports are available for seven days after they are generated. After seven days, you can no longer access them.

   :::

   ![html-test-result.png](/img/_paligo/uuid-bf85c17c-277e-088a-13b0-3fe96e79cc7d.png)

**Configuration YAML**

1. Add a Step that runs your Xcode tests to your Workflow.

   We strongly recommend using the `xcode-test` Step for this.

   ```yaml
   my-workflow:
     steps:
     - xcode-test: {}
   ```

   :::note[We recommend using the xcode-test Step]

   Using our `xcode-test` Step (as well as the `xcode-test-without-building` Step) means you don't need any additional configuration to export your results.

   You can use other Steps to run your tests and then view the rich results afterwards. In that case, you have to make sure that the Step generates an `.xcresult` file and point the `generate-xcode-html-report` Step to its location. For example, you can use the `fastlane` Step or your own `script` Step.

   :::

   For more information on configuring the Step to run your Xcode tests, see [Running unit and UI tests for iOS apps](/bitrise-ci/testing/testing-ios-apps/running-unit-and-ui-tests-for-ios-apps).
1. Add the `generate-xcode-html-report` Step to your Workflow.

   It should, of course, come after the Step that runs your tests.

   ```yaml
   my-workflow:
     steps:
     - xcode-test: {}
     - generate-xcode-html-report: {}
   ```
1. Make sure the `xcresult_patterns` input points to the location of your `.xcresult` files.

   You can add multiple `.xcresult` files to this input, either by specifying one or more directories or by specifying filepaths, separated by a newline (/n). Each file will have its own report.

   ```yaml
   my-workflow:
     steps:
     - xcode-test: {}
     - generate-xcode-html-report:
         is_always_run: true
         inputs: 
         - xcresult_patterns: /path/to/MyApp.xcresult
   ```

   :::important[No configuration required]

   If you use the **Xcode Test for iOS** Step, you don't have to modify this input!

   :::
1. Make sure the Workflow includes the `deploy-to-bitrise-io` Step at the end.

   Without this Step, the results won't be exported.

   :::important[Version requirement]

   The Step must be version 2.7.2 or newer.

   :::

   ```yaml
   my-workflow:
     steps:
     - xcode-test: {}
     - generate-xcode-html-report:
         is_always_run: true
         inputs: 
         - xcresult_patterns: /path/to/MyApp.xcresult
     - deploy-to-bitrise-io: {}
   ```
1. After the build is finished, go to the build summary page.

   :::note[Failed builds]

   The test results will be available even if the build fails.

   :::
1. Select the **Tests** tab to view the results.

   :::important[Expiry date]

   The HTML test reports are available for seven days after they are generated. After seven days, you can no longer access them.

   :::

   ![html-test-result.png](/img/_paligo/uuid-bf85c17c-277e-088a-13b0-3fe96e79cc7d.png)

:::caution

Please note that the generated HTML report is not official Bitrise content! It is generated entirely according to your Workflow configuration. Bitrise has no direct control over what appears in the report.

:::
