Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZlotin committed Sep 26, 2017
1 parent 1825e55 commit 862564f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 46 deletions.
2 changes: 1 addition & 1 deletion docs/APIRef.Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
|---|---|
|`binaryPath`|relative path to the ipa/app due to be tested (make sure you build the app in a project relative path)|
|`type`|device type, currently only `ios.simulator` is supported|
|`name`|device name, aligns to the device list avaliable through `fbsimctl list` for example, this is one line of the output of `fbsimctl list`: `A3C93900-6D17-4830-8FBE-E102E4BBCBB9 iPhone 7 Shutdown iPhone 7 iOS 10.2`, ir order to choose the first `iPhone 7` regardless of OS version, use `iPhone 7`. <br>To be OS specific use `iPhone 7, iOS 10.2`|
|`name`|device name, aligns to the device list avaliable through `xcrun simctl list` for example, this is one line of the output of `xcrun simctl list`: `A3C93900-6D17-4830-8FBE-E102E4BBCBB9 iPhone 7 Shutdown iPhone 7 iOS 10.2`, ir order to choose the first `iPhone 7` regardless of OS version, use `iPhone 7`. <br>To be OS specific use `iPhone 7, iOS 10.2`|
|`build`| **[optional]** build command (either `xcodebuild`, `react-native run-ios`, etc...), will be later available through detox CLI tool.|

**Example:**
Expand Down
7 changes: 0 additions & 7 deletions docs/Guide.Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ npm install -g react-native-cli

For all the internal projects (detox, detox-server, detox-cli, demos, test) `lerna` will create symbolic links in `node_modules` instead of `npm` copying the content of the projects. This way, any change you do on any code is there immediately. There is no need to update node modules or copy files between projects.

### Install `fbsimctl`

```sh
brew tap facebook/fb
export CODE_SIGNING_REQUIRED=NO && brew install fbsimctl --HEAD
```

### Install `xcpretty`

```sh
Expand Down
8 changes: 0 additions & 8 deletions docs/Guide.RunningOnCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ env:
- NODE_VERSION=stable

install:
- brew tap facebook/fb
- export CODE_SIGNING_REQUIRED=NO
- brew install fbsimctl --HEAD

- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
- export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
- nvm install $NODE_VERSION
Expand Down Expand Up @@ -134,10 +130,6 @@ workflows:
- content: |-
#!/bin/bash
brew tap facebook/fb
export CODE_SIGNING_REQUIRED=NO
brew install fbsimctl
brew tap wix/brew
brew install applesimutils --HEAD
title: Install Detox Utils
Expand Down
17 changes: 3 additions & 14 deletions docs/Introduction.GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,8 @@ Node is the JavaScript runtime Detox will run on. **Install Node 7.6.0 or above
```

> TIP: Verify it works by typing in terminal `node -v` to output current node version, should be higher than 7.6.0
#### 3. Install [fbsimctl](https://github.com/facebook/FBSimulatorControl/tree/master/fbsimctl)

This tool by Facebook helps Detox manage and automate iOS Simulators.

```sh
brew tap facebook/fb
export CODE_SIGNING_REQUIRED=NO && brew install fbsimctl
```
Make sure you install a stable version, **do not** use `brew install fbsimctl --HEAD` as instructed in the original repo.
> TIP: Verify it works by typing in terminal `fbsimctl list` to output the list of available simulators
#### 4. Install [appleSimUtils](https://github.com/wix/AppleSimulatorUtils)
#### 3. Install [appleSimUtils](https://github.com/wix/AppleSimulatorUtils)
A collection of utils for Apple simulators, Detox uses it to set (grant or deny) runtime permissions per application.

Expand All @@ -59,7 +48,7 @@ brew install --HEAD applesimutils

> TIP: Verify it works by typing in terminal `applesimutils` to output the tool help screen
#### 5. Install Detox command line tools (detox-cli)
#### 4. Install Detox command line tools (detox-cli)

This package makes it easier to operate Detox from the command line. `detox-cli` should be installed globally, enabling usage of the command line tools outside of your npm scripts.

Expand Down Expand Up @@ -107,7 +96,7 @@ The basic configuration for Detox should be in your `package.json` file under th

In the above configuration example, change `example` to your actual project name. Under the key `"binaryPath"`, `example.app` should be `<your_project_name>.app`. Under the key `"build"`, `example.xcodeproj` should be `<your_project_name>.xcodeproj` and `-scheme example` should be `-scheme <your_project_name>`.

Also make sure the simulator model specified under the key `"name"` (`iPhone 7` above) is actually available on your machine (it was installed by Xcode). Check this by typing `fbsimctl list` in terminal to display all available simulators.
Also make sure the simulator model specified under the key `"name"` (`iPhone 7` above) is actually available on your machine (it was installed by Xcode). Check this by typing `xcrun simctl list` in terminal to display all available simulators.

> TIP: To test a release version, replace 'Debug' with 'Release' in the binaryPath and build properties. For full configuration options see Configuration under the API Reference.
Expand Down
2 changes: 1 addition & 1 deletion docs/More.DesignPrinciples.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Traditionally, end-to-end tests on mobile are riddled with inherent issues, maki

* **Friendly Protractor-like API for tests**<br><br>Tests in Detox are implemented in human-readable JavaScript and can even be shared between platforms. This easy to use API completely abstracts the complex native driver invocations taking place under the hood.

