Last updated November 7, 2012.
All custom step definitions should:
- Follow coding standards
- Use valid, robust selectors
- Be placed in the right def block
- Properly chain steps
- Reuse existing step definitions where possible
- Avoid fragile definitions
- Throw exceptions in the proper place
- Provide meaningful exception text
- Add proper step definition description above the regular expression so that it will appear when you type
bin/behat -di - When writing a new step definition, write in such a way that it is more flexible and should be able to reuse with minor or no modifications