是否可以将一个功能重用为另一个功能的“给定”?
还是我在尝试做一些我不应该尝试做的事情
基本上我的功能看起来像:
Scenario: Creating a basic account with valid details (happy path)
Given I am on the "signup" page
And I enter all the right details #this is shortened of about 20 steps for your reading ease
When I press the button labelled "Sign up"
Then I should see the text "Thanks for signing up"
And I should have an email from "confirmation@mysite.com" titled "Confirm your account Michael"
And the database should contain a record for the user marked as unconfirmed
Scenario: Confirming account via email
Given I have created a basic account
When I open the confirmation email and visit the url to confirm the account
Then I should be logged in
And the database should contain a record for the user makred as confirmed
我在每个功能之后清除我的数据库,因为它们都应该能够单独运行......
我会以错误的方式解决这个问题吗?
谢谢