Create a Codeception project

Integration tests should be separated from your main project and stored in new repository. The repository can contain several test projects.

Firstly you need to create an empty project and install Codeception via Composer:

$ composer require "codeception/codeception"

Suppose the system name of the first project is "MyTests":

  1. Create directory "projects/MyTests/" in the root.

  2. Initialize an empty Codeception project with namespace "MyTests" in that directory:

    ./vendor/bin/codecept bootstrap -e --namespace MyTests projects/MyTests
  3. Create the first suite:

    ./vendor/bin/codecept generate:suite -c projects/MyTests functional Functional
  4. Add necessary modules to functional.suite.yml file. It will look like:

    class_name: FunctionalTester
    modules:
        enabled:
            - \MyTests\Helper\Functional
            - WebDriver:
                url: 'http://myproject.local'
                browser: phantomjs
                window_size: 1280x960
            - Asserts
  5. Generate support classes for added modules:

    ./vendor/bin/codecept build -c projects/MyTests
  6. That's it. Now you can create your first test and run it:

    ./vendor/bin/codecept generate:cest -c projects/MyTests functional FirstTest
    ./vendor/bin/codecept run -c projects/MyTests functional FirstTestCest:tryToTest --steps

On GitHub you can find an example of repository with tests.