An API endpoint returns the following JSON response as an array of elements. The below represents a singular element.
//provide the JSON element here
Using this information please generate a cypress fixture to mock this response to generate up to 7 such records. Feel free to randomize or negate certain key attributes in the JSON response. Note the below rules for specific element:
<Provide details of keys which can only have certain values, example department can only be “HR”, “IT” or “Finance”>
Install Prompt
Add this prompt to your Amazon Q CLI prompt library:
1. Download to local prompt library:
mkdir -p .amazonq/cli-prompts && curl -o .amazonq/cli-prompts/generate-rest-api-fixtures-for-cypress-testing.md https://promptz.dev/prompts/testing/generate-rest-api-fixtures-for-cypress-testing/2. Use with Q CLI:
q prompts use generate-rest-api-fixtures-for-cypress-testing