E2E testing best practices

Organizing Tests

Writing Tests:

It is a good practice to group test based from its feature/purpose. Example: In an web application, there are level of user access on the page. And since the two are distinct to one another, then it is best to separate its Feature files. One directory that contains not logged in are name Guest. And the other one Member.

Logging In:

What is needed?

  • Abstraction

  • Reusable

  • Decouple

The best approach to Login was to use a custom commands since it can be used multiples time as long as the login call is declared. And since custom commands are loaded before any test files are evaluated via an import statement, it is way more faster than having a method inside a test or using page objects. Login without a relying on the UI. These is possible with the used of POST request authentication.

References:

Last updated