ユーザーの観点から内部 IT アプリケーションをテストするために、Cookie ベースのシングル サインオン ソリューションへのログインを含むシナリオの Behat バックグラウンドを確立する必要があります。
これは、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