开发者

selenium vs phpunit/lime? [closed]

开发者 https://www.devze.com 2022-12-29 02:28 出处:网络
Closed. This question is op开发者_如何学Cinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citatio
Closed. This question is op开发者_如何学Cinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 9 years ago.

Improve this question

I have seen the power of Selenium and that it can give you the tests in different languages.

So the question is, why should I use PHPUnit or Lime (for Symfony) when a solution like Selenium is available?

Isn't it time-consuming to write all the tests by hand, when you can just use Selenium?


phpunit and selenium do not test the same things phpunit test a unit of code selenium is designed for testing integration/functional testing of several modules together.

I think you need both types of tests. phpunit for unit testing and selenium for interface testing. The phpunit manual even explains how to integrate the two.

http://www.phpunit.de/manual/3.6/en/selenium.html

Also this article explains the purpose of both. http://software-testing-zone.blogspot.com/2007/01/unit-testing-versus-functional-tests.html

I understand the desire to use selenium for everything it seems so simple, you can just click and write a test, but it really is a a case of needing both. You may want to pick up a copy of "Expert PHP 5 Tools"

http://www.amazon.com/Expert-PHP-Tools-Dirk-Merkel/dp/1847198384/ref=sr_1_1?ie=UTF8&s=books&qid=1273111115&sr=8-1

It covers the different types of tests and their use quite well.


Well in the case of sf+lime there is some good integration directly in the framework. And lime is so simple that tests take little time to write at all. Personally i prefer phpunit, but when i use symfony i just stick with lime because its the path of least resistance and sppeds things up. There is/was a php unit plugin for sf but ive never used it - i figured why bother. Now for other non-sf projects i use phpunit when needed simply because its no more difficult than hooking up lime.

0

精彩评论

暂无评论...
验证码 换一张
取 消