Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Added hypershard-ios setup tutorial #1788

Merged
merged 2 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions docs/hypershard_ios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Hypershard iOS

This is a step-by-step guide of using Hypershard for companies that are unable to use symbol table dumping on iOS.

### Installation

1. Clone Github repository using
1. https - `git clone https://github.com/dropbox/hypershard-ios.git`
2. SSH - `git clone [email protected]:dropbox/hypershard-ios.git`
3. Github CLI - `gh repo clone dropbox/hypershard-ios`
2. Install swift if you are not using macOS
1. https://swift.org/download/#releases
3. Open Terminal/cmd
4. Change working directory to the path where you clone `hypershard-ios`
5. Build hyper shard-ios with command `swift build -c release`
6. It will build the binary into the `.build` folder
7. The resulting binary will be placed in the `.build/release/hypershard`.


### Running

1. Open Terminal/cmd

2. change the working directory to `.build/release` or add it to `PATH`

3. To run hypershard make CLI invocation with the command:

```bash
hypershard TEST_TARGET_NAME ROOT_PATH
```

where

- `TEST_TARGET_NAME` - the name of the Xcode test target containing the UI tests
- `ROOT_PATH` - either a path where all the `XCUITest`s classes are stored, or the path of the Xcode project containing `TEST_TARGET_NAME`

for example based on Flank test project

```bash
./hypershard EarlGreyExample test_projects/ios/EarlGreyExample/EarlGreyExampleSwiftTests
```

4. The output will be printed to console

```json
{"path":"","phase":"XCUI test shard","env":{},"cmd":"","tests":["EarlGreyExample.EarlGreyExampleSwiftTests.testThatThrows","EarlGreyExample.EarlGreyExampleSwiftTests.testBasicSelection","EarlGreyExample.EarlGreyExampleSwiftTests.testBasicSelectionAndAction","EarlGreyExample.EarlGreyExampleSwiftTests.testBasicSelectionAndAssert","EarlGreyExample.EarlGreyExampleSwiftTests.testBasicSelectionActionAssert","EarlGreyExample.EarlGreyExampleSwiftTests.testSelectionOnMultipleElements","EarlGreyExample.EarlGreyExampleSwiftTests.testCollectionMatchers","EarlGreyExample.EarlGreyExampleSwiftTests.testWithInRoot","EarlGreyExample.EarlGreyExampleSwiftTests.testWithCustomMatcher","EarlGreyExample.EarlGreyExampleSwiftTests.testTableCellOutOfScreen","EarlGreyExample.EarlGreyExampleSwiftTests.testCatchErrorOnFailure","EarlGreyExample.EarlGreyExampleSwiftTests.testCustomAction","EarlGreyExample.EarlGreyExampleSwiftTests.testWithCustomAssertion","EarlGreyExample.EarlGreyExampleSwiftTests.testWithCustomFailureHandler","EarlGreyExample.EarlGreyExampleSwiftTests.testLayout","EarlGreyExample.EarlGreyExampleSwiftTests.testWithCondition","EarlGreyExample.EarlGreyExampleSwiftTests.testWithGreyAssertions"]}
```


5. If you would like to store the output to a file just add a path to the file with `--path` option

For example:

```bash
./hypershard EarlGreyExample test_projects/ios/EarlGreyExample/EarlGreyExampleSwiftTests --path results.json
```


### Resources

https://github.com/dropbox/hypershard-ios
5 changes: 3 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ nav:
- Data: "https://github.com/Flank/flank/tree/master/test_runner/src/main/kotlin/ftl/data#data"
- Adapter: "https://github.com/Flank/flank/tree/master/test_runner/src/main/kotlin/ftl/adapter#adapter"
- Hypershard:
- Android: "hypershard_android.md"

- iOS: hypershard_ios.md
- Android: hypershard_android.md

theme:
name: material

Expand Down