Printing debug output to console in Codeception

前端 未结 6 620
花落未央
花落未央 2020-12-28 12:34

Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for

6条回答
  •  灰色年华
    2020-12-28 13:07

    See Debugging which says

    You may print any information inside a test using the codecept_debug function.

    And I'm using it in my *Cept class:

    codecept_debug($myVar);
    

    Your debug output is only visible when you run with --debug (-v doesn't show it, but -vv and -vvv do):

    codecept run --debug
    

    And the output looked like:

    Validate MyEntity table insert (MyCept) 
    Scenario:
    * I persist entity "AppBundle\Entity\MyEntity"
    
      AppBundle\Entity\MyEntity Object
      (
          [Id:AppBundle\Entity\MyEntity:private] => 1
          [Description:AppBundle\Entity\MyEntity:private] => Description
      )
    
     PASSED 
    

提交回复
热议问题