entanet / entanet-behat
一个帮助Entanet质量保证部门使用Behat自动化功能的软件包。
v3.0.2
2020-02-24 12:23 UTC
Requires
- php: ^7.1.3
- behat/behat: ^3.5
- behat/mink: ^1.7
- behat/mink-extension: ^2.3
- behat/mink-selenium2-driver: ^1.2
- doctrine/dbal: ^2.9
- entanet/laravel-pubsub: ^4.0
- imbo/behat-api-extension: ^2.1
- laracasts/behat-laravel-extension: ^1.1
- mockery/mockery: ^1.0
- phpunit/phpunit: >=6.0
- superbalist/php-pubsub: ^2.0.0
- dev-master
- v3.0.2
- v3.0.1
- v3.0.0
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/doctrine/dbal-3.1.4
- dev-package-updates-versioning
- dev-laravel-7-compatibility
- dev-laravel6compatibility
- dev-pubsubComposer
- dev-additional-snippets
- dev-LoadTesting
This package is auto-updated.
Last update: 2024-09-22 01:28:38 UTC
README
本软件包专门为Entanet的软件质量保证部门设计,以帮助自动化功能。
安装
需要安装entanet behat软件包
composer require entanet/entanet-behat --dev
将以下内容添加到config/app.php的providers数组中
Superbalist\LaravelPubSub\PubSubServiceProvider::class
发布Behat环境和YAML文件
php artisan vendor:publish --provider="Entanet\Behat\BehatServiceProvider"
检查可用的命令
vendor/bin/behat -dl
使用方法
目录
运行
数据库
Kafka
管道套件
这包括Kafka、数据库和API测试。作为部署管道的一部分运行。失败的测试将中断构建。所有具有pubsub的artisan命令将在每个场景中自动运行。
vendor/bin/behat --suite=pipeline
用户界面套件
这包括用户界面测试。在本地运行,不在管道内。
vendor/bin/behat --suite=ui
插入一行
用行填充数据库
Given I have the following in the "users" table | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com |
检查一行是否存在
在运行一些代码后检查一行是否存在
Then I should have the following in the "users" table | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com |
发布一个事件
向一个主题发布一个事件
When The following events are published to "user-created" | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com |
检查一个事件
检查是否已创建一个事件
Then The following events should be published to "user-created" | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com |
示例
消费一个事件并检查数据库中是否存在一行
Feature: Store a person in the database In order to manipulate people in this application As people are created in other systems We will need to listen people events and store them in the database Scenario: Listen to person created event and store in the people table When The following events are published to "user-created" | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com | Then I should have the following in the "users" table | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com |
消费一个事件并检查是否已发布另一个事件
Feature: Store a person in the database In order to manipulate people in this application As people are created in other systems We will need to listen people events and store them in the database Scenario: Listen to person created event and store in the people table When The following events are published to "user-created" | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com | Then I should have the following in the "users" table | name | email | | Tom | tomos.lloyd@cityfibre.com | | Ryan | ryan.ralphs@cityfibre.com |