ui-testing-best-practices

Found a bug? Write the test, then fix it


One Paragraph Explainer

So, you have found a bug in your front-end application and you have already debugged it. You can reproduce it systematically and you’re ready to fix it. A testing-oriented mind must pass through these steps:

What are the advantages of this approach? Why should you write a test? I know that fixing the bug without a test could seem faster but consider that:

Last but not least: be sure that the test you write fails at the beginning! And that it fails because of the bug! The test is not useful only to reproduce the bug and check it visually, but it must put you in the position of having positive feedback after the bug fixing process. A bug-related test that does not fail is really dangerous because you can think that you’ve made a good job when the reality is that you have not reproduced the bug correctly since the beginning. As a general rule: a broken flow must have a broken test, a successful test must be related to a working app.