Codeception with drupal

35 views Asked by At

I run codeception tests with drupal context but get this error

\#6 /var/www/html/vendor/symfony/console/Command/Command.php(326): Codeception\\Command\\DryRun-\>execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))

\#7 /var/www/html/vendor/symfony/console/Application.php(1078): Symfony\\Component\\Console\\Command\\Command-\>run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))

\#8 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application-\>doRunCommand(Object(Codeception\\Command\\DryRun), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))

\#9 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application-\>doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))

\#10 /var/www/html/vendor/codeception/codeception/src/Codeception/Application.php(112): Symfony\\Component\\Console\\Application-\>run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))

\#11 /var/www/html/vendor/codeception/codeception/app.php(45): Codeception\\Application-\>run()

\#12 /var/www/html/vendor/codeception/codeception/app.php(46): {closure}()

\#13 /var/www/html/vendor/codeception/codeception/codecept(7): require('/var/www/html/v...')

\#14 /var/www/html/vendor/bin/codecept(119): include('/var/www/html/v...')

\#15 {main}

Error: Call to a member function loggedIn() on null in Drupal\\DrupalExtension\\Context\\RawDrupalContext-\>loggedIn() (line 558 of /var/www/html/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php).

this 2 images provided by info running codeception tests
When login function called

enter image description here

I run
composer require guncha25/drupal-codeception --dev
vendor/bin/codecept dry-run Acceptance edit_package.feature
And I added

- DrupalBootstrap:
    root: '/mypath'
    server:
      SERVER_PORT: null
      REQUEST_URI: '/'
      REMOTE_ADDR: '127.0.0.1'
      HTTP_HOST: ''

I think that codeception does not initializeContext() and It is cause problem.
Maybe someone run codeception tests with drupal context

0

There are 0 answers