Home / Companies / Tines / Blog / Post Details
Content Deep Dive

Using backend factories during frontend testing

Blog post from Tines

Post Details
Company
Date Published
Author
Julia Grabos
Word Count
1,151
Language
-
Hacker News Points
-
Summary

End-to-end testing for web applications can be challenging, particularly when setting up test data, but using a fixture factory library like FactoryBot can help streamline the process by sharing backend fixture libraries with the frontend. This approach ensures the creation of realistic and appropriate test data that aligns with system expectations, thereby enhancing the quality of end-to-end (E2E) tests. By automating these tasks, it allows the tests to mimic real user interactions with the application more accurately, testing the data flow, network requests, and service interactions. Unlike traditional methods that rely on stubbed objects or application snapshots, the use of FactoryBot in E2E testing involves making real network requests and database queries, which reduces maintenance costs and increases the likelihood of catching bugs across both frontend and backend. This method, adopted by Tines using Playwright for browser automation, results in a more accurate representation of user interactions and supports the philosophy of true end-to-end testing by ensuring that the data created during tests reflects real user actions.