Search code examples
yii2functional-testingcodeception

Codeception Adding custom assert actions (functional testing)


I'm trying to add new assert methods to Codeception, but without success. The problem is that I'm not sure where to put my helpers,

Following the doc (http://codeception.com/docs/06-ReusingTestCode), I think I have to create new Helper class but I don't have _support folder. In tests I have only _output folder (excluding my folders).

Any help would be greatly appreciated.


Solution

  • Use command php codecept generate:helper name (don't use word Helper in the name, it will be added automatically) to generate the helper class.

    Codeception 2.1 names helpers Helper\Name - use the full name in your suite configuration files.

    If you are interested what's the right path, look at the paths section of your codeception.yml file. http://codeception.com/docs/reference/Configuration