Skip to content

Commit 69b3cb9

Browse files
committed
add test data info to readme
1 parent 09b739c commit 69b3cb9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,24 @@ The Playwright [Page Object Model] (or POM) approach is taken when developing th
141141
142142
[Page Object Model]:https://playwright.dev/docs/pom
143143
144+
### Test data
145+
146+
Test data is created before running tests using the `/api/testing/onboard` endpoint of the chosen MAVIS environment. The data is then cleaned up at the end. Most of this can be seen [here]. The following process is performed for each worker:
147+
148+
1. For each programme group (HPV, Flu, Doubles, MMR)
149+
1. A random valid year group is selected.
150+
2. Two random valid schools that have this year group are retrieved using the MAVIS `/api/testing/locations` endpoint.
151+
3. User, team, and organisation data is generated by the test worker.
152+
4. The school, user, team, and organisation data is sent to the MAVIS `/api/testing/onboard` endpoint, inserting all of this data into the database and linking the schools to the team.
153+
5. The test worker also generates two children which are not immediately added to the database but can be imported later.
154+
2. The generated test data is provided as a set of fixtures, which can be injected into tests (or other fixtures). Some common examples:
155+
- `children` – provides two children for each programme group (in the form of a map)
156+
- `schools` – provides two schools for each programme group (also in the form of a map)
157+
3. After a test module has finished, the worker clears out any data created by running the test module by calling the MAVIS `/api/testing/teams/<workgroup>` endpoint with parameter `keep_itself=true`.
158+
4. After a worker has finished running all test modules allocated to it, it calls the MAVIS `/api/testing/teams/<workgroup>` endpoint without the `keep_itself` parameter, which clears all associated with the team used by the worker including the team itself. No data should remain after a test run.
159+
160+
[here]: https://github.com/NHSDigital/manage-vaccinations-in-schools-testing/blob/main/mavis/test/fixtures/data_models.py
161+
144162
### More information
145163
146164
Further details on the scope and approach of the automation are on the [NHSD Confluence page](https://nhsd-confluence.digital.nhs.uk/pages/viewpage.action?spaceKey=Vacc&title=Mavis+Test+Automation).

0 commit comments

Comments
 (0)