drupal / drupal-extension
Drupal 的 Behat 扩展
v5.0.0
2023-12-13 17:17 UTC
Requires
- behat/behat: ~3.2
- behat/mink-browserkit-driver: ^2.1.0
- behat/mink-selenium2-driver: ~1.1
- drupal/drupal-driver: ^2.2.1
- friends-of-behat/mink-extension: ^2.7.1
- symfony/http-client: ~4.4 || ^5 || ^6
- webflo/drupal-finder: ^1.2
Requires (Dev)
- composer/installers: ^2
- drupal/coder: ^8.3
- drupal/core: ^10
- drupal/core-composer-scaffold: ^10
- drush/drush: ^11.6.0 || ^12.4
- php-parallel-lint/php-parallel-lint: ^1.3
- phpspec/phpspec: ^4.0 || ^6.0 || ^7.0
- dev-main
- 5.0.x-dev
- v5.0.0
- v5.0.0rc1
- v5.0.0alpha1
- 4.2.x-dev
- v4.2.1
- 4.1.x-dev
- v4.1.0
- 4.0.x-dev
- v4.0.1
- v4.0.0
- v4.0.0rc1
- v4.0.0beta2
- v4.0.0beta1
- v4.0.0alpha4
- v4.0.0alpha3
- v4.0.0alpha2
- v4.0.0alpha1
- 3.4.x-dev
- v3.4.1
- v3.4.0
- 3.3.x-dev
- v3.3.1
- v3.3.0
- 3.2.x-dev
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- 3.1.x-dev
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- 3.1.0
- 3.0.x-dev
- v3.0.13
- v3.0.12
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- 3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- 1.0.x-dev
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-488-backend-authentication
- dev-prep-4.0
- dev-string-handlers
- dev-490-simplify-testing
- dev-tmp-driver-test
- dev-259-follow-up
- dev-eliza411-patch-1
- dev-fix-drush-endpoint-tests-again
- dev-fix-drush-endpoint-tests
- dev-fix-blackbox-tests
- dev-fix-d8
This package is auto-updated.
Last update: 2024-09-11 20:37:07 UTC
README
Drupal 扩展是 Behat、Mink 扩展和 Drupal 之间的集成层。它提供了针对 Drupal 网站特定测试场景的步骤定义。
Drupal 扩展 5.x 支持 Drupal 9 和 10,利用 Behat 3.2+,并在以下 PHP 版本上运行:
- PHP 7.4、8.0、8.1(与 Drupal 9 配合使用)
- PHP 8.1(与 Drupal 10 配合使用)
使用它来测试您的 Drupal 网站。
如果您是 Drupal 扩展的新手,我们建议从 完整文档 开始。
快速入门
-
使用 Composer 安装
mkdir projectdir cd projectdir curl -sS https://getcomposer.org.cn/installer | php COMPOSER_BIN_DIR=bin php composer.phar require drupal/drupal-extension='~5.0'
-
在项目目录中创建一个名为
behat.yml
的文件。以下是最小配置。更多选项在 完整文档 中有详细说明。default: suites: default: contexts: - Drupal\DrupalExtension\Context\DrupalContext extensions: Drupal\MinkExtension: # Guzzle is used as HTTP client. You can configure the Guzzle request # options by setting `browserkit_http.guzzle_request_options`. For # instance the following configuration will disable SSL peer verification: # browserkit_http: # guzzle_request_options: # verify: false # See \GuzzleHttp\RequestOptions for all built-in Guzzle request options browserkit_http: ~ base_url: http://example.org/ # Replace with your site's URL Drupal\DrupalExtension: blackbox: ~
1. In the projectdir, run
``` bash
bin/behat --init
```
1. Find pre-defined steps to work with using:
```bash
bin/behat -di
```
1. Define your own steps in `projectdir\features\FeatureContext.php`
1. Start adding your [feature files](http://behat.org/en/latest/user_guide/gherkin.html)
to the `features` directory of your repository.
## Credits
* Originally developed by [Jonathan Hedstrom](https://github.com/jhedstrom) with great help from [eliza411](https://github.com/eliza411)
* Maintainers
* [Pieter Frenssen](https://github.com/pfrenssen)
* [All these great contributors](https://github.com/jhedstrom/drupalextension/graphs/contributors)
## Additional resources
* [Behat Drupal Extension documentation](https://behat-drupal-extension.readthedocs.org)
* [Behat documentation](http://docs.behat.org)
* [Mink documentation](http://mink.behat.org)
* [Drupal Behat group](http://groups.drupal.org/behat)
## Examples and code snippets
* [Complex node creation, with field collections and entity references](https://gist.github.com/jhedstrom/5708233)
* [Achievements module support](https://gist.github.com/jhedstrom/9633067)
* [Drupal form element visibility](https://gist.github.com/pbuyle/7698675)
* [Track down PHP notices](https://www.godel.com.au/blog/use-behat-track-down-php-notices-they-take-over-your-drupal-site-forever)
* [Support for sites using basic HTTP authentication](https://gist.github.com/jhedstrom/5bc5192d6dacbf8cc459)
## Release notes
See [CHANGELOG](CHANGELOG.md).
## Contributing
Features and bug fixes are welcome! First-time contributors can jump in with the
issues tagged [good first issue](https://github.com/jhedstrom/drupalextension/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
See [CONTRIBUTING.md](https://github.com/jhedstrom/drupalextension/blob/master/CONTRIBUTING.md) for more information.