This repository was archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
6.3. Codeception Framework usage
Shin Okada edited this page Jun 13, 2016
·
1 revision
Install Laravel from composer
composer create-project laravel/laravel
cd laravel
Install codecept through laravel/composer.json.
"require-dev":{
"codeception/codeception": "2.1.*@dev"
}
In terminal composer install --dev.
Laravel require mcrypt, so you may need to install mcrypt.
// either
codecept bootstrap
// or create it under app directory
codecept bootstrap app
// if installed it under app move codeception.yml to root
mv app/codeception.yml codeception.yml
// running codecept will give an error
codecept run
// edit codeception.yml path
paths:
tests: app/tests
log: app/tests/_log
data: app/tests/_data
helpers: app/tests/_helpers
....
dump: app/tests/_data/dump.sql
....
// now you can run codecept run
codecept run
In app/tests/functional.suite.yml, add Laravel5 to enabled.
class_name: FunctionalTester
modules:
enabled: [Filesystem, FunctionalHelper, Laravel5]
In terminal run codecept build.
This will add methods such as amOnPage etc. Doc
The functional test does not require the server running.
In terminal
codecept generate:cept functional MyFirstFunctional
This will create app/tests/functional/MyFirstFunctionalCept.php. Add the following to the file.
$I = new FunctionalTester($scenario);
$I->wantTo('verify the home page');
$I->amOnPage('/');
$I->see('hello there');
Run in the terminal.
codecept run functional
Important: The Tables of Content are generated. Any change will be overridden on the next update.
For more information: GitHub Wikifier