次のようなスペックフローテストがいくつかあります。
Scenario: Person is new and needs an email
Given a person
And the person does not exist in the repository
When I run the new user batch job
Then the person should be sent an email
Scenario: Person is not new and needs an email
Given a person
And the person does exist in the repository
When I run the new user batch job
Then the person should not be sent an email
2つのシナリオだけでなく、10の非常によく似たシナリオがあり、すべてステップのタイプがあるので、「シナリオの概要」を使用したいと思います。残念ながら、私は自分のステップを書き直すための読みやすい方法を思い付くのに本当に苦労しています。
現在、私はこれを思いついたが、不格好に見える:
Scenario: Email batch job is run
Given a person
And the person '<personDoes/NotExist>' exist in the repository
When I run the new user batch job
Then the person '<personShould/NotGetEmail>' be sent an email
Examples:
| !notes | personDoes/NotExist | personShould/NotGetEmail |
| Exists | does not | should |
| No Exist | does | should not |
私もこれを考えました、そしてそれはよりきれいですが、それはほとんど意味を伝えません
Scenario: Email batch job is run
Given a person
And the person does exist in the repository (is '<personExist>')
When I run the new user batch job
Then the person should be sent an email (is '<sendEmail>')
Examples:
| !notes | personExist | sendEmail |
| Exists | false | true |
| No Exist | does | false |
「する」、「しない」、「すべき」、「すべきではない」、「持っている」、「持っていない」などの概念をパラメーター化するためのより良い方法を持っている人はいますか?この時点で、読みやすいので、すべてを別のシナリオとして残すことを考えています。