Initial set up for Ghost Inspector integration tests.

Adds a CircleCI integration for Ghost Inspector
(https://ghostinspector.com), a headless browser testing SaaS. The
README is updated with details about how to run GI locally.

Removes the bootstrap setup for Selenium testing with BrowserStack.
This commit is contained in:
dandds
2019-10-10 09:22:10 -04:00
parent 73a459ea28
commit 7949c64b9b
8 changed files with 101 additions and 172 deletions

View File

@@ -220,30 +220,37 @@ To generate coverage reports for the Javascript tests:
yarn test:coverage
### Selenium Tests
### Ghost Inspector Tests
Selenium tests rely on BrowserStack. In order to run the Selenium tests
locally, you need BrowserStack credentials. The user email and key can
be found on the account settings page. To run the selenium tests:
AT-AT uses [Ghost Inpsector](https://app.ghostinspector.com/) for
integration testing. These tests do not run locally as part of the
regular test suite but do run in CI. To run them locally, you will
need the following:
- [docker](https://docs.docker.com/v17.12/install/)
- [circleci CLI tool](https://circleci.com/docs/2.0/local-cli/#installation)
- the prerequisite variable information listed [here](https://ghostinspector.com/docs/integration/circle-ci/)
The version of our CircleCI config (2.1) is incompatible with the
`circleci` tool. First run:
```
BROWSERSTACK_TOKEN=<token> BROWSERSTACK_EMAIL=<email> ./script/selenium_test
circleci config process .circleci/config.yml > local-ci.yml
```
The selenium tests are in `tests/acceptance`. This directory is ignored by
pytest for normal test runs.
The `selenium_test` script manages the setup of a separate database and
launching the BrowserStackLocal client. If you already have the client running
locally, you can run the selenium tests with:
Then run the job:
```
BROWSERSTACK_TOKEN=<token> BROWSERSTACK_EMAIL=<email> pipenv run pytest tests/acceptance
circleci local execute -e GI_SUITE=<SUITE_ID> -e GI_API_KEY=<API KEY> -e NGROK_TOKEN=<NGROK TOKEN> --job integration-tests -c local-ci.yml
```
The BrowserStack email is the one associated with the account. The token is
available in the BrowserStack profile information page. Go to the dashboard,
then "Account" > "Settings", then the token is under "Local Testing".
If the job fails and you want to re-run it, you may receive errors
about running docker containers or the network already existing.
Some version of the following should reset your local docker state:
```
docker container stop redis postgres test-atat; docker container rm redis postgres test-atat ; docker network rm atat
```
## Notes