Forum Discussion

Houda's avatar
Houda
Staff
4 years ago

Carry over the scenario attachments in the related test snapshots

Hey!

 

Currently in CucumberStudio the scenario attachments while test run creation. This feature request is on the public roadmap here, but in the meantime you can create a custom script based on your favorite programming language to achieve that.

 

So here are the steps to build the custom script by using these API endpoints: 

 

1. Get scenarios of a given project

2. Store the scenario ids in a variable

3. List attachments of a given scenario

4. Store the attachments ids in a variable

5. Get a given attachment of a given scenario

6. Save the attachments in a new created directory and store their related ids and names ("file-name") in a variable

7. Get tests of a test run

8. Store the test snapshots ids in a variable

9. Fetch and store the last result ids and scenario ids of test snapshots with this API endpoint:

 

GET https://studio.cucumber.io/api/projects/<project_id>/test_runs/<test_run_id>/test_snapshots/<test_snapshot_id>?include=last-result,scenario

 

10. Match the scenario ids of test snapshots with all scenario ids, and extract those which are included in the test run 

11. Create an attachment to a given test execution result

 

Hope this helps!

No RepliesBe the first to reply