【发布时间】:2012-05-24 05:40:21
【问题描述】:
当我在 Netbeans IDE 或命令行中运行一个示例测试时,例如:
class WebTest extends PHPUnit_Extensions_Selenium2TestCase
{
protected function setUp()
{
$this->setBrowser('firefox');
$this->setBrowserUrl('http://www.example.com/');
}
public function testTitle()
{
$this->url('http://www.example.com/');
$this->assertEquals('Example WWW Page', $this->title());
}
}
我收到了 PHPUnit 响应,但它似乎没有与 Selenium 服务器通信,因为没有创建浏览器窗口。
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /var/www/gcd/framework/yii/gadget/protected/tests/phpunit.xml
F
Time: 1 second, Memory: 10.50Mb
There was 1 failure:
1) WebTest::testTitle
Failed asserting that null matches expected 'Example WWW Page'.
使用 PHPUnit 3.6.10 和 selenium-server-standalone-2.21.0
有人有什么想法吗?
【问题讨论】:
-
事实证明,如果你用 sudo 运行 PHPUnit,它就可以工作!哇!
标签: phpunit selenium-webdriver