k6 load testing

Add response content assertions

Medium70 pts~25 min
  • Content validation
  • Checks
Practice app · Checkout Service

A load-testable checkout service with realistic latency that degrades under concurrency, plus a live metrics view.

BASE_URL
/api/practice
Console app
/lab/performance-testing-add-response-content-assertions

Your starter code already declares BASE_URL — call the API relative to it.

Objective

Validate response bodies under load, not just status codes.

Your task

  1. 1Set options { vus: 5, iterations: 30 }.
  2. 2GET BASE_URL + "/perf/checkout" and check: status 200, status field === "confirmed", orderId is a non-empty string.
  3. 3GET BASE_URL + "/perf/search?q=mug" and check results is a non-empty array.

Acceptance criteria

  • Checkout and search return 200
  • ≥ 60 requests are sent
  • At least 60 check() calls pass

k6 load testing · Performance Testing · Assertions & validation