Skip to content

Commit

Permalink
LGA-132 Remove end to end tests
Browse files Browse the repository at this point in the history
* Remove nightwatch tests, dependencies and misc files
* Instructions for running end-to-end tests
  • Loading branch information
rowlando committed Aug 3, 2018
1 parent 7723a58 commit d3141db
Show file tree
Hide file tree
Showing 61 changed files with 1,700 additions and 6,705 deletions.
61 changes: 1 addition & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Login to contrainer registry
name: Login to container registry
command: |
apk add --no-cache --no-progress --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ aws-cli
login="$(aws ecr get-login --region eu-west-1 --no-include-email)"
Expand Down Expand Up @@ -60,70 +60,11 @@ jobs:
source env/bin/activate
python manage.py test
browser-test:
docker:
- image: circleci/python:2.7-node-browsers
steps:
- checkout
- run:
name: Setup Python environment
command: |
pip install virtualenv
virtualenv env
- restore_cache:
keys:
- pip-v2-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/test.txt" }}
- run:
name: Install dependencies
command: |
source env/bin/activate
pip install --requirement requirements.txt --requirement requirements/test.txt
- save_cache:
key: pip-v2-{{ checksum "requirements/base.txt" }}-{{ checksum "requirements/test.txt" }}
paths:
- "~/.cache/pip"

- restore_cache:
keys:
- npm-v1-{{ checksum "package-lock.json" }}
- run:
name: Install javascript dependencies
command: |
npm install
./node_modules/.bin/bower install
npm run update-selenium
- save_cache:
key: npm-v1-{{ checksum "package-lock.json" }}
paths:
- "./node_modules"

- run:
name: Compile assets
command: ./node_modules/.bin/gulp

- run:
name: Start server
background: true
command: |
source env/bin/activate
python manage.py runserver
- run:
name: Run browser tests
command: |
dockerize -wait tcp://localhost:5000
./nightwatch -c tests/nightwatch/ci.json --env chrome
- store_artifacts:
path: tests/reports


workflows:
version: 2
build_and_test:
jobs:
- test
- browser-test
- build:
requires:
- test
- browser-test
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ pip-log.txt
.coverage
.tox
nosetests.xml
nightwatch.xml

*.log

tests/reports/nightwatch/*

# Translations
*.mo

Expand Down
33 changes: 0 additions & 33 deletions Makefile

This file was deleted.

31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,33 @@ to `serve` task.

## Testing

### Unit tests

To run Python unit tests, use the following:

./manage.py test

To set up for running tests

npm run update-selenium

(At the moment Jenkins requires npm package selenium-standalone@~4.4 which in turn installs 2.45.0-server.jar and 2.15-x64-chromedriver. These versions seem to run the tests successfully with firefox version 34.0, which must be installed on the Jenkins server)

To run the NIghtwatch automated tests in PhantomJS use:
### End to end browser tests
The browser tests reside in https://github.com/ministryofjustice/laa-cla-e2e-tests. Follow the instructions to get these running on your local machine.

make test
TODO: Make these tests run automatically when a new build of the `develop` branch is pushed to Docker registry.

This command accepts two parameters:
If you want to run the tests whilst developing, you'll need to update `docker-compose.yml` from:

- `browser` - `chrome`, `firefox`, `default` (Phantom JS)
- `spec` - name of the spec file to run (within `tests/nightwatch/specs/` directory)
```
cla_public:
image: [url_to_remote_image]
```

Example:
to something like:

make test browser=chrome spec=review-page
```
cla_public:
build:
context: ../cla_public
```

Please see the `Makefile` for other commands.
where the `context` directory is set to the root of the cla_public directory.

## Releasing

Expand Down
Empty file removed foo
Empty file.
2 changes: 0 additions & 2 deletions nightwatch

This file was deleted.

0 comments on commit d3141db

Please sign in to comment.