Skip to content

Commit

Permalink
Update docs with selenium changes and
Browse files Browse the repository at this point in the history
installation command changes

Closes anitab-org/vms#676
  • Loading branch information
Monal5031 committed May 18, 2018
1 parent bc64c0c commit eeec398
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ script:
- cd vms
- python manage.py syncdb --noinput
- python manage.py migrate --noinput --traceback --settings=vms.settings
- coverage run --source='.' manage.py test ../Tests/
- coverage run --source='.' manage.py test ../tests/

after_success:
coveralls --rcfile=.coveragerc
5 changes: 3 additions & 2 deletions aut_docs/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
- `cd vms`
- To run, `python manage.py runserver`. Browse
`http://127.0.0.1:8000`
- To execute tests `python manage.py test`. This will run all unit-tests and
- Before running tests, make sure to download the latest geckodriver. Unpack and move the binary to `/usr/local/bin`
- To execute tests `python manage.py test ../tests/`. This will run all unit-tests and
all functional-tests across all apps. To execute tests of only a particular
app, run `python manage.py test <app_name>`
app, run `python manage.py test ../tests/<app_name>/`
- If all tests pass, `OK` will be received at the end.
- For functional tests, a firefox window for each test will open up
automatically and close after simulation of tests.
Expand Down
68 changes: 49 additions & 19 deletions docs/Installation_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,17 @@ There needs to be at least one organization in the `organization_organization` t

Make sure to exit the postgres client before proceeding to the next steps:

```
\q
```

## Change Directory Permissions

You will have to change the permissions on the **/srv** directory to read, write and execute (**/srv** is the directory where Volunteer resumes are uploaded and stored). To do this, run the following command:

```
sudo chmod 777 /srv
```

NOTE: In case you can the error "/srv: No such file or directory" while running the above comment do the following
sudo mkdir /srv
Expand All @@ -278,56 +282,82 @@ Change directory to where you can find the **manage.py** file (this is located i

Start the development server by running the command (this runs the development server on the VM):

```
python manage.py runserver [::]:8000
```

You can now try out the project by going to [http://localhost:8001/home](http://localhost:8001/home) on a browser on your local machine.

## Run Unit and Functional Tests
## Download and Set Geckodriver
To run tests it is essential that you have geckodriver downloaded and set in your path.

You can also run unit and functional tests by running the command:
Download Geckodriver:

python manage.py test name_of_app_here
```bash
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz
```

For example, in the project, there are Django apps called volunteer, job, shift and organization. You can run tests for these apps individually by running these commands separately:
Unpack it:

```bash
tar -xzvf geckodriver-v0.20.1-linux64.tar.gz
```
python manage.py test volunteer

Set it in your path

```bash
sudo mv geckodriver /usr/local/bin
```


## Run Unit and Functional Tests

You can also run unit and functional tests by running the command:

```
python manage.py test job
python manage.py test ../tests/<name_of_app_here>/
```


For example, in the project, there are Django apps called volunteer, job, shift and organization. You can run tests for these apps individually by running these commands separately:

```
python manage.py test shift
python manage.py test ../tests/volunteer/
```

```
python manage.py test organization
python manage.py test ../tests/job/
```

If you want to run only unit tests for an app, refer to its test_services file using the dot notation.

For example, if you want to run unit tests for the event app:
```
python manage.py test event.tests.test_services
python manage.py test ../tests/shift/
```

Smilarly, for job app it would be:
```
python manage.py test job.tests.test_services
python manage.py test ../tests/organization/
```

If you want to run all unit tests, run this command:

python manage.py test
```
python manage.py test ../tests/
```

Once you are done with testing out and running the project, you may want to exit the VM and suspend or shut it down by running these commands:

Exit out of the ssh session with the VM by running:

exit

```
exit
```
To put the VM in suspend mode, run the command:

vagrant suspend
```
vagrant suspend
```

Alternatively, to shut down the VM, run the command:

vagrant halt
```
vagrant halt
```

0 comments on commit eeec398

Please sign in to comment.