Browse Source

Rewrite using returnValues

pull/2059/head
Philipp Theyssen 1 year ago
parent
commit
30936ad638
2 changed files with 130 additions and 22 deletions
  1. +64
    -4
      scenario-definition/operations/op_catalog_get_items.json
  2. +66
    -18
      scenario-definition/transactions/add_items_to_basket.json

+ 64
- 4
scenario-definition/operations/op_catalog_get_items.json View File

@ -11,19 +11,79 @@
"returnValues": [ "returnValues": [
{ {
"key": "item-1", "key": "item-1",
"value": "@@response.payload.data[0]@@",
"value": "response.payload.data[0]",
"type": "object" "type": "object"
}, },
{
"key": "item-1-id",
"value": "response.payload.data[0].id",
"type": "string"
},
{
"key": "item-1-name",
"value": "response.payload.data[0].name",
"type": "string"
},
{
"key": "item-1-price",
"value": "response.payload.data[0].price",
"type": "unsignedInt"
},
{
"key": "item-1-avialable-stock",
"value": "response.payload.data[0].availablestock",
"type": "unsignedInt"
},
{ {
"key": "item-2", "key": "item-2",
"value": "@@response.payload.data[1]@@",
"value": "response.payload.data[1]",
"type": "object" "type": "object"
}, },
{
"key": "item-2-id",
"value": "response.payload.data[1].id",
"type": "string"
},
{
"key": "item-2-name",
"value": "response.payload.data[1].name",
"type": "string"
},
{
"key": "item-2-price",
"value": "response.payload.data[1].price",
"type": "unsignedInt"
},
{
"key": "item-2-avialable-stock",
"value": "response.payload.data[1].availablestock",
"type": "unsignedInt"
},
{ {
"key": "item-3", "key": "item-3",
"value": "@@response.payload.data[2]@@",
"value": "response.payload.data[2]",
"type": "object" "type": "object"
}
}
{
"key": "item-3-id",
"value": "response.payload.data[2].id",
"type": "string"
},
{
"key": "item-3-name",
"value": "response.payload.data[2].name",
"type": "string"
},
{
"key": "item-3-price",
"value": "response.payload.data[2].price",
"type": "unsignedInt"
},
{
"key": "item-3-avialable-stock",
"value": "response.payload.data[2].availablestock",
"type": "unsignedInt"
},
] ]
"url": "http://localhost:5101/catalog-api/api/v1/Catalog/items" "url": "http://localhost:5101/catalog-api/api/v1/Catalog/items"
} }

+ 66
- 18
scenario-definition/transactions/add_items_to_basket.json View File

@ -5,7 +5,55 @@
{ {
"name": "user-id", "name": "user-id",
"type": "guid" "type": "guid"
}
},
{
"name": "item-1-id",
"type": "string"
},
{
"name": "item-1-name",
"type": "string"
},
{
"name": "item-1-price",
"type": "unsignedInt"
},
{
"name": "item-1-available-stock",
"type": "unsignedInt"
},
{
"name": "item-2-id",
"type": "string"
},
{
"name": "item-2-name",
"type": "string"
},
{
"name": "item-2-price",
"type": "unsignedInt"
},
{
"name": "item-2-available-stock",
"type": "unsignedInt"
},
{
"name": "item-3-id",
"type": "string"
},
{
"name": "item-3-name",
"type": "string"
},
{
"name": "item-3-price",
"type": "unsignedInt"
},
{
"name": "item-3-available-stock",
"type": "unsignedInt"
},
], ],
"operations": [ "operations": [
{ {
@ -25,37 +73,37 @@
"value": "value":
{ {
"id": "1", "id": "1",
"productId": "@@op-1.response[0].id@@",
"productName": "@@op-1.response[0].name@@",
"unitPrice": "@@op-1.response[0].price@@",
"oldUnitPrice": "@@op-1.response[0].price@@",
"quantity": "@@op-1.response[0].availablestock@@",
"productId": "{{item-1-id}}",
"productName": "{{item-1-name}}",
"unitPrice": "{{item-1-price}}",
"oldUnitPrice": "{{item-1-price}}",
"quantity": "{{item-1-available-stock}}",
"pictureUrl": "" "pictureUrl": ""
}, },
}, },
{ {
"key": "item-2", "key": "item-2",
"value":
"value":
{ {
"id": "2", "id": "2",
"productId": "@@op-1.response[1].id@@",
"productName": "@@op-1.response[1].name@@",
"unitPrice": "@@op-1.response[1].price@@",
"oldUnitPrice": "@@op-1.response[1].price@@",
"quantity": "@@op-1.response[1].availablestock@@",
"productId": "{{item-2-id}}",
"productName": "{{item-2-name}}",
"unitPrice": "{{item-2-price}}",
"oldUnitPrice": "{{item-2-price}}",
"quantity": "{{item-2-available-stock}}",
"pictureUrl": "" "pictureUrl": ""
}, },
}, },
{ {
"key": "item-3", "key": "item-3",
"value":
"value":
{ {
"id": "3", "id": "3",
"productId": "@@op-1.response[2].id@@",
"productName": "@@op-1.response[2].name@@",
"unitPrice": "@@op-1.response[2].price@@",
"oldUnitPrice": "@@op-1.response[2].price@@",
"quantity": "@@op-1.response[2].availablestock@@",
"productId": "{{item-3-id}}",
"productName": "{{item-3-name}}",
"unitPrice": "{{item-3-price}}",
"oldUnitPrice": "{{item-3-price}}",
"quantity": "{{item-3-available-stock}}",
"pictureUrl": "" "pictureUrl": ""
} }
} }


Loading…
Cancel
Save