Skip to content

Avoid these anti patterns

Assertions in page objects 📃

  • Asserts should be tests responsibility

    Only a single assert that verifies page/elements are loaded properly ✅

Webdriver methods in tests/page objects

If you have WebDriver APIs in your test methods, You're Doing It Wrong. -- Simon Stewart.

  • Follow DRY (Don't repeat yourself) ⚔️ 🔁
  • Put common wrappers in a BasePage class

Long E2E tests with multiple actions and assertions

  • Debugging nightmare 😱
  • Might cause bugs to be discovered later if earlier steps fails

Writing too much UI automation

💡 Less is more

  • DO NOT test everything from the app
  • Write tests for more visual aspects
  • Prefer to write Functional API tests or Integration/Unit tests instead

Replace exploratory testing

  • Automated tests can automate checks and be good change detectors
  • Exploratory testing with automation is 💯% valuable