在Laravel 5.2发布之前,Laracasts的集成软件包为Laravel提供了Selenium集成.我找不到5.2版本的任何类似软件包.有没有?如何将硒测试与Laravel集成?
我见过这些链接,他们没有提供任何解决方案:
Selenium and Laravel 5.2
Has anyone tried Laravel Integrated package in Laravel 5.2?
解决方法
PHPUnit本身有一个
selenium extension.它不是很平坦,并没有现代WebDriver接口的支持.
CodeCeption是一个非常强大且易于使用的PHP测试工具.它不仅提供单元测试API,还提供自己的selenium acceptance testing API.
它还具有完美的Laravel integration和一个很棒的chrome extension,用于在浏览器中生成验收测试.这是来自文档的示例代码:
<?PHP $I->amOnPage('/login'); $I->fillField('username','davert'); $I->fillField('password','qwerty'); $I->click('LOGIN'); $I->see('Welcome to codeception!');
以下是使用CodeCeption开始验收测试的分步指南:
http://codeception.com/11-20-2013/webdriver-tests-with-codeception.html
以下是一些其他选项:
https://github.com/lmc-eu/steward
https://github.com/Modelizer/Selenium
https://github.com/jhoopes/laravel-selenium-driver
更新:Good news.
更新:见Mink’s PHPUnit integration.