Testomatio - Test Management for Codeception
codeception.ymlThe global configuration file codeception.yml is generated by the codecept bootstrap command. Alphabetical list of options:
actor_suffixSets the suffix for “Actor” classes. Default: Tester. If you set it to Ninja and generate a new api test suite, you will get an ApiNinja actor class.
bootstrapBootstrap script that will be executed before all suites. A script should be put into tests directory.
coverageCodeCoverage settings.
extendsAllows you to specify a file (relative to the codeception.yml file) that holds some already pre-defined values. This can be used to always use the same configuration for modules or whatever.
extensionsAllows to enable and configure Codeception extensions, Group Objects, and Custom Commands.
gherkinincludeInclude additional Codeception configurations for multiple applications setup.
modulesAllows to create shared module configuration for all included suites.
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/Support/Data/dump.sqlnamespaceSets the namespace under which all new tests and support classes will be generated. Allows to configure multiple test setups for one runner.
paramsAllows to pass external parameters into module configuration.
pathsDirectories used by Codeception. Default values:
paths:
tests : tests # where the tests stored
data : tests/Support/Data # directory for fixture data
support: tests/Support # directory for support code
output : tests/_output # directory for output
envs : tests/_envs # directory for environment configurationreportersNo longer supported since Codeception 5: a warning is printed if this option is set. Custom reporters must be implemented as extensions.
settingsProvide additional options for the test runner. They may dramatically change the way Codeception is executed. For instance, take a note of shuffle option which allows to randomize tests execution order.
Syntax example:
settings:
colors: truePossible settings:
backup_globals: true: Controls whether PHPUnit attempts to backup global variables, see https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.backupGlobalsbe_strict_about_changes_to_global_state: false: PHPUnit can be strict about tests that manipulate global state, see https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.global-state-manipulationcolors: true: Colorize console output. On older Windows consoles you may need ANSICON to display colors.convert_deprecations_to_exceptions: false Converts E_DEPRECATED and E_USER_DEPRECATED events to exceptions. Introduced in Codeception 4.2.0disallow_test_output: false: PHPUnit can be strict about output during tests, see https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.output-during-test-executioneditor_url: 'atom://core/open/file?filename=%%file%%&line=%%line%%': In the console output, the test runner will replace all references to files with “clickable” URL’s, allowing you to open the file directly in your IDE. Depending on your operating system, you may have to set up an appropriate uri handler. Syntax for some common editors (same as in PHPStan):
'phpstorm://open?file=%%file%%&line=%%line%%''vscode://file/%%file%%:%%line%%''atom://core/open/file?filename=%%file%%&line=%%line%%'error_level: E_ALL & ~E_DEPRECATED: Set the error_reporting level. You can specify either a predefined constant or an integer value, see https://www.php.net/manual/en/function.error-reporting.php and https://www.php.net/manual/en/errorfunc.constants.php. E_STRICT is deprecated as of PHP 8.4: remove it from your error_level if you still reference it, to avoid a deprecation notice.memory_limit: 1024M: Tests (especially functional) can take a lot of memory. We set a high limit for them by default.report_useless_tests: false: PHPUnit can be strict about tests that do not test anything, see https://phpunit.de/manual/current/en/risky-tests.html#risky-tests.useless-testsshuffle: false: Set to true to randomize test orderstrict_xml: false: Generate XML JUnit report using strict schema. Avoid putting additional report fields like steps or scenario names to it. Required for XML reports on Jenkins CIsupport_namespaceNamespace of support classes (actors, helpers, page objects, step objects etc.), relative to namespace. codecept bootstrap sets it to Support, so actors are generated as Tests\Support\AcceptanceTester.
Unit.suite.yml, Functional.suite.yml etc.Each suite has its own configuration inside the directory set by paths: tests: in codeception.yml. Alphabetical list of options:
actorName of the “Actor” class of the current suite.
bootstrapBootstrap script that will be executed before current suite. A script should be put into suite directory.
coveragePer suite CodeCoverage settings.
envOverride any configuration per environment.
error_levelerror level for runner in the current suite. Can be specified for unit, integration, functional tests. Passes value to error_reporting function.
extendsAllows you to specify a file (relative to *.suite.yml) that holds some already pre-defined values. This can be used to always use the same configuration for modules or whatever.
gherkinPer suite Gherkin settings.
groupsgroups with the list of tests of for corresponding group.
formatsformats with the list of extra test format classes.
modulesList of enabled modules with their configuration.
modules:
enabled:
- PhpBrowser: # built-in modules are listed by their names
url: http://localhost # module configuration
- Db # Module without configuration (or inherited from `codeception.yml`)
- \Tests\Support\Helper\Acceptance # helper names are listed by their class names, starting with `\`
# Additional modules configuration; can be used for modules which are not currently enabled
config:
WebDriver:
browser: firefox
disabled:
- WebDriver # modules disabled for this suitenamespaceDefault namespace of actor, support classes and tests.
shuffleSet to true to randomize the execution order of tests in the current suite.
step_decoratorsList of step decorators used to generate additional actions in the actor class. Set to ~ to disable them.
step_decorators:
- Codeception\Step\ConditionalAssertion
- Codeception\Step\TryTo
- Codeception\Step\Retrysuite_namespaceNamespace of the tests of this suite. It is always computed as namespace + \ + suite name (e.g. Tests\Acceptance), so a value set in the suite config is ignored.
*.dist.ymlTo provide the same configuration template for your development team, you can create a codeception.dist.yml config file, which will be loaded before codeception.yml. The dist config provides shared options, while local codeception.yml files override them on a per-installation basis. Therefore, codeception.yml should be ignored by your VCS system.
Config templates can also be used for suite configuration, by creating a <SuiteName>.suite.dist.yml file (e.g. Acceptance.suite.dist.yml).
Configuration loading order:
codeception.dist.ymlcodeception.ymlAcceptance.suite.dist.ymlAcceptance.suite.yml