I am implementing a custom tests methodand I can not write text message in console. I need to show in the console log the number found DOM elements. How can I display the text to the console? Thanks.
I found solution to write the message to the console in AcceptanceHelper:
$output = new \Codeception\Lib\Console\Output([]);
$output->writeln('I see NN elements');
Perhaps this is not the right way.. What do you think?
There is much easier debug method. It can be called from helper as $this->debug() or anywhere using codecept_debug function.
To see the output you should run tests with --debug option
Actually, I needed a method comment):
$I->comment('⚑ A simple way to display a message to the console ☺');
Thank you for your support.
@Sorbing, thanks for a solution, I adopted it and use widely. Unlike codecept_debug, it works everywhere. :-)
@Sorbing thanks! I use your idea in log() method: https://github.com/it-for-free/rusphp/blob/master/Testing/Codeception/Acceptance/IFFAcceptanceTester.php
Most helpful comment
I found solution to write the message to the console in AcceptanceHelper:
Perhaps this is not the right way.. What do you think?