我对 BDD 很陌生,我正在尝试使用 BDD 为网站开发一个简单的注册模块。
我有以下情况:
Scenario: An anonymous visitor successfully signs up with the website
Given the following email address: john.smith@gmail.com and a chosen member status of childminder and the following password: ------
When the anonymous visitor signs up
Then a confirmation email with activation information is sent to the anonymous visitor
我很茫然自动化然后步骤(“然后将带有激活信息的确认电子邮件发送给匿名访问者”)
这是我所做的(使用 JBehave):
@Given("the following email address: $email and a chosen member status of $status and the following password: $password")
public void anonymousVisitorEntersDetails(String email, String status, String password) {
pages.home().open();
pages.home().enterDetails(email, status, password);
}
@When("the anonymous visitor signs up")
public void anonymousVisitorDoesRegister(String login, String password) {
pages.home().doRegister();
}
@Then("a confirmation email with activation information is sent to the anonymous visitor")
public void activationInformationIsSent() {
//TODO ??
}
我遇到的问题与其说是工具问题,不如说是设计问题。如果一些有经验的 BDD 从业者能帮助我解决这个问题,我将不胜感激......