Codeception / Codeception

Full-stack testing PHP framework
http://codeception.com
MIT License
4.76k stars 1.3k forks source link

Innerbrowser exception trying to run test #6371

Closed kingofwe86 closed 2 years ago

kingofwe86 commented 2 years ago

What are you trying to achieve?

Trying to execute a simple functional test that does nothing. Acceptance Tests and Unit Tests work properly.

What do you get instead?

Provide console output if related. Use -vvv mode for more details.

php vendor/bin/codecept run functional --steps
Codeception PHP Testing Framework v4.1.29
Powered by PHPUnit 9.5.14 by Sebastian Bergmann and contributors.

Functional Tests (1) ---------------------------------------------------------------------------------------------------------------------------------------
LoginCest: Try login
Signature: LoginCest:tryLogin
Test: tests/functional/LoginCest.php:tryLogin
Scenario --
------------------------------------------------------------------------------------------------------------------------------------------------------------
PHP Fatal error:  Uncaught Error: Typed property Codeception\Module\Laravel::$client must not be accessed before initialization in /var/www/vs-workspace/pa/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php:77
Stack trace:
#0 /var/www/vs-workspace/pa/vendor/codeception/codeception/src/Codeception/Subscriber/Module.php(77): Codeception\Lib\InnerBrowser->_failed()
#1 /var/www/vs-workspace/pa/vendor/symfony/event-dispatcher/EventDispatcher.php(230): Codeception\Subscriber\Module->failed()
#2 /var/www/vs-workspace/pa/vendor/symfony/event-dispatcher/EventDispatcher.php(59): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#3 /var/www/vs-workspace/pa/vendor/codeception/phpunit-wrapper/src/DispatcherWrapper.php(22): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#4 /var/www/vs-workspace/pa/vendor/codeception/phpunit-wrapper/src/Listener.php(134): Codeception\PHPUnit\Listener->dispatch()
#5 /var/www/vs-workspace/pa/vendor/codeception/phpunit-wrapper/src/Listener.php(51): Codecepti in /var/www/vs-workspace/pa/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php on line 77

FATAL ERROR. TESTS NOT FINISHED.
Uncaught Error: Typed property Codeception\Module\Laravel::$client must not be accessed before initialization in /var/www/vs-workspace/pa/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php:77
Stack trace:
#0 /var/www/vs-workspace/pa/vendor/codeception/codeception/src/Codeception/Subscriber/Module.php(77): Codeception\Lib\InnerBrowser->_failed()
#1 /var/www/vs-workspace/pa/vendor/symfony/event-dispatcher/EventDispatcher.php(230): Codeception\Subscriber\Module->failed()
#2 /var/www/vs-workspace/pa/vendor/symfony/event-dispatcher/EventDispatcher.php(59): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#3 /var/www/vs-workspace/pa/vendor/codeception/phpunit-wrapper/src/DispatcherWrapper.php(22): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#4 /var/www/vs-workspace/pa/vendor/codeception/phpunit-wrapper/src/Listener.php(134): Codeception\PHPUnit\Listener->dispatch()
#5 /var/www/vs-workspace/pa/vendor/codeception/phpunit-wrapper/src/Listener.php(51): Codecepti 
in /var/www/vs-workspace/pa/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php:77

Provide test source code if related


<?php

class LoginCest
{
    public function tryLogin(FunctionalTester $I)
    { 
    }
}

Details

paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
actor_suffix: Tester
extensions:
    enabled:
        - Codeception\Extension\RunFailed
kingofwe86 commented 2 years ago

It was a false positive. .env.testing configuration was missing and default APP_URL was configured as null. I close it. Thanks.