How to write debug info on screen?
-
26-12-2019 - |
Question
I'm writing a test that's not working like I expect.
I need to use some grabbers and then dump to the screen while test is running.
How I can do this ? How do echo, NOT how user grabber; I'm able to use grabbers but I don't know how to echos while test is running.
Solution
There is no specific command to print to screen / terminal while running a test.
I do the following:
$I->see($I->grabTextFrom('#myelement'));
This way I can at least dump the contents of a element.
Check this out. I haven't tried this one yet, but looks promising
OTHER TIPS
Today I've found that in Codeception v2.01 there is a new method that allows you to print to screen.
<?php
codecept_debug($I->grabTextFrom('#name'));
?>
add the --debug flag to your command you use to run your tests with. eg.
php codecept.phar run --debug --steps acceptance
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow