## Acceptance testing
### How to add a new test set for a feature
- Make sure you have agouti and ginkgo installed
- `go get github.com/sclevine/agouti`
- `go get github.com/onsi/ginkgo/ginkgo`
- Generate the test set skeleton
- `ginkgo generate --agouti your_feature_name`
- Add acceptance test tag to the top of the file. Make sure this line is at the top and it separated by an empty line before the next non-empty line.
- `// +build acceptance`
- Change the package from `acceptance_test` to `acceptance`
- Remove this unnecessary import (`. "github.com/18F/cf-deck/acceptance"`) that is generated by ginkgo
- There is a `startServer()` function which will start a go test server and return it. Make sure you run `close()` on it when done.
- There is a `createPage()` function that creates a page for you. Make sure to run `Expect(page.Destroy()).To(Succeed())`
- More helpers reside in `cf_console_suite_test.go` file
### Running the tests
- Make sure you have `CONSOLE_TEST_USERNAME`, `CONSOLE_TEST_PASSWORD`, `CONSOLE_TEST_ORG_NAME`, `CONSOLE_TEST_SPACE_NAME`, `CONSOLE_TEST_APP_NAME`, `CONSOLE_TEST_HOST`, and `CONSOLE_TEST_DOMAIN` set in your environment.
- This represents a username and password for the test to browse through with.
- Make sure you have docker installed on your computer
- For automated mode:
- `acceptance/scripts/run_test.sh -a`
- For debug mode where the developer can vnc into the container:
- `acceptance/scripts/run_test.sh -d`
- Once inside the container, run `acceptance/scripts/debug.sh`
### Travis CI Gotchas
- Periodically, Travis will [hang](https://github.com/travis-ci/travis-ci/issues/3251) during the acceptance tests. Just restart the build.