我已经安装了硒服务器并运行了它。我使用composer来安装phpunit-selenium和facebook(selenium插件)。
当我运行测试时,我收到相同的错误致命错误:找不到类XX驱动程序XX。
所有类都会发生这种情况。
我搜索了互联网,几乎没有关于蛋糕中硒的信息。
我的问题很简单。有没有人让硒与蛋糕一起工作。如果是这样,你是怎么做到的?
我正在使用wamp和cakephp3。
谢谢
enter code here
<?php
namespace App'Test'TestCase'Acceptance;
class UserSubscriptionTestFB extends PHPUnit_Framework_TestCase
{
/**
* @var RemoteWebDriver
*/
protected $webDriver;
public function setUp()
{
$this->webDriver = RemoteWebDriver::create('http://localhost:4444/wd/hub', DesiredCapabilities::firefox());
}
public function tearDown()
{
$this->webDriver->quit();
}
public function fillFormAndSubmit($inputs)
{
$this->webDriver->get('http://vaprobash.dev/');
$form = $this->webDriver->findElement(WebDriverBy::id('subscriptionForm'));
foreach ($inputs as $input => $value) {
$form->findElement(WebDriverBy::name($input))->sendKeys($value);
}
$form->submit();
}
public function testValidFormSubmission(array $inputs)
{
$this->fillFormAndSubmit($inputs);
$content = $this->webDriver->findElement(WebDriverBy::tagName('body'))->getText();
$this->assertEquals('Everything is Good!', $content);
}
}
看起来您没有指定Facebook网络驱动程序的完整路径。
<?php
namespace App'Test'TestCase'Acceptance;
use 'Facebook'WebDriver'Remote'DesiredCapabilities;
use 'Facebook'WebDriver'Remote'RemoteWebDriver;
use 'Facebook'WebDriver'WebDriverBy
class UserSubscriptionTestFB extends PHPUnit_Framework_TestCase
....