Skip to content

heiparth07/IntegriFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntegriFlow

API Integration Test Framework — YAML-driven REST API testing with schema validation, data integrity checks, chained tests, and HTML reporting.

Built as a demonstration of QA automation skills directly relevant to data integration testing, including the kind of work done daily at companies like KingswaySoft.


What It Does

IntegriFlow lets you define API test suites in YAML, run them from the CLI, and get a detailed HTML report. It covers:

  • REST API testing (GET, POST, PUT, DELETE)
  • HTTP status, response time, and field assertions
  • JSON schema validation
  • Data integrity checks across record sets (nulls, duplicates, value ranges, allowed values)
  • Chained tests (extract a value from one response, use it in the next)
  • Query parameter support (OData-style filtering)
  • Negative testing (404, validation errors)
  • HTML test report generation

Project Structure

integriflow/
├── src/
│   ├── cli.py                        # CLI entry point
│   ├── runner.py                     # Core test runner
│   ├── mock_server.py                # Local mock CRM API server
│   ├── connectors/
│   │   └── rest_connector.py         # HTTP request handler
│   ├── validators/
│   │   ├── response_validator.py     # Status, field, type, value assertions
│   │   ├── schema_validator.py       # JSON schema validation
│   │   └── data_integrity_validator.py  # Null, uniqueness, range, allowed-value checks
│   └── reporters/
│       └── html_reporter.py          # HTML report generation
├── config/
│   ├── test_suites/
│   │   ├── crm_contacts_api.yaml     # CRM contacts CRUD test suite
│   │   └── data_pipeline_integrity.yaml  # ETL post-migration validation suite
│   └── schemas/
│       ├── contact_schema.json
│       └── post_schema.json
├── tests/
│   └── unit/
│       └── test_validators.py        # 23 unit tests across all validators
├── reports/                          # Generated HTML reports
└── requirements.txt

Quickstart

pip install -r requirements.txt

# Start the local mock CRM API
python -m src.mock_server

# Run a test suite
python -m src.cli run config/test_suites/crm_contacts_api.yaml

# Run with custom report output
python -m src.cli run config/test_suites/data_pipeline_integrity.yaml --output reports/pipeline.html

# Run unit tests
pytest tests/unit/ -v

Writing a Test Suite

Test suites are YAML files. No code required.

name: "My API Test Suite"
description: "Validates contact records after CRM migration."
base_url: "https://your-api.example.com"
headers:
  Content-Type: "application/json"

tests:

  - name: "Fetch All Contacts"
    method: GET
    endpoint: /contacts
    assert:
      status_code: 200
      max_response_time_ms: 2000
      fields_present: [value, count]
    integrity_rules:
      no_null_fields: [id, email, status]
      unique_fields: [id, email]
      min_record_count: 1
      allowed_values:
        status: [active, inactive]
    extract:
      first_id: "value.0.id"

  - name: "Fetch Contact by ID"
    method: GET
    endpoint: /contacts/{{first_id}}      # Uses extracted value from above
    assert:
      status_code: 200
      field_types:
        id: integer
        email: string
    validate_schema: contact_schema.json

Assertion Reference

Assertion Description
status_code Expected HTTP status code
max_response_time_ms Maximum allowed response time
fields_present List of fields that must exist in the response body
not_null Fields that must not be null or empty
field_types Expected types: string, integer, float, boolean, list, dict
field_values Exact expected values for specific fields
list_not_empty Fields that must be non-empty lists

Integrity Rule Reference

Rule Description
no_null_fields Fields that must not be null across all records
unique_fields Fields that must have unique values across all records
min_record_count Minimum number of records expected
value_ranges Min/max numeric range per field
allowed_values Enumerated set of valid values per field

Test Suites Included

CRM Contacts API Suite (9 tests)

Simulates full CRUD testing for a CRM contacts endpoint, similar to Dynamics 365 or Salesforce contact management APIs. Covers:

  • Full dataset integrity sweep (null checks, uniqueness, value ranges)
  • Schema validation on individual records
  • Create, read, update, delete flows
  • Linked entity (orders) referential integrity
  • OData-style query parameter filtering
  • Negative test: 404 on non-existent record

Data Pipeline Integrity Suite (7 tests)

Post-migration validation suite. Validates data landed correctly after an ETL pipeline run across accounts, contacts, and orders. Covers:

  • Null and uniqueness checks on migrated account records
  • Full contact dataset integrity sweep
  • Referential integrity: account to contacts join
  • Order records cross-system validation (allowed currencies, status values)
  • Write-back test: posting a new order record
  • Performance SLA baseline
  • Negative test: invalid account lookup

Unit Tests

23 unit tests covering all three validators:

pytest tests/unit/test_validators.py -v
23 passed in 0.09s

Why I Built This

KingswaySoft's QA team tests data integration pipelines across enterprise systems: Dynamics 365, Salesforce, SharePoint, Oracle CRM, SQL Server. The daily work involves validating that data flows correctly through REST and SOAP APIs, lands in the right schema, and maintains integrity across joins and transformations.

This framework is a direct demonstration of those skills: YAML-driven test definitions (no-code, like KingswaySoft's philosophy), data integrity validation across record sets, schema enforcement, chained API calls, and structured reporting.


Built by Parth Dangaria GitHub | LinkedIn | Portfolio

About

YAML-driven REST API integration test framework with schema validation, data integrity checks, chained tests, and HTML reporting. Built for enterprise data integration testing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors