使用 phpunit 3.5.13 和 seleniumRC 运行 PHPUnit 测试后生成报告并发送电子邮件通知
我对 PHPUnit 测试和 seleniumRC 仍然很陌生,但我已经设法让它们都工作,所以现在我想知道是否可以在测试失败并在每次测试运行后通过时发送电子邮件。邮件应该发送给开发人员和测试经理。可以这样做吗?如果能够生成一份完整的报告并将其发送给所有测试结果,那就太好了。有人可以给我一个正确的方向,我可以遵循该方向来解决这个问题。
先感谢您 达~~
I'm still new to PHPUnit Testing and seleniumRC, but i have managed to get them both working, so now i was wondering if it is possible to sent out an email when the test fails and passes after every test is run. the mail should go to the developer and the testing manager. is it possible to do that? and it would be very nice to generate a whole report and sent it out on all the test results. can someone please give me a proper direction which i can follow on how to get around this.
Thank you in advance
D~~
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有几种选择。对于一个小项目,可能是一个简单的 php 脚本,它将 phpunit 输出重定向到一个文件,对其进行解析并采取相应的操作。 ob_start() 也可以成为您完成此任务的朋友。
进入更复杂的选项,您还可以考虑使用几个 phing 任务来实现此目的。然后,最后但并非最不重要的一点是,圣杯:对于大多数构建任务都非常灵活,而且最重要的是自动化 ->研究持续集成工具,例如 jenkins。
对于小型的单人团队项目,我选择最简单的。
You have a few options available. For a small project, maybe a plain php script that redirects phpunit output to a file, parses it and acts accordingly. ob_start() could also be your friend for this task.
Getting into more complicated options, you could look also into using a couple of phing tasks for this. Then, last but not least, the holy-grail: very flexible for most any build tasks and best of all automated -> look into continuous integration tools such as the jenkins.
For small one-man team projects I opt for the simplest.