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.