简体   繁体   English

Zend_Test_PHPUnit与Selenium

[英]Zend_Test_PHPUnit versus Selenium

I have used Zend_Test_PHPUnit before for integration tests and it was great. 我之前曾使用Zend_Test_PHPUnit进行集成测试,这很棒。 I could configure a request object and fire it off, and run asserts against the results, including using CSS selectors. 我可以配置一个请求对象并将其触发,并针对结果运行断言,包括使用CSS选择器。

How does Selenium compare to this? 硒与此相比如何? And what overlap is there between the two options? 两种选择之间有什么重叠?

I realise that Selenium will give me browser-specific tests, but are there other advantages? 我意识到Selenium将为我提供针对浏览器的测试,但是还有其他优势吗?

One big advantage is that you are testing also javascript, including ajax calls. 一大优势是您还可以测试javascript,包括ajax调用。 Web page can be pretty complex piece of code and not always is enough to test just plain html, you need to check how styles been applied, how page was rendered. 网页可能是相当复杂的代码,并且并不总是足以测试纯HTML,您需要检查样式的应用方式,页面的呈现方式。

Selenium tests in this case I would rather call functional tests or if you like black-box testing, using Selenium IDE , tests can be recorder by somebody who is not developer, but knows how application should work. 在这种情况下,Selenium测试我宁愿称为功能测试,或者如果您喜欢使用Selenium IDE进行黑盒测试,可以由不是开发人员但知道应用程序应该如何工作的人来记录测试。

Disadvantage is that tests can take a bit longer to run. 缺点是测试可能需要更长的时间才能运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM