Fix typos and improve formatting in docs

This commit is contained in:
Raphael Pierzina 2018-10-23 16:13:40 +02:00
Родитель 57ce32b16d
Коммит c2f7ebaa0a
1 изменённых файлов: 47 добавлений и 20 удалений

Просмотреть файл

@ -42,55 +42,82 @@ with the tests.
#### Redash Setup
The redash instance must be setup before running the tests. Start the images ```docker-compose up -d``` in the root of the directory in which the project was downloaded to. This will download the images if you don't have them. It will also start the container in the background. You can view the status of the containers via ```docker-compose ps```. You can also stop the docker container by running ```docker-compose stop```.
The redash instance must be setup before running the tests. Start the images
``docker-compose up -d`` in the root of the directory in which the project
was downloaded to. This will download the images if you don't have them. It
will also start the container in the background. You can view the status of
the containers via ``docker-compose ps``. You can also stop the docker
container by running ``docker-compose stop``.
All the following commands should also be run within the same directory that you downloaded the project too.
All the following commands should also be run within the same directory that
you downloaded the project to.
Run these following commands to setup Redash:
1. Create Database:
```
1. Create database:
```text
docker-compose run --rm server create_db
```
2. Create test Database
```
2. Create test database:
```text
docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests"
```
3. Create a default user named ```rootuser``` with a password ```IAMROOT``` and an organization ```default```.
```
3. Create a default user named ``rootuser`` with a password ``IAMROOT`` and
an organization ``default``:
```text
docker-compose run --rm server /app/manage.py users create_root root@example.com "rootuser" --password "IAMROOT" --org default
```
4. Create a new data source named ```ui-tests```.
```
4. Create a new data source named ``ui-tests``.
```text
docker-compose run --rm server /app/manage.py ds new "ui-tests" --type "url" --options '{"title": "uitests"}'
```
You can visit ```127.0.0.1:5000```, or ```localhost:5000``` in a web browser to see the redash login page.
You can visit ``127.0.0.1:5000``, or ``localhost:5000`` in a web browser to
see the redash login page.
___
#### Docker Test
#### Docker test
Build the redash-ui-tests with this command:
```
```text
docker build -t "redash-ui-tests:latest"
```
Then run the tests:
```
```text
docker run --net="host" --env REDASH_SERVER_URL=http://127.0.0.1:5000 redash-ui-tests:latest
```
If there are failures you can view the html report by first running this command
```
If there are failures you can view the html report by first running this
command
```text
docker cp ui-tests:/home/user/src/report.html ./report.html
```
and open the ```report.html```, which should be located within the projects root directory, in your web browser.
#### Using Make
and open the ```report.html```, which should be located within the projects
root directory, in your web browser.
#### Using make
Redash-ui-tests include a Makefile to run setup and tests.
##### Make Commands
##### Make commands
To setup the redash instance us:e ```make setup-redash```.
To run the docker tests use: ```make docker-ui-tests```.
To run the tests using a local firefox browser use: ```make ui-tests```.
## Break a test
🚧 **TODO**