【发布时间】:2014-01-03 05:23:54
【问题描述】:
我使用 Composer 重新安装了 Luracast/Restler,但无法运行任何行为测试。我是 Restler 和 behat 的新手,所以我可能会犯初学者的错误,但根据文档,我需要做的就是更改 behat.yml 中的根 URL,然后输入 bin/behat。
这是我在输入 vendor/bin/behat 时收到的错误消息。
[RuntimeException]
Context class not found.
Maybe you have provided a wrong or no `bootstrap` path in your behat.yml:
http://docs.behat.org/guides/7.config.html#paths
behat [--init] [-f|--format="..."] [--out="..."] [--lang="..."] [--[no-]ansi] [--[no-]time] [--[no-]paths] [--[no-]snippets] [--[no-]snippets-paths] [--[no-]multiline] [--[no-]expand] [--story-syntax] [-d|--definitions="..."] [--name="..."] [--tags="..."] [--cache="..."] [--strict] [--dry-run] [--stop-on-failure] [--rerun="..."] [--append-snippets] [--append-to="..."] [features]
Content-type: text/html
这是我的 behat.yml 文件:
# behat.yml
default:
context:
parameters:
base_url: http://<MY_DOMAIN>.com/restler3/sampleproject/public
我尝试使用绝对路径和相对路径指定 path.features 和 path.bootstrap 变量,但没有成功。
# behat.yml
default:
paths:
features: features
bootstrap: features/bootstrap
context:
parameters:
base_url: http://<MY_DOMAIN>.com/restler3/sampleproject/public
我真的很想将 Restler 用于我正在启动的 API 项目,但我需要能够运行测试,所以如果能帮助我解决这个问题,我将不胜感激。
【问题讨论】: