为了从用户的角度测试内部IT应用程序,我需要为我的方案建立一个Behat背景,包括登录基于cookie的单点登录解决方案。
这是在Givens中设置日志记录的最低限度测试。一旦成功,当然会有更多的“当”和“然后”。
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
答案 0 :(得分:3)
听起来你可能遇到过https://github.com/Behat/Mink/issues/161 - 我引用了bug报告:
这对Behat或Goutte来说不是问题,我向ZF汇报:http://framework.zend.com/issues/browse/ZF2-169
然而,它显然已在上游得到解决,所以现在应该可以正常工作了。