API TestingExample Case

Example: Geo-Related API Testing with ReAPI

Scenario Overview

A QA team needs to test multiple geo-related API modules efficiently while validating geolocation data.

Workflow in Action

1. No-Code Test Case Creation

QA organizes test cases in ReAPI’s no-code editor using API Nodes, Control Flow Nodes, and Assertions.

2. Identifying Custom Validation Needs

They notice a need to validate geolocation fields ([lat, lng]) within valid ranges.

3. Minimal Developer Input

A developer writes a simple isGeoLocation function (15 lines of code) and registers it as a custom assertion in ReAPI.

function isGeoLocation(value) {
  if (Array.isArray(value) && value.length === 2) {
    const [lat, lng] = value;
    $addAssertionResult({
      passed: lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180,
      leftValue: value,
      message: `Invalid range: lat=${lat}, lng=${lng}`,
    });
  } else {
    $addAssertionResult({
      passed: false,
      leftValue: value,
      message: "Invalid geolocation array",
    });
  }
}

4. QA Uses Custom Assertion

Once added, QA can select isGeoLocation like any built-in assertion to validate responses.

5. Running and Deploying Tests

QA executes test cases using Test Runners per module (e.g., Location Search, Route Planning). When satisfied, they deploy tests for production and run them via CLI, cloud runners, or webhooks.

6. Automated Test Results

Test reports are sent via email, keeping the team updated.

Key Benefits

  • QA Independence: No coding needed for complex test design.
  • Developer Efficiency: Minimal coding effort to add reusable validation.
  • Scalable Testing: Organized modules, custom validations, and environment-specific test deployments.
  • Flexible Automation: Supports scheduled runs, cloud execution, and webhook triggers.
  • Seamless Collaboration: QA and developers work together effortlessly.

This example highlights how ReAPI enables efficient, collaborative API testing while maintaining high-quality standards.