* **Detox controls devices through low-level APIs**<br><br>Let's take iOS simulators for example, which are difficult to control efficiently since multiple concurrent instances aren't supported. Detox uses fbsimctl by Facebook to work around these issues and support test sharding.
* **Detox controls devices through low-level APIs**<br><br>Let's take iOS simulators for example, which are difficult to control efficiently since multiple concurrent instances aren't supported. Detox uses [AppleSimulatorUtils](https://github.com/wix/AppleSimulatorUtils) (another opensource library by Wix) to work around these issues and support test sharding.

* **Built from the ground up for mobile and React Native**<br><br>Detox is inspired by web testing methodologies but is not a direct translation of a solution designed for a different platform. Detox is built from the ground up for native mobile and has deep first-class support for React Native apps.

Expand Down
4 changes: 2 additions & 2 deletions docs/Troubleshooting.Flakiness.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Assume you have a suite of 100 tests and each test is flaky in 0.5% of execution

It's important to identify the various sources of flakiness in Detox tests.

* Control of the device / simulator - in order to run your tests, Detox must communicate with a simulator and instruct it to install the app, restart it, etc. Simulators don't always behave and controlling them might occasionally fail.<br> Detox's underlying simulator control is [`fbsimctl`](https://github.com/facebook/FBSimulatorControl/tree/master/fbsimctl), it is a tool that supports both basic and advanced simulator and device interaction options, it uses some core simulator features which are not always stable and may need time to "warm up" (booting, shutting down, etc.). Detox is set to have a few retries on any of these actions before failing. It will also print all the `fbsimctl` commands when using verbose log level.
* Control of the device / simulator - in order to run your tests, Detox must communicate with a simulator and instruct it to install the app, restart it, etc. Simulators don't always behave and controlling them might occasionally fail.<br> Detox's underlying simulator control is [`AppleSimulatorUtils`](https://github.com/wix/AppleSimulatorUtils), it is a tool that supports both basic and advanced simulator and device interaction options, it uses some core simulator features which are not always stable and may need time to "warm up" (booting, shutting down, etc.). Detox is set to have a few retries on any of these actions before failing. It will also print all the `exec` commands when using verbose log level.

* Asynchronous operations inside your app - every time an E2E test runs, operations might take place in a different order inside your app. This makes E2E tests nondeterministic. Consider an HTTP request made to a server, this request may take a variable time to complete due to external concerns like network congestion and server load.<br>Detox takes this into account by monitoring all asynchronous operations that take place in your app from the inside. Detox knows which network requests are currently in-flight. Detox knows how busy the React Native bridge is. Tests are automatically synchronized to the app and only move forward when the app is idle.

Expand All @@ -23,7 +23,7 @@ It's important to identify the various sources of flakiness in Detox tests.
In order to identify the source of flakiness you're suffering from you need more data. If you catch a failing test that should be passing, you need to record as much information as possible in order to investigate.

* Enable verbose mode in Detox. This will output a lot of information about what happening during the test.<br>
1. `fbsimctl` commands
1. `exec` commands
2. All communication going over the websocket, both from tester and testee

To enable verbose mode run your tests in verbose log mode:
Expand Down
15 changes: 2 additions & 13 deletions docs/Troubleshooting.Installation.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
# Troubleshooting Detox Installation

* [Can't install fbsimctl](#cant-install-fbsimctl)
* [No simulators found](#no-simulators-found)

<br>

### Can't install fbsimctl

[fbsimctl](https://github.com/facebook/FBSimulatorControl) is an open source tool by Facebook for controlling iOS simulators from the command line with greater flexibility than Apple's own command line solution. This is a 3rd party tool that is normally installed with `brew`. Installation with `brew` actually takes the current master from GitHub and builds it on your machine using Xcode command line tools. This process is somewhat fragile and might fail.

The best way to troubleshoot fbsimctl installation is to search for similar issues. This tool has been available for quite some time and has a loyal following. Start by searching the [GitHub issues](https://github.com/facebook/FBSimulatorControl/issues?utf8=%E2%9C%93&q=is%3Aissue) of the project. If you're certain the problem is with fbsimctl itself, please open a new issue in its [GitHub page](https://github.com/facebook/FBSimulatorControl).

Sometimes the problem is with `brew` itself. There are a number of common troubleshooting steps to fix common `brew` issues, you can find them [here](https://github.com/Homebrew/brew/blob/master/docs/Troubleshooting.md). Another official list of common issues is available [here](http://docs.brew.sh/Common-Issues.html). Once your `brew` is back in order, remove fbsimctl with `brew remove fbsimctl` and try installing it again.

<br>

### No simulators found

In order to run tests on a simulator, you need to have simulator images installed on your machine. This process is performed by Xcode itself. You can list all available simulators using fbsimctl by typing `fbsimctl list` in terminal.
In order to run tests on a simulator, you need to have simulator images installed on your machine. This process is performed by Xcode itself. You can list all available simulators using simctl by typing `xcrun simctl list` in terminal.

If you're missing a simulator, make sure Xcode is installed and use it to download the simulator. Take a look at the Preferences screen, some screenshots can be seen [here](http://stackoverflow.com/questions/33738113/how-to-install-ios-9-1-simulator-in-xcode-version-7-1-1-7b1005).

Once the desired simulator is installed and returned by `fbsimctl list`, double check its name in the list and make sure this name is found in the `detox` configuraton entry in `package.json`. The reference for the configuration options is available [here](APIRef.Configuration.md).
Once the desired simulator is installed and returned by `xcrun simctl list`, double check its name in the list and make sure this name is found in the `detox` configuraton entry in `package.json`. The reference for the configuration options is available [here](APIRef.Configuration.md).

0 comments on commit 862564f

Please sign in to comment.