在 Laravel 5.2 发布之前,Laracasts 的集成包为 Laravel 提供了 Selenium 集成。我找不到 5.2 版本的任何类似包。有没有?如何将 selenium 测试与 Laravel 集成?
我看过这些链接,它们没有提供任何解决方案:
Selenium and Laravel 5.2
Has anyone tried Laravel Integrated package in Laravel 5.2?
最佳答案
PHPUnit 本身有一个 selenium extension .它不是很 laravelish,也没有现代 WebDriver 接口(interface)的支持。
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 .
关于Laravel 5.2+ 的 PHPUnit Selenium 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40566863/