Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
TitouanVanBelle committed Jul 26, 2017
0 parents commit 84b56b6
Show file tree
Hide file tree
Showing 44 changed files with 3,731 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .gitignore
@@ -0,0 +1,31 @@
TestResults

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
builds/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
19 changes: 19 additions & 0 deletions LICENSE
@@ -0,0 +1,19 @@
Copyright (c) 2017 Titouan Van Belle (https://github.com/TitouanVanBelle)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
39 changes: 39 additions & 0 deletions README.md
@@ -0,0 +1,39 @@
# XCUITestHTMLReport

Xcode-like HTML report for UI Tests

## Installation

Simply go to your iOS project and download the latest version of XCUITestHTMLReport

``` bash
$ curl -o xchtmlreport https://raw.githubusercontent.com/TitouanVanBelle/XCUITestHTMLReport/master/xchtmlreport
```

or download a specific version

``` bash
$ curl -o xchtmlreport https://raw.githubusercontent.com/TitouanVanBelle/XCUITestHTMLReport/1.0.0/xchtmlreport
```

## Usage

Run your UI tests using `xcodebuild` without forgetting to specify the `resultBundlePath`

``` bash
$ xcodebuild test -workspace XCUITestHTMLReport.xcworkspace -scheme XCUITestHTMLReportSampleApp -destination 'platform=iOS Simulator,name=iPhone 7,OS=11.0' -resultBundlePath TestResults
```

Then use the previously downloaded xchtmlreport tool to create the HTML report

``` bash
$ ./xchtmlreport -r TestResults
```

## Contribution

Please create an issue whenever you find an issue or think a feature could be a good addition to XCUITestHTMLReport. Also feel free to take a shot at these issues.

## License

XCUITestHTMLReport is [available under the MIT license](https://github.com/TitouanVanBelle/XCUITestHTMLReport/blob/master/LICENSE).
1 change: 1 addition & 0 deletions Rakefile
@@ -0,0 +1 @@
import 'tasks/test.rake'
10 changes: 10 additions & 0 deletions XCUITestHTMLReport.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions XCUITestHTMLReport/HTMLTemplates.swift
@@ -0,0 +1,20 @@

struct HTMLTemplates
{
static let index = """
"""

static let testSummary = """
"""

static let test = """
"""

static let activity = """
"""
}

38 changes: 38 additions & 0 deletions XCUITestHTMLReport/Scripts/createTemplates.sh
@@ -0,0 +1,38 @@
#!/bin/bash
echo `pwd`
index=`cat XCUITestHTMLReport/HTML/index.html | sed 's,",\\\\",g'`
testSummary=`cat XCUITestHTMLReport/HTML/test_summary.html | sed 's,",\\\\",g'`
test=`cat XCUITestHTMLReport/HTML/test.html | sed 's,",\\\\",g'`
activity=`cat XCUITestHTMLReport/HTML/activity.html | sed 's,",\\\\",g'`
screenshot=`cat XCUITestHTMLReport/HTML/screenshot.html | sed 's,",\\\\",g'`
text=`cat XCUITestHTMLReport/HTML/text.html | sed 's,",\\\\",g'`

content="
struct HTMLTemplates
{
static let index = \"\"\"
$index
\"\"\"
static let testSummary = \"\"\"
$testSummary
\"\"\"
static let test = \"\"\"
$test
\"\"\"
static let activity = \"\"\"
$activity
\"\"\"
static let screenshot = \"\"\"
$screenshot
\"\"\"
static let text = \"\"\"
$text
\"\"\"
}
"
echo "$content" > 'XCUITestHTMLReport/HTMLTemplates.swift'

0 comments on commit 84b56b6

Please sign in to comment.