Skip to content

BirmacherAkos/bitrise-step-xctest-html-report

Repository files navigation

Generate Xcode test HTML/JUnit report

Generate Xcode-like HTML report for Unit and UI Tests with XCTestHTMLReport

Current release

GitHub release GitHub Release Date

CI status

Bitrise

Public CI on Bitrise.io
https://app.bitrise.io/app/dbb0739f4a28d789#/builds

How to

Add this step after the Xcode Test for iOS step. This step will search for the .xcresult file in the $BITRISE_XCRESULT_PATH by default, because the Xcode Test for iOS step will generate it there.
You can change the search dir by modifying the test_result_path step input.

example_workflow

The step will generate the test report files under the $BITRISE_DEPLOY_DIR. If you want to make that file available on Bitrise.io add the Deploy to Bitrise.io - Apps, Logs, Artifacts step after this step.

example_report

Example workflow in bitrise.yml

test-simulator-html-report:
    steps:
    - activate-ssh-key:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone: {}
    - cache-pull: {}
    - xcode-test: {}
    - xctest-html-report: {}
    - deploy-to-bitrise-io: {}
    - cache-push: {}

How to use a Bitrise Step

Can be run directly with the bitrise CLI, just git clone this repository, cd into it's folder in your Terminal/Command Line and call bitrise run test.

Check the bitrise.yml file for required inputs which have to be added to your .bitrise.secrets.yml file!

Step by step:

  1. Open up your Terminal / Command Line
  2. git clone the repository
  3. cd into the directory of the step (the one you just git cloned)
  4. Create a .bitrise.secrets.yml file in the same directory of bitrise.yml (the .bitrise.secrets.yml is a git ignored file, you can store your secrets in it)
  5. Check the bitrise.yml file for any secret you should set in .bitrise.secrets.yml
  • Best practice is to mark these options with something like # define these in your .bitrise.secrets.yml, in the app:envs section.
  1. Once you have all the required secret parameters in your .bitrise.secrets.yml you can just run this step with the bitrise CLI: bitrise run test

An example .bitrise.secrets.yml file:

envs:
- A_SECRET_PARAM_ONE: the value for secret one
- A_SECRET_PARAM_TWO: the value for secret two

About

Bitrise CLI step for generating Xcode-like HTML report for Unit and UI Tests with XCTestHTMLReport

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages