CWB tips: avoid "i should see"

Just a pointer for Cucumber tests:

Avoid the i should see “TEXT” step, it checks only if a certain string is found in document.body. It is easy but it is not reliable to check if this text is really visible. Choose to see if a specific element is visible or contains a certain text.

AVOID:

  • i should see “there is an error”

USE:

  1. i should see div “there is an error” <- check on the text AND check on the visibility of the div!
  2. div “feedback” should contain “there is an error” <- check on the text but NO check on the visibility of the div!

More info on alternatif steps: Language Reference