Name: licences-feature-specs
Owner: NOMS Digital Studio
Description: End-to-end tests for the Licences application
Created: 2017-09-18 08:39:41.0
Updated: 2018-05-24 09:55:30.0
Pushed: 2018-05-24 09:55:29.0
Homepage: null
Size: 11385
Language: Groovy
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
End-to-end tests for the Licences Application see http://www.gebish.org/manual/current/
The following environment variables must be set:
http://localhost:3000
Note that you can set values for the Database environment variables in a config.properties file in the project root.
The Licences application must be running at Licences_URI, and must be connected to a database and a nomis api or suitable mocks.
Note that for running against Mock or Stage in CircleCI we need to supply environment specific values for properties such as TEST_DB_USER. In the Circle CI environment variables we supply Stage specific variants eg TEST_DB_USER_STAGE. In .circleci/config.yml we take TEST_DB_USER_STAGE and use it tro replace TEST_DB_USER eg export TEST_DB_USER=“$TEST_DB_USER_STAGE”
In src.test/resources/GebConfig.groovy you can change from headless mode (Phantom JS) to browser mode with ChromeDriver. If not using the bundled Linux ChromeDriver, set the webdriver.chrome.driver property with your ChromeDriver path.
Run with gradle or execute a specific test using your IDE.
./gradlew test
or ./gradlew mockTest
- executes all specs
./gradlew stageTest
- executes only specs marked with @Stage
See http://www.gebish.org/manual/current/
See http://spockframework.org/spock/docs/1.1/all_in_one.html
Where specs relae to a particular user type, put them in a subdir named for that user type
Use the PageObject style
Prefer @Stepwise
because it's a bit faster
This means that the tests in a spec are executed from top to bottom. This means that each test depends on the prevous tests. Disadvantage is not being able to run an individual test. Advantage is not having to login and navigate back to the same page again.
When adding or changing tests, consider the context assumed by existing tests.
Use the `@Stage' annotation on a spec or a test to mark it for execution against the stage environment.
Because this is a subset, consider what the context will be if previous tests in a Stepwise spec are not executed.
Specs or individual tests should be tagged for stage only if they depend on an interaction with the nomis elite2 api. If it doesn't use elite2, then there's no difference between mock and stage.
This only needs to include a few key tests that exercise the elite2 api interaction, not an exhaustive duplication.
Automated tests emply user accounts specific for automated testing eg CA_USER_TEST.
They also use a naming convention to identify test data exclusive to automated tests. Any test data for
an automated test should use a Nomis ID / offender number ending with 'XX' eg A0001XX