-
Notifications
You must be signed in to change notification settings - Fork 0
Best practices
Here I will try to explain my most common ideas about testing.
Do not seek to make your feature file more primitive. BDD is not only about testing but it is about development methodology. Keep describing steps in human understandable format. It is more valuable than to shrink step description. I made possibility to assign several description to one handler for this purpose exactly. Feature files should provide high visibility for all project people but test scripts can't do that.
I consider that is wrong point to check result of some operation in database records. If you have such need it may a signal that application have wrong behavior cause user any actions always should be followed some visible result. So if user wrote the comment test should check if this comment posted somewhere, if set some checkbox - get some notification about settings changed, submit some form - to see log of form status.
But if you need to check some server side data in spite of my humble opinion it can be made as some debug log available through AJAX.
Fell free to post and vote for issues if you really need to get data from server side I will appreciate you ideas.
I don't want to make separate config files for test. My approach is to make test step and config in form of feature file. That is why I added some steps to standard library for test configuration and feature file dispatching. So I suggest to make initial feature file in the following form:
Feature: Initial Scenario: Press button Set step delay to 5 sec Enable animation Run feature file "feature_1" Load library "special library" Run feature file "feature_2" ... Run feature file "feature_N"
It also allow to diminish changes in feature file which made by other persons