Yii 프레임 워크의 Behat 및 Mink 설정에서 BDD 기능에 대한 나만의 단계를 정의하는 데 문제가 있습니다.Behat/Mink에서 기능 단계 정의 방법 (위치)
MinkExtension-example의 지침에 따라 Mink 확장자가있는 Behat을 성공적으로 설치했습니다.
모든 그 후, I는 MyApp를 내부 내 폴더 구조는 다음/private_html/ (일부 중첩 폴더는 생략 하였다)
├───bin
├───commands
│ └───shell
├───components
├───config
├───controllers
├───features
│ ├───bootstrap
│ └───php54_bootstrap
├───models
├───tests
├───vendor
│ ├───behat
│ │ ├───behat
│ │ │ ├───bin
│ │ │ ├───features
│ │ │ │ ├───annotations
│ │ │ │ ├───bootstrap
│ │ │ │ └───closures
└───views
상술 링크의 예로서 제공되는 기능 MinkExtension-example은 문제없이 작동합니다. 하지만
Scenario: presence of menu items
Given I am on "/"
Then I should see the following: "Home, About, Contact"
처럼 내 자신의 단계를 정의 할 때 나는 제안
You can implement step definitions for undefined steps with these snippets:
/**
* @Then /^I should see the following: "([^"]*)"$/
*/
public function iShouldSeeTheFollowing($arg1)
{
throw new PendingException();
}
와
1 scenario (1 undefined)
2 steps (1 passed, 1 undefined)
0m2.288s
을 얻을 그리고 질문은 :이 코드를 삽입해야하는 위치? 나는
myapp\private_html\vendor\behat\behat\features\bootstrap\FeatureContext.php
뿐만 아니라
myapp\private_html\features\bootstrap\FeatureContext.php
에 넣어 시도했지만 단계는 정의되지 않은 남아있다.
그래서 단계는 어디에 정의되어 있습니까?
을 사용할 수 있습니다 프로그래머 ? ** features \ bootstrap \ FeatureContext.php ** 파일에 단계 정의를 추가하는 것에 대한 제안을 해 드리겠습니다. – Andrew
죄송합니다. 그 부분을 삭제했습니다. – sensorario
** 기능 \ bootstrap \ FeatureContext.php **에 내 단계를 추가하려고 시도했지만 이전과 마찬가지로 단계가 정의되지 않은 상태로 유지됩니다. 사실, 당신이 언급 한 컨텍스트에 대한 아이디어를 이해하지 못했지만, 뭔가를 시도했습니다 : 1.먼저 ** $ this-> useContext ('mink', 새로운 MinkContext()); **를 생성자에 추가하려고 시도했지만 아무 것도 변경되지 않았습니다. 2. Behat \ MinkExtension \ Context \ MinkContext; * - 그리고 다시 아무것도 바뀌지 않았습니다. BTW 무슨 뜻 이니? ** FeatureContext의 상위 폴더를 BehatContext에서 MinkContext로 변경 **합니다. – Andrew