--- layout: bootstrap title: Quick Start Codeception ---
Install via Composer
composer require "codeception/codeception" --dev
Execute it as
./vendor/bin/codecept
wget http://codeception.com/codecept.phardownload
Execute it as
php codecept.phar
wget http://codeception.com/php5/codecept.phardownload
Execute it as
php codecept.phar
sudo curl -LsS http://codeception.com/codecept.phar -o /usr/local/bin/codecept
sudo chmod a+x /usr/local/bin/codecept
Execute it as
codecept
Execute:
codecept bootstrap
This creates configuration file codeception.yml and tests directory and default test suites. Acceptance, functional, unit test suites are created as well.
See Demo
Generate your first acceptance test. Acceptance tests emulate behavior of a real user visiting your site.
codecept generate:cest acceptance First
Codeception scenario tests are called Cepts.
Please make sure your local developemt server is running. Put application URL into: tests/acceptance.suite.yml
actor: AcceptanceTester
modules:
enabled:
- PhpBrowser:
url: {YOUR APP'S URL}
- \Helper\Acceptance
It's now time to write your first test. Edit the file we've just created tests/acceptance/FirstCest.php
It will check that your frontpage contains the word Home in it.
Tests are executed with 'run' command
codecept run --steps
This will execute our Welcome test with PhpBrowser. It's PHP script that can check HTML page contents, click links, fill forms, and submit POST and GET requests. For more complex tests that require a browser use Selenium with WebDriver module.
Use predefined installation templates for common use cases.
Run them instead of bootstrap command.
codecept init acceptance

codecept init api

codecept init unit

Read Codeception Guides to learn how to use it.