【发布时间】:2016-02-04 18:30:04
【问题描述】:
我已经扩展了“test.fail”(如http://codeception.com/docs/08-Customization 的扩展部分所示)方法,我想将一些调试行直接打印到 HTML 报告中,但我无法使用相同的 comment() 方法当我在 Cest 测试中时,这是可能的。
我想使用类似的东西:
comment("TEST FailEvent!");
而不是
codecept_debug("TEST FailEvent!");
在下面的代码中:
class MyCustomTestEventHandler extends \Codeception\Extension
{
public static $events = array(
'test.before' => 'beforeTest',
'test.fail' => 'testFailed'
);
public function beforeTest(\Codeception\Event\TestEvent $e) { }
public function testFailed(\Codeception\Event\FailEvent $e) {
codecept_debug("TEST FailEvent!");
}
}
【问题讨论】:
标签: php automated-tests customization codeception