End-to-End Testing
Learning objectives
- You know what end-to-end testing is.
End-to-end (E2E) testing is used to assess that the application works as a whole, meaning that the application has all of the components that it would have also when deployed to production. In practice, in our case, this means that the application is tested using a browser and that the application runs the server and the database, and any other components that it depends on.
When conducting E2E tests, we simulate user actions in the application to reach specific goals, mimicking the interactions that a user would actually perform. For web applications, this includes opening up a page in a browser, navigating in the page, perhaps filling in a form, submitting the form, and checking that the data is shown as expected. As systems often have multiple use cases -- i.e. how the user interacts with the system and how the system reacts to the user -- multiple end-to-end tests are needed.
There are multiple libraries for writing E2E tests, including Selenium, Puppeteer, Cypress, and Playwright. In these materials, we briefly look into the use of Playwright.