The secret passages – making your UI tests more efficient with API calls
The goal of every test is to be as small and specific as possible. That way, by taking a glance at the test results, you should be able to tell what went wrong. Making debugging easier is indispensable and valuable, especially as applications grow.
When writing tests, the first question to ask is “what am I trying to test?”. The second one is “why?”. As obvious as it might sound, these questions are imperative to write powerful and simple tests. At times, we end up testing things that do not correspond to our application’s behavior or end up writing a long succession of events to reach the small part that we want to test.
To help with the question of “why am I trying to test” and avoid repetition across tests, we can leverage the use of API calls. While using a UI for testing is a great way of simulating the actual behavior of the users, certain actions...