Test Data Factory: Why and How to Use

What Problem Does the Test Data Factory Solve?

One of the biggest pain points during test automation, whatever the layer you are testing, is to manage the test data. I would say it’s quite easy to manage in the unit and integration levels, where we can control the application state, but for functional and e2e tests it’s quite hard.

Would be awesome if we could stop manually change data we have in the code file or even from an external source like a CSV or JSON file, right?

Don’t Use assertTrue to Verify Text in Your Test

Introduction

It is common, especially in functional tests on any front-end (web, mobile), to include text validation in our tests to verify that the returned value is the expected one. These validations are user failures or even information about a successfully executed command.

However, it is common to see many professionals using the assertTrue command instead of assertEquals to validate the returned text.