Hi, I created a new project Yii2 advanced template. On the start I have folder tests who holds basic tests frontpage site. e.g login page, homeCept, aboutCept etc.
I have now two questions:
1 How i can run this tests ?
2 Do i need download through composer package codeception? "codeception/codeception": "2.0.*" ?
3 What’s in folder vendro/bin in codeception file? If I will execute command “codeception bootstrap”, it will create new folder tests under vendor/bin… Whose folder tests i have to use to my tests?
I am as you and trying to figure out how to do testing Yii2. so I share with you what I know so far.
After you install and init Yii2 advance template, and test to make sure the frontend.dev and backend.dev is working. Then to do test
you need to install codeception by
composer global require "codeception/codeception:*"
The command will install codeception globally. Then, you need to add codeception command line to your ‘PATH’ (google on how to it on linux/window) so that you can do ‘codecept’ command without typing the full path.
Then for testing, because you are using yii2 advance template, front end and back end has different tests.
To test front end, you need to go to www/yii-application/tests/codeception/frontend
To test back end, you need to go to www/yii-application/tests/codeception/backend
from there, you can
codecept build
codecept run # this will run all your acceptance, functional and unit test suite
it’s not working. I use global composer, but if I enter app/tests/codeception/frontend and try type codecept bulid or codecept run, my console tell me, that not recognize codecept. It command working only if I’m in vendor/bin folder becouse there is codecept file.
work here, but he creates a new folder tests… i nothing understand with this. Now i have 3 folders tests