oleg-andreyev / MinkPhpWebDriver

Webdriver driver for Mink framework
MIT License
8 stars 9 forks source link

Exception thrown when outputting junit from Behat #83

Open mark-webster-catalyst opened 1 year ago

mark-webster-catalyst commented 1 year ago

This may or may not be an issue with mink-phpwebdriver, but I have to start somewhere.

When running behat tests with --format=junit, if a test fails, I'm getting the following exception:

Default exception handler: Exception - Call to a member function getPageSource() on null Debug: 
Error code: generalexceptionmessage
* line 456 of /vendor/oleg-andreyev/mink-phpwebdriver/src/WebDriver.php: Error thrown
* line 80 of /vendor/behat/mink/src/Exception/ExpectationException.php: call to OAndreyev\Mink\Driver\WebDriver->getContent()
* line 64 of /vendor/behat/mink/src/Exception/ExpectationException.php: call to Behat\Mink\Exception\ExpectationException->getContext()
* line ? of unknownfile: call to Behat\Mink\Exception\ExpectationException->__toString()
* line 102 of /vendor/behat/behat/src/Behat/Testwork/Exception/ExceptionPresenter.php: call to trim()
* line 57 of /vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitStepPrinter.php: call to Behat\Testwork\Exception\ExceptionPresenter->presentException()
* line 185 of /vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php: call to Behat\Behat\Output\Node\Printer\JUnit\JUnitStepPrinter->printStep()
* line 105 of /vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php: call to Behat\Behat\Output\Node\EventListener\JUnit\JUnitFeatureElementListener->printFeatureOnAfterEvent()
* line 47 of /vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/ChainEventListener.php: call to Behat\Behat\Output\Node\EventListener\JUnit\JUnitFeatureElementListener->listenEvent()
* line 47 of /vendor/behat/behat/src/Behat/Testwork/Output/Node/EventListener/ChainEventListener.php: call to Behat\Testwork\Output\Node\EventListener\ChainEventListener->listenEvent()
* line 90 of /vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php: call to Behat\Testwork\Output\Node\EventListener\ChainEventListener->listenEvent()
* line 230 of /vendor/symfony/event-dispatcher/EventDispatcher.php: call to Behat\Testwork\Output\NodeEventListeningFormatter->listenEvent()
* line 59 of /vendor/symfony/event-dispatcher/EventDispatcher.php: call to Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
* line 64 of /vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php: call to Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
* line 48 of /vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php: call to Behat\Testwork\EventDispatcher\TestworkEventDispatcher->bcAwareDispatch()
* line 90 of /vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php: call to Behat\Testwork\EventDispatcher\TestworkEventDispatcher->dispatch()
* line 64 of /vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php: call to Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->tearDown()
* line 73 of /vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php: call to Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test()
* line 75 of /vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php: call to Behat\Testwork\Hook\Tester\HookableSuiteTester->test()
* line 71 of /vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php: call to Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test()
* line 73 of /vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php: call to Behat\Testwork\Tester\Runtime\RuntimeExercise->test()
* line 80 of /vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php: call to Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test()
* line 149 of /vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php: call to Behat\Testwork\Ordering\OrderedExercise->test()
* line 108 of /vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php: call to Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications()
* line 63 of /vendor/behat/behat/src/Behat/Testwork/Cli/Command.php: call to Behat\Testwork\Tester\Cli\ExerciseController->execute()
* line 298 of /vendor/symfony/console/Command/Command.php: call to Behat\Testwork\Cli\Command->execute()
* line 1040 of /vendor/symfony/console/Application.php: call to Symfony\Component\Console\Command\Command->run()
* line 301 of /vendor/symfony/console/Application.php: call to Symfony\Component\Console\Application->doRunCommand()
* line 124 of /vendor/behat/behat/src/Behat/Testwork/Cli/Application.php: call to Symfony\Component\Console\Application->doRun()
* line 171 of /vendor/symfony/console/Application.php: call to Behat\Testwork\Cli\Application->doRun()
* line 34 of /vendor/behat/behat/bin/behat: call to Symfony\Component\Console\Application->run()
* line 119 of /vendor/bin/behat: call to include()

If tests pass, everything runs smoothly. This is in Moodle, which uses v1.2.1

oleg-andreyev commented 8 months ago

I don't think it's related to junit itself, looks like issue is Behat is trying to show content, but it looks like driver is killed.