drupal-operations/drush-behat-params

为behat预配置BEHAT_PARAMS的Drush命令包装器。


README

一个基本的drush插件,它使用自动设置的URL、根和drush别名调用behat并带有BEHAT_PARAMS

img.png

用法

  1. 使用composer安装

    composer require operations/drush-behat-params`
    
  2. 使用drush运行

    drush behat
    

    或者

    drush @alias behat
    

确保DRUSH_OPTIONS_URI值已设置,以便behat测试正确的URL。

注意:为了在Lando上轻松设置DRUSH_OPTIONS_URI,请参阅https://github.com/operations-platform/drupal-settings

远程别名

您可以使用此命令通过Drush Site Aliases从本地运行远程站点的测试。

例如,如果您有一个名为@test的别名,您可以通过以下方式在其上运行behat测试

    $ drush @dev behat
    ------------- ---------------------------------------- -----------
    Drush Alias   URL                                      Root
    ------------- ---------------------------------------- -----------
    @self         test-projectcode.pantheonsite.io          /code/web
    ------------- ---------------------------------------- -----------
    ....

是什么?

Behat使用硬编码的配置或BEHAT_PARAMS中的JSON blob来配置要测试的网站。

而不是与ENV变量纠缠,此插件使用Drush别名信息为您设置BEHAT_PARAMS。

开发

此工具是Drupal Operations Project的一部分。

源代码维护在https://git.drupalcode.org/project/operations/-/tree/1.x/drush/Commands/contrib/drush-behat-params

可以在https://www.drupal.org/project/issues/operations?categories=All提交问题。