--- layout: bootstrap title: Quick Start Codeception ---
Codeception PHP Testing Framework is designed to work just out of the box. This means its installation requires minimal steps and no external dependencies preinstalled (except PHP, of course). Only one configuration step should be taken and you are ready to test your web application from an eye of actual user.
Download and save the phar archive to the root of your web application.
Download Codeceptionalternatively download it from console
wget http://codeception.com/codecept.phar
php composer.phar require "codeception/codeception:*"
Use ./vendor/bin/codecept instead of codecept.phar in this tutorial.
Open console directory where you saved codecept.phar file and execute:
php codecept.phar bootstrap
This creates codeception.yml file and tests directory.
Generate your first acceptance test. Acceptance tests emulate behavior of a real user visiting your site.
php codecept.phar generate:cept acceptance Welcome
Codeception scenario tests are called Cepts.
It's now time to write your first test. Edit the file we've just created tests/acceptance/WelcomeCept.php
It will check that your frontpage contains the word Home in it.
Please make sure your local dev serveris running. Put application URL into: tests/acceptance.suite.yml
class_name: WebGuy
modules:
enabled: [PhpBrowser, WebHelper]
config:
PhpBrowser:
url: '{YOUR APP'S URL}'
Codeception are executed with 'run' command
php codecept.phar run
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 Selenium2 module.
Suite acceptance started
Trying to ensure that frontpage works (WelcomeCept.php) - Ok
Suite functional started
Suite unit started
Time: 1 second, Memory: 21.00Mb
OK (1 test, 1 assertions)
Follow the Acceptance Testing chapter to learn how to test your web application by clicking links, filling forms, as your regular users do.