我准备在IDE项目(黄瓜+硒堆栈)中工作,以便通过https://cucumber.io/docs/tools/java/这样的命令行执行。您能解释一下我做错了什么吗?问题可能出在测试类和功能之间。
功能
:Feature: The most voted Language Dependence level is presented on the game's page with correct values
Scenario: Compare The most voted Language Dependence level between web application and Api
Given User account with a game collection
When Open user game collection
And Choose random game
And Check Language dependence
Then The highest voted Language Dependence level between web application and Api is the same
我的测试班级:(我删除了很多方法)
public class CompareLangDepStep extends BaseTest {
@Given("User account with a game collection")
public void UserAccountWithAGameCollection() {
}
@When("Open user game collection")
public void openUserGameCollection() { }
@And("Choose random game")
public void chooseRandomGame() { }
@And("Check Language dependence")
public void checkLanguageDependence() {
}
@Then("The highest voted Language Dependence level between web application and Api is the same")
public void validateHighestVotedLanguageDependence() {
}
}
“渐变黄瓜”命令后的输出:
D:\BGG_E2E_selenium>gradle cucumber
> Task :cucumber
Feature: The most voted Language Dependence level is presented on the game's page with correct values
Scenario: Compare The most voted Language Dependence level between web application and Api # src/test/resources/Features/CompareLangDepStep.feature:3
Given User account with a game collection # null
When Open user game collection # null
And Choose random game # null
And Check Language dependence # null
Then The highest voted Language Dependence level between web application and Api is the same # null
Undefined scenarios:
src/test/resources/Features/CompareLangDepStep.feature:3 # Compare The most voted Language Dependence level between web application and Api
1 Scenarios (1 undefined)
5 Steps (5 undefined)
0m0,716s
You can implement missing steps with the snippets below:
@Given("User account with a game collection")
public void user_account_with_a_game_collection() {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
@When("Open user game collection")
public void open_user_game_collection() {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
@When("Choose random game")
public void choose_random_game() {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
@When("Check Language dependence")
public void check_Language_dependence() {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
@Then("The highest voted Language Dependence level between web application and Api is the same")
public void the_highest_voted_Language_Dependence_level_between_web_application_and_Api_is_the_same() {
// Write code here that turns the phrase above into concrete actions
throw new cucumber.api.PendingException();
}
BUILD SUCCESSFUL in 11s
3 actionable tasks: 2 executed, 1 up-to-date