API testing

Run the collection in CI with reports

Expert190 pts
  • CI
  • Test reporting
Practice app · Acme REST API

A live REST + GraphQL API with auth, validation, pagination, rate limiting and an interactive request console.

BASE_URL
/api/practice
Console app
/lab/api-testing-run-the-collection-in-ci-with-reports

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

Objective

Build a small, independent suite covering users, auth and errors that a CI job can run and report on.

Your Task

  1. 1Test 1: GET BASE_URL + "/users/1" → assert 200 and name "Ada Lovelace".
  2. 2Test 2: POST BASE_URL + "/auth/token" with admin credentials { "username": "qa@target.dev", "password": "Test@123" }, extract access_token, then GET BASE_URL + "/auth/me" with Authorization: Bearer <access_token> → assert 200.
  3. 3Test 3: GET BASE_URL + "/users/9999" → assert 404 and error.code "USER_NOT_FOUND".
  4. 4Give each test a descriptive name so reports read well; read BASE_URL from the environment when set.

Validation Checks

  • GET /users/1 returns 200
  • GET /auth/me returns 200
  • GET /users/{id} returns 404
  • At least 4 assertions pass

Fixtures

apiKey
tqa_live_key_123
basicUser
admin
basicPassword
secret
username
qa@target.dev
password
Test@123

API testing · API Testing Practice Track · Integration, performance & CI