What are you trying to achieve?
Very similar to #6519:
When I do
codecept run
everything is green, but when I do
codecept run --coverage
I get an error. The exakt output is below.
There is also a file _output\App.Tests.Acceptance.HomepageCest.testIndexPage.fail.html, that only consists of on error message:
<html><head></head><body><br> <b>Fatal error</b>: Uncaught ErrorException: Warning: Cannot modify header information - headers already sent in D:\Apps\Apache\DSCA\c3.php:52 Stack trace: #0 D:\Apps\Apache\DSCA\c3.php(264): __c3_error() #1 D:\Apps\Apache\DSCA\c3.php(390): __c3_factory() #2 [internal function]: {closure}() #3 {main} thrown in <b>D:\Apps\Apache\DSCA\c3.php</b> on line <b>52</b><br> </body></html>
What do you get instead?
Provide console output if related. Use
-vvvmode for more details.
D:\Apps\Apache\DSCA>codecept run tests\acceptance\HomepageCest.php --coverage -vvv ==== Redirecting to Composer-installed version in vendor/codeception. You can skip this using --no-redirect ==== Codeception PHP Testing Framework v5.0.0 https://helpukrainewin.org App\Tests.acceptance Tests (1) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------Modules: WebDriver, \App\Tests\Helper\Acceptance, Asserts, \Sanitas\TestHelper\Module\ConfigHelper -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------⏺ Recording ⏺ step-by-step screenshots will be saved to D:\Apps\Apache\DSCA\tests/_output</info> Directory Format: record_62e930a5cdfb5_{filename}_{testname} ---- HomepageCest: Test index page Signature: App\Tests\Acceptance\HomepageCest:testIndexPage Test: tests\acceptance\HomepageCest.php:testIndexPage Scenario -- [GET] http://127.0.0.1:2777/ [Cookies] [{"name":"CODECEPTION_CODECOVERAGE","value":"{\"CodeCoverage\":\"testIndexPage\",\"CodeCoverage_Suite\":\"App\\\\Tests.acceptance\",\"CodeCoverage_Config\":null}","path":"/","domain":"127.0.0.1","expiry":1659535913,"secure":false,"httpOnly":false}] I am on page "/" [GET] http://127.0.0.1:2777/ [Cookies] [{"name":"CODECEPTION_CODECOVERAGE","value":"{\"CodeCoverage\":\"testIndexPage\",\"CodeCoverage_Suite\":\"App\\\\Tests.acceptance\",\"CodeCoverage_Config\":null}","path":"/","domain":"127.0.0.1","expiry":1659535913,"secure":false,"httpOnly":false}] Screenshot and page source were saved into 'D:\Apps\Apache\DSCA\tests/_output\' dir ERROR In LocalServer.php line 163: [RuntimeException] Code coverage file D:\Apps\Apache\DSCA\tests/_output\c3tmp/codecoverage.serialized does not exist Exception trace: at D:\Apps\Apache\DSCA\vendor\codeception\codeception\src\Codeception\Coverage\Subscriber\LocalServer.php:163 Codeception\Coverage\Subscriber\LocalServer->afterSuite() at D:\Apps\Apache\DSCA\vendor\symfony\event-dispatcher\EventDispatcher.php:230 Symfony\Component\EventDispatcher\EventDispatcher->callListeners() at D:\Apps\Apache\DSCA\vendor\symfony\event-dispatcher\EventDispatcher.php:59 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\src\Codeception\SuiteManager.php:150 Codeception\SuiteManager->run() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\src\Codeception\Codecept.php:260 Codeception\Codecept->runSuite() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\src\Codeception\Codecept.php:216 Codeception\Codecept->run() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\src\Codeception\Command\Run.php:442 Codeception\Command\Run->execute() at D:\Apps\Apache\DSCA\vendor\symfony\console\Command\Command.php:298 Symfony\Component\Console\Command\Command->run() at D:\Apps\Apache\DSCA\vendor\symfony\console\Application.php:1024 Symfony\Component\Console\Application->doRunCommand() at D:\Apps\Apache\DSCA\vendor\symfony\console\Application.php:299 Symfony\Component\Console\Application->doRun() at D:\Apps\Apache\DSCA\vendor\symfony\console\Application.php:171 Symfony\Component\Console\Application->run() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\src\Codeception\Application.php:112 Codeception\Application->run() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\app.php:45 {closure}() at D:\Apps\Apache\DSCA\vendor\codeception\codeception\app.php:46 require() at C:\Users\p.garstenauer\AppData\Roaming\Composer\vendor\codeception\codeception\autoload.php:13 require_once() at C:\Users\p.garstenauer\AppData\Roaming\Composer\vendor\codeception\codeception\app.php:3 require() at C:\Users\p.garstenauer\AppData\Roaming\Composer\vendor\codeception\codeception\codecept:7 run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--phpunit-xml [PHPUNIT-XML]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--shard SHARD] [--filter FILTER] [--grep GREP] [--bootstrap [BOOTSTRAP]] [--no-redirect] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--coverage-cobertura [COVERAGE-COBERTURA]] [--coverage-phpunit [COVERAGE-PHPUNIT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast [FAIL-FAST]] [--no-rebuild] [--seed SEED] [--no-artifacts] [--] [<suite> [<test>]]
Details
- Codeception version: 5.0.0
- PHP Version: 8.0.10
- Operating System: Windows
- Installation type: Composer
- List of installed packages (
composer show) - Suite configuration:
actor: AcceptanceTester modules: enabled: - WebDriver: url: 'http://127.0.0.1:2777/' browser: chrome window_size: 976x636 capabilities: "acceptInsecureCerts": true "goog:chromeOptions": args: ["--headless", "--disable-gpu", "--disable-extensions"] - \App\Tests\Helper\Acceptance - Asserts - \Sanitas\TestHelper\Module\ConfigHelper extensions: enabled: - Codeception\Extension\Recorder: delete_successful: true