...
Other page functionality, such as sorting and filtering - particularly when this shifts to being done on the server-side for other pages.
The home and mappings pages, in a similar vein to how the other pages have been tested.
The process of uploading mappings, and whether the page updates correctly once uploaded or displays the appropriate error messages.
The Details page and its variants, and their corresponding actions (closing accordions etc).
The 404 and unauthorised pages.
The content of the header, footer and sidebar (particularly release information).
Other functionality as it is added, to prevent future regression and improve reliability.
How we are handling network requests and responses
At present, we have decided to mock our network responses, rather than using genuine server responses. This approach was chosen for the following reasons:
No need to make any code changes, or seed data.
No stress placed on our DCB dev server.
Control over response bodies, status and headers allows us to test a wider range of scenarios in future.
Fast response times, with the ability to add delay to simulate bad network conditions.
Suited to JSON APIs, as responses can be easily stubbed with fixtures.
However, there are also some trade-offs:
No test coverage on server endpoints.
No cast-iron guarantee that the stubbed responses 100% match the server responses.
As such, we may want to introduce tests using genuine server responses in the future, but use them sparingly and only around critical paths, as recommended in the official docs.
An example pathway of a test using this approach:
Test navigates to a certain point in DCB Admin at which a request is sent (i.e. navigating to a new page, or creating a new group).
The request is sent as it normally would be (if it isn’t, the test will fail).
Our tests use cy.intercept() to intercept the request at the network layer, before it can reach DCB Admin.
Our stubbed response kicks in (usually from a specified fixture) to provide the response.
Assuming the response is as expected, the test continues.
Why Cypress was chosen for this work
...