バックグラウンドのキーワードは、各シナリオを実行する前に共通のステップを実行するために利用できます。同様に、後のフックのようなJavaコードの論理的なステップではなく、各シナリオの後のコモンステップのために「After」キーワードが利用できるようなものがあります。キュウリのステップを実行するためにバックグラウンドのようなAfterキーワードがありますか
Background
Given I use the API header information
| Content-Type | application/json;v=3 |
And I connect to postgresql
Scenario Outline:
And I get the "Request" payload from "5NB_CARD-A_Request" file for the scenario "CardA_Scenario1"
And I store the input payload individual field details for database validation
And I form a client with this resource url "/transaction"
When I make a POST call and capture the response
And I get the "response" payload from "5NB_CARD-A_Response" file for the scenario "CardA_Scenario1"
Examples:
| HTTPCode |
| 200 |
After
Then I validate the output response with expected data
And I verify the HTTP error code is "<HTTPCode>"
And I fetch and validate latest created data from "transaction" table
And I validate the created card is inserted into "field" table
ありがとうございました。しかし、私が求めている主な理由は、50以上のシナリオがあるということです。すべてのシナリオで手順は多かれ少なかれ、変更可能な手順は私が私の質問で言及した中間の手順だけです。それぞれのシナリオで、私のHTTPコードが変更され、「例:」に入れて検証します。他の人には、期待されるjsonと実際のjsonの内容で検証します。だから、私は何度も何度も繰り返しているようです。そこでいくつかのきれいな定義を探していました。あなたは私を助けてくれますか? – mmar
申し訳ありませんが、あなたがしようとしていることを正確に理解しているとは思いません。私は答えにもう一度行きます。 –