Skip to content

Commit

Permalink
Updates README for the functional tests
Browse files Browse the repository at this point in the history
Mostly correcting a typo in the `instance_information.json` config
filename, but also updated some of the example commands. The notes
regarding potentially failing tests also seemed out of date, as several
members of the team have confirmed working functional tests under the
new TB Selenium logic recently.
  • Loading branch information
kushaldas authored and Conor Schaefer committed Jul 26, 2018
1 parent 30f014a commit 64c15ec
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions securedrop/tests/functional/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
### Install the Python dependencies


```
pip install tbselenium
pip install PyVirtualDisplay==0.2.1
```

### Install Tor Browser 7.5

Put it under `~/.local/tbb` directory.
Steps are in `../../install_files/ansible-base/roles/app-test/tasks/install_tbb.yml` file.

### Install geckodriver

This is yet to be in the Ansible.
[Download](https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz) 0.17.0 from
the [release page](https://github.com/mozilla/geckodriver/releases/tag/v0.17.0). Move the binary to `/usr/bin/`.

### To test in prod vms

- `sudo -u www-data bash`
- `cd /var/wwww/securedrop/`
- `./manage.py reset` # This will clean the DB for testing
- `./create-demo-user.py`



Update this information to the `functional/instance_infomration.json file.
Update this information to the `tests/functional/instance_information.json file.

The content of the file looks like below.

```
{
"hidserv_token": "",
"journalist_location": "http://127.0.0.1:8081",
"source_location": "http://127.0.0.1:8080",
"hidserv_token": "asfjsdfag",
"journalist_location": "http://thejournalistfqb.onion",
"source_location": "http://thesourceadsfa.onion",
"sleep_time": 10,
"user": {
"name": "journalist",
Expand All @@ -47,11 +26,8 @@ The content of the file looks like below.
### Run the tests

```
$ pytest -v functional/test_source.py | less
cd securedrop
./bin/dev-shell ./bin/run-test -v tests/functional/
```

Remember to use to pipe to less, or less in case of a failure, there will be too much output.

- `functional/test_source_warnings.py`: THis will fail as we are actually using Tor Browser :)
- `functional/test_submission_not_in_memory.py`: Not inside of the server, so does not make sense.
- `functional/test_source_session_timeout.py`: Remember to change the session time in the server to 0.02 before testing this.
You may wish to append a pipe to less (i.e. `| less`), as a failure may generate
many pages of output, making it difficult to scroll back.

0 comments on commit 64c15ec

Please sign in to comment.