0

为了从用户的角度测试内部 IT 应用程序,我需要为我的场景建立 Behat 背景,包括登录到基于 cookie 的单点登录解决方案。

这是在 Givens 中设置日志记录的最低限度的测试。一旦成功,当然会有更多的“When”和“Then”。

Feature: Bouncerize
    In order to log in to internal applications
    As an application user
    I need to be able to use the SSO system

    Scenario: Log in to Bouncer
        Given I am on "https://private_url/login/"
        And I fill in "pass_word" with "a hard to guess password"
        And I fill in "id" with "username"
        And I press "Sign In"

当我运行这个场景时,第一个 Given 失败并出现错误:

  Scenario: Log in to Bouncer                                 # features/bouncer.feature:8
    Given I am on "https://gh.bouncer.login.yahoo.com/login/" # FeatureContext::visit()
      A cookie name is required to generate a field value for this cookie

到目前为止, FeatureContext除了它扩展之外,没有任何自定义Behat\Mink\Behat\Context\MinkContext

4

1 回答 1

3

听起来您可能遇到过https://github.com/Behat/Mink/issues/161 - 我从错误报告中引用:

这不是 Behat 或 Goutte 的问题,我向 ZF 报告:http: //framework.zend.com/issues/browse/ZF2-169

但是,它显然也已在上游得到解决,所以现在应该可以正常工作了。

于 2012-09-22T16:46:06.797 回答