User Creation ============= Multiple Users -------------- * Create a user "user 1" * Verify "user 1" has access to dashboard * Create another user "user 2" * Verify "user 2" has access to dashboard
使用别名即可解决这个问题:
1 2 3 4 5 6 7
public class Users {
@Step({"Create a user <user_name>", "Create another user <user_name>"}) public void createUser(String user_name) { // create user user_name } }
在这个两个Scenario中,发送邮件的操作是相同的
1 2 3 4 5 6 7 8 9 10
User Creation ------------- * User creates a new account * A "welcome" email is sent to the user
Shopping Cart ------------- * User checks out the shopping cart * Payment is successfully received * An email confirming the "order" is sent
使用别名:
1 2 3 4 5 6 7
public class Users {
@Step({"A <email_type> email is sent to the user", "An email confirming the <email_type> is sent"}) public void sendEmail(String email_type) { // Send email of email_type } }