Company
Date Published
Author
Nico Domino
Word count
1289
Language
English
Hacker News points
None

Summary

We've adopted a strategy of separating concerns in our tests by using a custom API client to prepare and tear down UI test cases using the underlying API. This approach allows us to make the entire test setup easier to manage, avoid code duplication, and ensure that tests are more reliable. By introducing a custom Node.js API wrapper, we can leverage plain API calls to set up and tear down resources in our Playwright tests, making them faster, more stable, and idempotent. This practice enables us to run our tests continuously without worrying about leaving traces behind, even if the UI test fails or succeeds.