exozet / behat-utils
此包已被弃用且不再维护。未建议替代包。
`exozet/behat-utils` 提供了一些特性,以便使用 Behat 和 Mink 更容易地进行 API 测试。
0.8.1
2019-02-20 12:18 UTC
Requires
- behat/gherkin: *
- behat/mink: ^1.7
- phpunit/phpunit: ^7
README
exozet/behat-utils
提供了一些特性,以便使用 Behat 和 Mink 更容易地对网站和 web 服务进行测试。
使用方法
$ composer require exozet/behat-utils
并将
use \Exozet\Behat\Utils\Base\JsonApiSteps;
添加到您的上下文中,如下所示
class ServiceContext extends \Behat\MinkExtension\Context\MinkContext { use \Exozet\Behat\Utils\Base\JsonApiSteps; }
这样就完成了!
特性
JsonApiSteps
JsonApiSteps
对测试 JSON API 非常有帮助。
WebsiteInteractionSteps
WebsiteInteractionSteps
简化了基于 DOM 的网站交互。
SpinnedMinkSteps
SpinnedMinkSteps
允许在指定超时的情况下调用默认 MinkContext 步骤。
ConditionSteps
ConditionSteps
提供了仅在特定条件下继续测试执行的步骤,否则标记测试为“挂起”。
HelpUtils
HelpUtils
提供了一些辅助函数,可以在定义自己的步骤时使用。
behat-utils 开发
如果您想对这些实用程序进行开发,请使用 chromedriver 并按如下方式运行
$ chromedriver --whitelisted-ips='*'
然后使用嵌入的 docker-compose.yml 并按如下方式运行 php-cli
$ docker-compose run --rm php-cli www-data $ bash setup-dev.sh www-data $ vendor/bin/behat -p local www-data $ ./vendor/bin/phpunit --bootstrap vendor/autoload.php --testdox tests
许可证
behat-utils 版权所有 Exozet (http://exozet.com),并按照 MIT 许可证的条款进行许可。