config: target: "http://ticketmonster.apicasystem.com" scenarios: - name: "TM_OrderTickets" flow: - page: name: "Get Events" thinktime: 0 - get: url: "/ticket-monster/rest/events?_{{epoch_TS}}" assert: - status: codes: - 200 capture: - json: occurrence: 1 random: true target: "$[*].id" as: "event_id" before: - inline: code: | epoch_TS=getUnixTimestampMillis() output: - '{{epoch_TS}}' - page: name: "Get Shows" thinktime: 1 - get: url: "/ticket-monster/rest/shows?event={{event_id}}&_{{epoch_TS}}" assert: - status: codes: - 200 capture: - json: occurrence: 1 random: true target: "$[*].id" as: "show_id" before: - inline: code: | epoch_TS=getUnixTimestampMillis() output: - '{{epoch_TS}}' - get: url: "/ticket-monster/rest/shows/{{show_id}}?_{{epoch_TS}}" assert: - status: codes: - 200 capture: - json: target: "$.performances[*].id" as: "performance_id" - json: target: "$.ticketPrices[*].id " as: "ticketprice_id" before: - inline: code: | epoch_TS=getUnixTimestampMillis() output: - '{{epoch_TS}}' - page: name: "Order tickets" thinktime: 1 - post: url: "/ticket-monster/rest/bookings" json: ticketRequests: - ticketPrice: "{{ticketprice_id}}" quantity: "{{quantity}}" email: "{{email}}" performance: "{{performance_id}}" capture: - json: target: "$.id" as: "booking_id" assert: - status: codes: - 200 - 201 before: - inline: code: | quantity=random(1,3) email="user"+(getUserNumber() + 1) + "@acme.com" output: - '{{email}}' - '{{quantity}}' - get: url: "/ticket-monster/rest/bookings/{{booking_id}}?_{{epoch_TS}}" assert: - status: codes: - 200 before: - inline: code: | epoch_TS=getUnixTimestampMillis() output: - '{{epoch_TS}}' - page: name: "Delete tickets" thinktime: 1 - delete: url: "/ticket-monster/rest/bookings/{{booking_id}}" assert: - status: codes: - 200 - 204