Selenium/Explanation/Anti-patterns

From mediawiki.org

This list is not complete. Please help me complete it.

Principles[edit]

  • Never trust a test you did not see fail.

A good test...[edit]

  • Is as small as possible. While still providing value.
  • Is as simple as possible. It is more important for tests to be simple than DRY.
  • Tests as little as possible. When it breaks, it should be easy to find why.
  • Uses API for setup. As much as possible. It’s both faster and more robust.
  • Uses page objects. Exceptions are possible but not probable.
  • Doesn’t depend on others. Test suite should pass when tests are running in random order or in parallel.
  • Sets up it’s environment.
    • Users, pages, files...
    • It does not depend on the environment being in a certain state.
  • Is at a lower level.
    • What could be tested at a lower level should not be tested at a higher lever.
    • There should be as little high level tests as possible.

See also[edit]