0
cuke4duke와 Cucumber를 maven과 서면 기능 및 단계 정의 파일로 구성했습니다.cuke4duke가 단계 정의를 찾는 방법
내 기능 파일은 기능 \ example2.feature \ [PROJECTDIR]에 있습니다
내 단계 정의는 \ SRC \ 테스트 \ 자바 \의 Example2Steps.java [PROJECTDIR]에 있습니다Feature: Example of a feature file
As some aspiring cuke4duke user
I want an example of how it works
So that I can easily setup my project to use it
# This should pass
Scenario: A simple passing scenario
Given the letter 'A'
When I check the letter
Then the letter should be 'A'
package test.java;
import cuke4duke.annotation.I18n.EN.Given;
import cuke4duke.annotation.I18n.EN.Then;
import cuke4duke.annotation.I18n.EN.When;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.is;
public class Example2Steps {
private char theLetter;
@Given("^the letter 'A'$")
public void gimmeALetter(final char theLetter) {
this.theLetter = theLetter;
}
@When("^I check the letter$")
public void checkThem() {
// just a stub
}
@Then("^the letter should be 'A'$")
public void checkTheLetter(final char aLetter) {
assertThat(theLetter, is(aLetter));
}
}
Windows 명령 프롬프트에서 프로젝트 디렉토리에 "mvn integration-test"를 실행하면 빌드가 잘되지만 시나리오와 단계가 정의되지 않았 음을 알 수 있습니다.
출력 :
[INFO] [cuke4duke:cucumber {execution: run-features}]
[INFO] Feature: Example of a feature file
[INFO] As some aspiring cuke4duke user
[INFO] I want an example of how it works
[INFO] So that I can easily setup my project to use it
[INFO]
[INFO] # This should pass
[INFO] Scenario: A simple passing scenario # features\example2.feature:7
[INFO] Given the letter 'A' # features\example2.feature:8
[INFO] When I check the letter # features\example2.feature:9
[INFO] Then the letter should be 'A' # features\example2.feature:10
[INFO]
[INFO] 1 scenario (1 undefined)
[INFO] 3 steps (3 undefined)
[INFO] 0m0.053s
[INFO]
[INFO] You can implement step definitions for undefined steps with these snippets:
[INFO]
[INFO] Given /^the letter 'A'$/ do
[INFO] pending # express the regexp above with the code you wish you had
[INFO] end
[INFO]
[INFO] When /^I check the letter$/ do
[INFO] pending # express the regexp above with the code you wish you had
[INFO] end
[INFO]
[INFO] Then /^the letter should be 'A'$/ do
[INFO] pending # express the regexp above with the code you wish you had
[INFO] end
[INFO]
[INFO] If you want snippets in a different programming language, just make sure a file
[INFO] with the appropriate file extension exists where cucumber looks for step definitions.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
는 지금까지 내가 어디에서나 읽을 수있는, cuke4duke는 [PROJECTDIR]에서 단계 정의를 찾습니다 \ SRC \ 테스트 \ 자바 \, 왜 내 정의를 찾을 수 없습니다?