能否将一个功能用作另一个功能的“Given”步骤?
或者说我正在尝试做不该做的事情吗?
基本上,我的功能看起来像:
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
每次完成一个功能后,我都会清除我的数据库,因为它们应该都可以单独运行...
我这样做是错的吗?
谢谢