单元测试网站 [英] Unit Testing a Website

查看:100
本文介绍了单元测试网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想知道其他开发人员如何测试他们的网站。 PHP在我的情况下,但这可能跨越多种语言。我已经在一个网站上工作了一年多了,我真的想自动化很多的版本之间的回归测试。

I'm curious to see how other developers go about testing their web sites. PHP specifically in my case, but this probably spans multiple languages. I've been working on a site for over a year now, and I'd really like to automate a lot of the regression testing I do between versions.

网站在CodeIgniter,所以我有一些测试我的模型。我想要超越只是测试那些。但是,这是一个问题,即使非MVC开发人员不得不解决我相信。

This specific site is in CodeIgniter, so I have some tests for my models. I'd like to move beyond just testing those though. However, this is an issue even non-MVC developers have had to tackle I'm sure.

编辑:满足我的很多我的测试期望是能力断言参数在脚本处理结束时具有特定的值。在我的情况下,很多逻辑是在控制器,这是我想测试的主要领域。

I think the functionality that would satisfy a lot of my test desires is the ability to assert that paramters have a specific value at the end of the script processing. In my case a lot of logic is in the controller, and that's the main area I'd like to test.

推荐答案

实际单元测试没有测试UI,你应该只是测试模型中的功能。大多数功能应该在那里。

For actual unit testing without testing the UI, you should just test the functions in the model. Most of your functionality should be in there anyways.

您可能需要查看 Selenium 测试您的网站的UI。它可以记录您的操作并回放,或者您可以直接编辑脚本。

You might want to have a look at Selenium for testing the UI of your site. It can record your actions and play them back, or you can edit the scripting directly.

这篇关于单元测试网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