PHPUnit&;硒
我有两个问题:PHPUnit&;硒,php,selenium,selenium-webdriver,phpunit,Php,Selenium,Selenium Webdriver,Phpunit,我有两个问题: 我已经在PHPUnit和Selenium中创建了很多测试用例,但我希望将它们作为一个组运行,而不是一次运行一个测试用例 在多个浏览器上运行它们的最佳方式是什么。我已经寻找了使用webdriver的例子,但不确定如何使用 我的两个测试用例是: 第一: } 第二: 您可以看看 拉动请求 如果所有测试都位于同一个目录中,那么请尝试使用目录名而不是文件名调用phpunit。Phpunit将在给定目录中查找*Test.php 2) 从setUp()函数中删除setHost()、setPor
public static $browsers = [
[
'host' => 'localhost',
'port' => 4444,
'browserName' => 'firefox'
],
[
'host' => 'localhost',
'port' => 4444,
'browserName' => 'chrome'
]
];
class AdminUserViewReqTabOptions extends PHPUnit_Extensions_Selenium2TestCase{
public function setUp()
{
$this->setHost('localhost'); // Set the hostname for the connection to the Selenium server.
$this->setPort(4444); // set port # for connection to selenium server
$this->setBrowser('firefox'); // set the browser to be used
$this->setBrowserUrl('http://www.example.com'); // set base URL for tests
}
public function testDisplayServer()
$this->url('index.php'); // Set the URL to test
// check for the existence of the strin 'All Open'
$this->assertRegExp( '/Server: Development/i', $this->source() );
}
}
public static $browsers = [
[
'host' => 'localhost',
'port' => 4444,
'browserName' => 'firefox'
],
[
'host' => 'localhost',
'port' => 4444,
'browserName' => 'chrome'
]
];