Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The correct rendering of the core DCB Admin pages: agencies, patron requests, groups, hostlmss, sourceBibs and locations - do these pages load as they should, with the data and UI elements we expect?

  • The search functionality on the aforementioned DCB Admin pages: can a user find what they’re looking for, and does search searching return the expected results?

    • This is an area for particular development - search has been tested as an example DataGrid action, and filtering and sorting should be tested in the same wayprinciple should be extended to filtering and sorting. It is somewhat more complicated on pages that use server-side searching, sorting and filtering, but it is still possible to test.

  • The creation of new groups, and whether new groups are displayed (and displayed with the correct information) on the groups page after their creation.

    • This is an example of an action test: there are many other actions that could be tested within DCB Admin, such as uploading mappings and adding agencies to groups.

    • Action tests should have two main phases:

      • Did the action complete successfully (i.e. were the appropriate requests sent / responses received)?

      • Was the result correctly shown to the user? (i.e. if a new group is created, does it show up in the grid?)

  • Login and logout within DCB Admin, whether core UI elements render as they should, and whether they change and render correctly when a user is logged in / logged out.

...

For more information on running Cypress through the command line, please refer to the documentation.

Running coverage reports

Note

While code coverage is currently disabled due to several known issues with Next.js, the SWC compiler and Cypress code coverage, the information below will be how it works when these issues have been resolved.

Our Cypress setup has code coverage reporting configured automatically through the cypress/code-coverage plugin. This will generate a code coverage report and save it to the coverage directory. However, if you want to see a summary of the code coverage after the tests have been run, run the following command.

...

Info

Different examples from within the codebase may be useful to illustrate different testing use cases

  • patronRequests Refer to groups.cy.ts will serve as for an example of a test for testing a simple, data-grid displaying pagepage with searching and an additional action (the ‘new group’ modal).

  • agencies.cy.ts is a useful template test with lots of informative comments for every testing step.

  • patronRequests.cy.ts will serve as an example for testing a page with an additional form (the ‘add agencies form’) is a good example of a test for a ‘standard’ page - i.e. one with no additional actions.

Debugging

Cypress' documentation has an excellent guide to debugging that can be found here. The standard Developer Tools for your browser can be used in operation with Cypress, making debugging considerably easier.

...