operations/drush-behat-params

Drush 命令包装器,用于 behat 并预配置 BEHAT_PARAMS。


README

一个基本的 drush 插件,它会自动设置 URL、root 和 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 站点别名从本地运行远程站点的测试。

例如,如果您有一个名为 @test 的别名,您可以这样运行您的 behat 测试

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

是什么?

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

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

开发

此工具是 Drupal Operations 项目 的一部分。

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

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