Introduction
Token-based authentication helps tests log in users safely without typing passwords every time.
When you want to test pages that need a logged-in user.
When you want faster tests by skipping the login form.
When you want to reuse the login token across many tests.
When testing APIs that require a token to access data.