使用Yii进行样本功能测试时出错

时间:2010-10-20 10:54:35

标签: php selenium yii functional-testing

最近我发现了Yii框架并开始学习它。我使用 yiic 工具生成了应用程序框架,安装了PHPUnit,SeleniumRC并尝试运行骨架应用程序提供的功能测试(我没有更改任何内容)。

> phpunit functional/SiteTest.php

报告说:

There was 1 error:
1) SiteTest::testLoginLogout
PHPUnit_Framework_Exception: Response from Selenium RC server for testComplete().
ERROR: Element link=Logout not found.

我发现有一个“退出(演示)”链接,而不仅仅是“退出”。如果我在测试用例中更改php代码,则所有测试都通过。这是Yii开发人员的错误还是我错过了什么?

1 个答案:

答案 0 :(得分:1)

Yii 1.1.6修复了这个错误。

if($this->isTextPresent('Logout'))
    $this->clickAndWait('link=Logout');