Running tests article
This commit is contained in:
parent
0f87194755
commit
4a71e82aec
|
@ -4,7 +4,7 @@ This document is the entry point for developers of Status. This guide is for any
|
|||
|
||||
This guide is written with OS X in mind.
|
||||
|
||||
## Build and Test
|
||||
## Build and Run
|
||||
|
||||
### Requirements
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# Running tests
|
||||
|
||||
### Unit tests
|
||||
|
||||
We have two separate test bundles:
|
||||
|
||||
* Run `lein test-cljs` to execute unit tests for models and utility methods.
|
||||
* Run `lein test-protocol` to execute unit tests for protocol-related method (see `status-im.protocol` namespace).
|
||||
|
||||
Both commands execute tests only once. If you're developing tests and want to re-run them each time you change something in code (inside `src` and `test` folders), you can run the following commands:
|
||||
|
||||
* `lein with-profile test doo node test`
|
||||
* `lein with-profile protocol doo node
|
||||
|
||||
### UI tests
|
||||
|
||||
Prerequisites:
|
||||
|
||||
1. Install Appium by running `npm install -g appium`
|
||||
2. Build and start the application on emulator or real device ([more details here](https://wiki.status.im/contributing/development/building-status/#build-and-test)). **Important:** use the _android-test_ build (run `BUILD_IDS="android-test" lein repl`). Testing in iOS is not supported yet
|
||||
3. Start appium server in new tab: run `appium --session-override`
|
||||
4. Run `lein test`
|
||||
|
||||
Hints / Gotchas:
|
||||
|
||||
- Confirmed working using Appium version 1.6.1.
|
||||
- To find an element easily in the tests, use the `:accessibility-label` property in the respective Reagent component.
|
||||
- When querying an element by its inner text, be sure to use the whole text that the element is supposed to contain (it won't match just a part of the text).
|
|
@ -1,34 +1,5 @@
|
|||
# Testing
|
||||
|
||||
Shake your phone and submit bug report.
|
||||
Please try to be as descripive as possible.
|
||||
Shake your phone and submit bug report. Please try to be as descripive as possible.
|
||||
|
||||
|
||||
## For Developers
|
||||
|
||||
### UI (Appium) tests
|
||||
|
||||
To run the tests:
|
||||
|
||||
1. Install appium: run `npm install -g appium`
|
||||
2. Start application on emulator or real device ([more details here](https://wiki.status.im/contributing/development/building-status/#build-and-test)).
|
||||
|
||||
**Important:** use the _android-test_ build (run `BUILD_IDS="android-test" lein repl`). Testing in iOS is not supported yet.
|
||||
3. Start appium server in new tab: run `appium --session-override`
|
||||
4. Run `lein test`
|
||||
|
||||
Hints / Gotchas:
|
||||
|
||||
- Confirmed working using Appium version 1.6.1.
|
||||
- To find an element easily in the tests, use the `:accessibility-label` property in the respective Reagent component.
|
||||
- When querying an element by its inner text, be sure to use the whole text that the element is supposed to contain (it won't match just a part of the text).
|
||||
|
||||
### Unit tests
|
||||
|
||||
To run the unit tests execute:
|
||||
|
||||
`lein doo node test once`
|
||||
or
|
||||
`lein doo node test`
|
||||
|
||||
Second command will watch files inside `src` and `test` folders and rerun on changes.
|
||||
If you're a developer and want to work on test automation, you can also check [this article](https://wiki.status.im/contributing/development/running-tests).
|
||||
|
|
|
@ -19,6 +19,7 @@ pages:
|
|||
- Developers:
|
||||
- Introduction: 'contributing/development/introduction.md'
|
||||
- Building Status: 'contributing/development/building-status.md'
|
||||
- Running Tests: 'contributing/development/running-tests.md'
|
||||
- Adding DApps: 'contributing/development/adding-dapps.md'
|
||||
- Design Guidelines: 'contributing/design-guidelines.md'
|
||||
- Testing & Feedback: 'contributing/testing-and-feedback.md'
|
||||
|
|
Loading…
Reference in New Issue