Skip to main content

Real-World Use Case: Automated QA & API Test Suites

PostQode provides AI testing agents (API Agent, Web Agent, Mobile Agent) designed to automate end-to-end testing workflows and integrate test execution into continuous integration (CI/CD) pipelines.


Scenario Overview

Goal: Import an existing OpenAPI specification, generate assertion-backed API test suites, run browser UI smoke tests, and export HTML execution reports in CI/CD.


Workflow Step-by-Step

Step 1: Import API Spec & Generate Test Suites

  1. Open PostQode in API Agent mode.
  2. Instruct PostQode:
    Import swagger.json and generate functional test suites for all User Authentication and Payment endpoints.
  3. PostQode invokes native tools (import_library, create_test_suite, create_test_case) to construct:
    • Request payloads with dynamic variables ({{baseUrl}}, {{authToken}})
    • Assertion checks (HTTP 200/201 status, response body schema validation, response time < 500ms)

Step 2: Running Automated API Tests

  1. Run the test suite:
    Execute the User Authentication test suite against environment stage-api.example.com.
  2. PostQode executes requests programmatically, verifies assertions, and reports summary results:
Test CaseMethodEndpointStatusDuration
User SignupPOST/api/v1/auth/signupPASSED142ms
User LoginPOST/api/v1/auth/loginPASSED98ms
Fetch ProfileGET/api/v1/user/profilePASSED45ms

Step 3: Web UI & Browser Automation (web-qa)

  1. Switch to web-qa Agent or Web Agent.
  2. Instruct PostQode:
    Open https://staging.example.com, log in using test credentials, navigate to Dashboard, and verify the Summary cards load cleanly without console errors.
  3. PostQode drives a persistent Chromium browser session (postqode_browser_agent), takes accessibility tree snapshots, fills forms, verifies visual elements, and captures screenshots.

Step 4: CLI Execution & CI/CD Pipeline Export

To run test suites headlessly in your Command Prompt / Terminal or inside CI/CD runners (GitHub Actions, GitLab CI, Jenkins):

  1. Install PostQode CLI globally or run on-demand via npx:
    npm install -g @postqode/cli
  2. Execute test suites and export standalone HTML reports:
    npx @postqode/cli run --suite "User Auth" --reporter html --output ./reports/test-report.html
  3. View or archive HTML, JSON, or JUnit XML reports directly inside CI build artifacts!