https://github.com/XCTestHTMLReport/XCTestHTMLReport
Xcode-like HTML report for Unit and UI Tests
https://github.com/XCTestHTMLReport/XCTestHTMLReport
html-report swift ui-testing unit-testing xcode xcode-ui-testing xctest
Last synced: 5 months ago
JSON representation
Xcode-like HTML report for Unit and UI Tests
- Host: GitHub
- URL: https://github.com/XCTestHTMLReport/XCTestHTMLReport
- Owner: XCTestHTMLReport
- License: mit
- Created: 2017-07-23T03:08:22.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T03:23:04.000Z (8 months ago)
- Last Synced: 2024-11-07T10:16:35.288Z (6 months ago)
- Topics: html-report, swift, ui-testing, unit-testing, xcode, xcode-ui-testing, xctest
- Language: Swift
- Homepage:
- Size: 71.9 MB
- Stars: 738
- Watchers: 19
- Forks: 125
- Open Issues: 68
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://github.com/XCTestHTMLReport/XCTestHTMLReport/actions/workflows/ci.yml)
[](https://codecov.io/github/XCTestHTMLReport/XCTestHTMLReport)
[](https://sonarcloud.io/summary/new_code?id=XCTestHTMLReport_XCTestHTMLReport)[](https://swiftpackageindex.com/XCTestHTMLReport/XCTestHTMLReport)
[](https://swiftpackageindex.com/XCTestHTMLReport/XCTestHTMLReport)
## What is it?
Xcode-like HTML report for Unit and UI Tests

## Features
- Supports parallel testing
- Supports attachments:
- .png
- .jpeg
- .heic
- .txt
- .log
- .mp4
- .gif
- Navigate through the report with the keyboard's arrow keys
- Filter out successful, failed, skipped, or mixed-result tests
- Displays information about the target device
- Displays activity logs
- Junit report(`-j` flag)
- Json report(`--json` flag)
- Shrink bundle size by removing unattached files
- Automatically convert heic images to browser-friendly format
- Render as a single html file with inline attachments or as a bundle
- Downsize image attachments## Installation
### Homebrew (recommended)
Install via [Homebrew](https://brew.sh/)
Install latest stable version
```bash
brew install xctesthtmlreport
```Install latest from `main` branch
```
brew install xctesthtmlreport --HEAD
```### Mint
Install via [Mint](https://github.com/yonaskolb/Mint)
Install latest stable version
```bash
mint install XCTestHTMLReport/XCTestHTMLReport
```Install latest from `main` branch
```
mint install XCTestHTMLReport/XCTestHTMLReport@main
```## Usage
Run your UI tests using `xcodebuild` without forgetting to specify the `resultBundlePath`
``` bash
$ xcodebuild test -workspace XCTestHTMLReport.xcworkspace -scheme SampleApp -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.0' -resultBundlePath TestResults
```Then use the previously downloaded xchtmlreport tool to create the HTML report. Additionally, `-i` flag is also available to inline all resources, this is convenient for exporting the html file standalone. HTML file will be much heavier but much more portable.
``` bash
$ xchtmlreport TestResults.xcresultReport successfully created at ./index.html
```### Multiple Result Bundle Path
``` bash
$ xchtmlreport TestResults1 TestResults2Report successfully created at ./index.html
```This will create only one HTML Report in the path you passed with the -r option
### Generate Junit Reports
You can generate junit reports with the `-j` flag
``` bash
$ xchtmlreport -j TestResults1Report successfully created at ./index.html
JUnit report successfully created at report.junit
```### Generate JSON Reports
You can generate json reports with the `--json` flag
``` bash
$ xchtmlreport -json TestResults1Report successfully created at ./index.html
JSON report successfully created at ./report.json
```## Fastlane Support
https://github.com/TitouanVanBelle/fastlane-plugin-xchtmlreport
## Contribution
Please create an issue whenever you find an issue or think a feature could be a good addition to XCTestHTMLReport. Always make sure to follow the [Contributing Guidelines](CONTRIBUTING.md). Feel free to take a shot at these issues.
## Special Thanks
Thank you to the original author of this tool, [TitouanVanBelle](https://github.com/TitouanVanBelle)! 🥳🎉
## License
XCTestHTMLReport is [available under the MIT license](https://github.com/XCTestHTMLReport/XCTestHTMLReport/blob/main/LICENSE).