Allows 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.
paths:tests :tests# where the tests storeddata :tests/Support/Data# directory for fixture datasupport:tests/Support# directory for support codeoutput :tests/_output# directory for outputenvs :tests/_envs# directory for environment configuration
Provide 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 and lint option that toggles parsing a test file (using php -l) before loading it.
Syntax example:
settings:colors:true
Possible settings:
backup_globals: true: Controls whether PHPUnit attempts to backup global variables, see https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.backupGlobals
be_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-manipulation
colors: true: By default this is false on Windows. Use ANSICON to colorize output.
convert_deprecations_to_exceptions: false Converts E_DEPRECATED and E_USER_DEPRECATED events to exceptions. Introduced in Codeception 4.2.0
disallow_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-execution
editor_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):
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. For PHP < 8.4 E_ALL & ~E_STRICT & ~E_DEPRECATED is used by default.
memory_limit: 1024M: Tests (especially functional) can take a lot of memory. We set a high limit for them by default.
lint: true: Enable/disable syntax of test files before loading. For PHP < 7 exec('php -l') is used. Disable if you need to speed up tests execution.
log_incomplete_skipped: false: Log the incomplete and skipped tests into junit report ,see https://phpunit.de/manual/current/en/appendixes.configuration.html Section logging > junit
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-tests
shuffle: true: Randomize test order
strict_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 CI
Suite Configuration: 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:
actor
Name of the “Actor” class of the current suite.
bootstrap
Bootstrap script that will be executed before current suite. A script should be put into suite directory.
error level for runner in the current suite. Can be specified for unit, integration, functional tests. Passes value to error_reporting function.
extends
Allows 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.
groups with the list of tests of for corresponding group.
formats
formats with the list of extra test format classes.
modules
List of enabled modules with their configuration.
modules:enabled:-PhpBrowser:# built-in modules are listed by their namesurl:http://localhost# module configuration-Db# Module without configuration (or inherited from `codeception.yml`)-\Helper\Acceptance# helper names are listed by their class names, starting with `\`# Additional modules configuration; can be used for modules which are not currently enabledconfig:WebDriver:browser:firefoxdisabled:-WebDriver# modules disabled for this suite
namespace
Default namespace of actor, support classes and tests.
suite_namespace
Default namespace for new tests of this suite (ignores namespace option)
Configuration Templates: *.dist.yml
To 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.
Configuration loading order:
codeception.dist.yml
codeception.yml
Acceptance.suite.dist.yml
Acceptance.suite.yml
environment config
Don't know how to write tests on your own? We will build or improve them for you.
Request a quote for official
enterprise
support or trainings
You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.