Implement e2e (end-to-end) tests via Cypress site wide #3978
Labels
help wanted
Needs a volunteer to claim to move forward
testing framework
Related specifically to Unit or Integration (e2e) Tests
Describe the bug
Currently, while we have e2e accessibility tests for most pages within the DSpace user interface, we have very few true e2e tests. The existing tests are all written using cypress.io, and can be found in the
./cypress/e2e
subfolder:https://github.com/DSpace/dspace-angular/tree/main/cypress/e2e
As you can see in that subfolder, most of the pages within DSpace have an existing
*.cy.ts
test file. However, if you open up those files, they are often very minimal and only perform an accessibility scan of the page. See for example the "Browse by Title" tests:https://github.com/DSpace/dspace-angular/blob/main/cypress/e2e/browse-by-title.cy.ts
Expected behavior
All pages in DSpace should have e2e tests which prove that the basic page actions all work properly. For each page, this would include testing an interaction with everything on that page (e.g. clicking each button/link and ensuring the expected results occur, similarly using each interactive field, submitting forms, etc.) The best examples we have are the tests for Submission & MyDSpace:
(However, it is worth noting that even the Submission tests and MyDSpace e2e tests could be improved, as they don't click every button or perform every action yet. But, some major actions are being done already in each of those e2e tests.)
Benefits of e2e tests
Adding more e2e tests will provide us with some very useful benefits:
@dependabot
fordspace-angular
. With more e2e tests, we'll be able to catch if simple dependency updates impact any features of the system.Necessary Developer Knowledge
It is highly likely that this ticket will require many PRs to completely solve. Therefore, we may wish to have different volunteer developer claim different pages to write e2e tests for.
This task can likely be claimed by junior developers who have knowledge of how one (or more) specific pages in DSpace should function.
Developers who wish to claim this task should only need familiarity with Typescript and with Cypress.io. Cypress is quite powerful, and has a relatively easy syntax to learn (see Cypress Docs). You can also easily modify e2e tests and rerun them in Cypress without requiring a full recompilation/rebuild of the Angular UI. Existing DSpace e2e tests can provide guidelines: https://github.com/DSpace/dspace-angular/tree/main/cypress/e2e
More information on running e2e tests locally can be found in our README at https://github.com/DSpace/dspace-angular/?tab=readme-ov-file#e2e-tests
The text was updated successfully, but these errors were encountered: