I have a CRUD test case for an entity (eg Area1) defined in a scenario/feature file However i want to call this feature file for creating another entity (eg Area2). Area2 first needs an Area1 to be created, so i would need to call this Area1.feature file.
But Area1.feature also contains the Delete step, how can I effectively call this Area1.feature in Area2, but all clean the created Area1 at the end of the test?
Scenario: Create a site
Given url baseUrlSuite
And path 'sites'
And request siteupdated
And header Authorization = 'Bearer ' + tokenSuite
When method POST
Then status 201
And match response contains siteupdated
* def siteId = response.id
Then print 'siteId---',siteId
* def siteName = response.name
Then print 'siteName---',siteName
* def siteEtag = responseHeaders.ETag
Then print 'siteEtag---',siteEtag
Delete the created site in suite
Given url baseUrlSuite
And path 'sites' + '/' + siteId
And header Authorization = 'Bearer ' + tokenSuite
And header If-Match = siteEtag
When method DELETE
Then status 204