edmondscommerce / behat-framework
初始behat框架
Requires
- behat/behat: ~3.3
- behat/mink: ~1.6
- behat/mink-extension: ~2.0
- behat/mink-selenium2-driver: ~1.2
- edmondscommerce/selenium-server: ~1
Suggests
- edmondscommerce/behat-chrome-performance-context: Measure various performance settings from Chrome (i.e ttfb)
- edmondscommerce/behat-error-detection-context: Detect various types of errors, including PHP fatal errors and W3C validation issues
- edmondscommerce/behat-error-handling-context: Provides utilities to pause on error and to take screenshots at time of error
- edmondscommerce/behat-faker-context: Parent framework, allows easier behat setup
This package is auto-updated.
Last update: 2024-08-29 04:14:28 UTC
README
由Edmonds Commerce提供
一个易于启动并运行的Behat 3测试框架,包括基于Chrome的移动和平板电脑测试
第一步 - 创建或更新你的Composer依赖项
模板composer.json(复制粘贴)
对于一个新的测试项目,只需创建一个composer.json文件,并粘贴以下内容
{
"require": {
"edmondscommerce/behat-framework": "dev-master",
"edmondscommerce/behat-faker-context": "dev-master",
"edmondscommerce/behat-chrome-performance-context": "dev-master",
"edmondscommerce/behat-error-detection-context": "dev-master",
"edmondscommerce/behat-screenshot-context": "dev-master",
"edmondscommerce/behat-error-handling-context": "dev-master",
"edmondscommerce/behat-html-context": "0.0.1",
"edmondscommerce/behat-javascript-context": "dev-master",
"edmondscommerce/behat-mouse-context": "dev-master"
},
"config": {
"bin-dir": "bin/"
}
}
然后安装依赖项。
composer install --prefer-source
或添加到现有项目
在composer.json中设置bin目录
"config": {
"bin-dir": "bin/"
}
然后运行此命令以添加到composer.json并安装
composer require edmondscommerce/behat-framework dev-master --prefer-source
第二步 - 复制Behat配置文件
功能
cp -R vendor/edmondscommerce/behat-framework/features .
然后您可以添加所需的特性和自定义上下文。
Behat配置
cp vendor/edmondscommerce/behat-framework/behat.dist ./behat.yaml
您可能需要根据需求编辑此文件,但这是一个很好的起点。
第三步 - 添加其他上下文
有多个软件包可供选择,它们可以提供更多功能来补充框架。
我们创建了一些以供您开始使用
通用上下文
[https://github.com/edmondscommerce/behat-chrome-performance-context]
[https://github.com/edmondscommerce/behat-error-handling-context]
[https://github.com/edmondscommerce/behat-error-detection-context]
[https://github.com/edmondscommerce/behat-faker-context]
[https://github.com/edmondscommerce/behat-html-context]
[https://github.com/edmondscommerce/behat-javascript-context]
[https://github.com/edmondscommerce/behat-mouse-context]
[https://github.com/edmondscommerce/behat-screenshot-context]
平台上下文
[https://github.com/edmondscommerce/behat-magento-one-context]
[https://github.com/edmondscommerce/behat-magento-2-context]
[https://github.com/edmondscommerce/behat-prestashop-context]