Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
JavonDavis committed Feb 28, 2019
1 parent f4f7e22 commit 879c5e3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,23 @@ Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "R

This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/app/App.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).

## UI Tests

This repository uses appium to run UI tests. The tests live in `__device-tests__` and are written using Appium to run tests against simulators and real devices. To run these you'll need to check off a few things:

* For now you'll need run `yarn start`, and then either `yarn ios` or `yarn android` at least once before trying to run the tests on the respective platform
* [Appium cli](https://github.com/appium/appium) installed and available globally, I'd also recommend using [appium doctor](https://github.com/appium/appium-doctor) to ensure everything's good to go. You don't have to worry about starting the server yourself, the tests handle starting the server on port 4728, just be sure that the port is free or feel free to change the port number in the test file.
* For iOS a simulator should automatically launch but for Android you'll need to have an emulator fired up and running.

After those are checked off to run the UI tests on ios run

`TEST_RN_PLATFORM=ios yarn test:ui`

and for android run,

`TEST_RN_PLATFORM=android yarn test:ui`

Alternatively if you're experiencing problems that seem to be related to the tests starting the appium server, for example errors that say `Connection Refused`, `Connection Reset` or `The requested environment is not available`. Sorry about that this is still a WIP, you can manually start the appium server via [appium desktop](https://github.com/appium/appium-desktop) or the cli, then change the port number in the tests while commenting out the `beforeAll` and `afterAll` block.

## Static analysis and code style

Expand Down

0 comments on commit 879c5e3

Please sign in to comment.