Skip to content
Update Testing Guide authored by Julian Rausch's avatar Julian Rausch
......@@ -44,13 +44,34 @@ Conventions for Tests
The default testing framework in Grails is Spock. Spock's naming conventions are:
- Unit Test (classes under ```test```) SHOULD end in "Spec" and MUST extend ```Specification``` and implements ```DataTest```.
- Integration Test (classes under ```integration-test```) should end in "IntegrationSpec" and MUST extend ```Specification``` and annotated with ```@Rollback``` and ``` @Integration```.
- Integration Test (classes under ```integration-test```) should end in "IntegrationSpec" and MUST extend ```Specification``` and annotated with ```@Rollback``` and ```@Integration```.
For "legacy" tests (JUnit), the development team agreed on the following naming conventions for tests:
- Unit tests (classes under ```test```) SHOULD end in "UnitTests".
- Integration tests (classes under ```integration-test```) SHOULD end in "Tests".
E2E with Cypress
----------------------------------------------------
### Getting Started ###
For starting Cypress Tests a cypress.env.json file is needed. This file should contain the following:
```
{
"operator_username": "otp",
"operator_password": "otp"
}
```
To define an individual baseUrl use the following command:
```export CYPRESS_BASE_URL=https://localhost:8080```
All Cypress tests can be run with ```npm run cy:run```
For Individual testing and to use the gui run the command ```npm run cy:open```
Unit Testing (With Fake Objects)
--------------------------------
......
......