Skip to content

noiv build

Interactive test builder for creating comprehensive API test suites step by step.

Syntax

bash
noiv build [file] [OPTIONS]

Description

The build command launches an interactive wizard that guides you through creating comprehensive API test suites. Perfect for:

  • Visual test creation - Build tests using an intuitive interface
  • Step-by-step guidance - No prior testing knowledge required
  • Real-time validation - Test as you build
  • Template selection - Choose from pre-built patterns

Arguments

[file] (optional)

Test file to edit. If not provided, creates a new test suite.

bash
noiv build                    # Create new test suite
noiv build existing_tests.yaml # Edit existing tests
noiv build user_tests.json     # Edit JSON format tests

Options

--template, -t

Start with a specific template: rest, crud, graphql, auth, or e2e.

bash
noiv build --template rest
noiv build -t crud

--format, -f

Output format: yaml (default), json, or postman.

bash
noiv build --format json
noiv build -f postman

--base-url, -u

Set the base URL for the API being tested.

bash
noiv build --base-url https://api.example.com
noiv build -u http://localhost:3000

--interactive, -i

Force interactive mode (default when no arguments provided).

bash
noiv build existing_tests.yaml --interactive

--output, -o

Specify output file name (when creating new tests).

bash
noiv build --output my_api_tests.yaml
noiv build -o custom_tests.json

Interactive Interface

When you run noiv build, you'll see the interactive builder interface:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                            NOIV Interactive Builder                                           ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

🏗️  Welcome to the NOIV Test Builder!

What would you like to do?

1. 🆕 Create new test suite
2. 📝 Edit existing test file
3. 📋 Start from template
4. 🔧 Configure project settings
5. ❓ Help & tutorials

Choice [1-5]:

Test Suite Configuration

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                             Test Suite Setup                                                  ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

📋 Test Suite Name: User Management API Tests

🌐 Base URL: https://api.example.com

📝 Description: Comprehensive tests for user CRUD operations

🔧 Configuration:
   ✓ Authentication: JWT Bearer Token
   ✓ Environment: Development
   ✓ Output Format: YAML

Continue? [Y/n]:

Test Creation Wizard

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃                                               Add New Test                                                    ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

🎯 Test Name: Create New User

🔗 Method: POST
📍 Path: /users

📥 Request Configuration:
   1. Headers
   2. Query Parameters  
   3. Request Body
   4. Authentication

📤 Response Validation:
   5. Status Code (201)
   6. Response Body
   7. Response Headers
   8. Custom Assertions

🧪 Test Data:
   9. Variables & Fixtures
   10. Dynamic Data Generation

Choose section to configure [1-10] or 'save' to finish:

Templates

REST API Template

bash
noiv build --template rest

Generated Structure:

yaml
name: REST API Test Suite
base_url: https://api.example.com
tests:
  - name: Health Check
    request:
      method: GET
      path: /health
    expect:
      status: 200
  
  - name: Get Resource List
    request:
      method: GET
      path: /resources
    expect:
      status: 200
      body:
        - type: array
  
  - name: Create Resource
    request:
      method: POST
      path: /resources
      headers:
        Content-Type: application/json
      body:
        name: "Test Resource"
    expect:
      status: 201
      body:
        id: "{{resource_id}}"

CRUD Template

bash
noiv build --template crud

Interactive Flow:

🎯 CRUD Template Setup

What resource are you testing?
Resource name: User

What fields does a User have?
1. id (auto-generated)
2. name (required, string)
3. email (required, email format)
4. age (optional, number)
5. created_at (auto-generated)

✅ Generating CRUD tests for User resource...

Generated Tests:
✓ Create User (POST /users)
✓ Get User by ID (GET /users/{id})
✓ List All Users (GET /users)  
✓ Update User (PUT /users/{id})
✓ Partially Update User (PATCH /users/{id})
✓ Delete User (DELETE /users/{id})
✓ Validation Tests (Invalid data)
✓ Error Scenarios (404, 401, etc.)

Authentication Template

bash
noiv build --template auth

Generated Tests:

  • User registration
  • Email verification
  • User login
  • Password reset
  • Token refresh
  • Protected endpoint access
  • Session management

GraphQL Template

bash
noiv build --template graphql

Generated Tests:

  • Query operations
  • Mutation testing
  • Subscription handling
  • Schema introspection
  • Error handling

End-to-End Template

bash
noiv build --template e2e

Generated Workflow:

  • Complete user journey
  • Multi-step scenarios
  • State management
  • Business logic validation

Step-by-Step Builder

1. Request Configuration

Method Selection

🔗 HTTP Method:

1. GET    - Retrieve data
2. POST   - Create new resource
3. PUT    - Update entire resource
4. PATCH  - Partial update
5. DELETE - Remove resource
6. HEAD   - Get headers only
7. OPTIONS - Get allowed methods

Choice [1-7]: 2

✅ Selected: POST

Path Configuration

📍 Request Path:

Enter the API endpoint path:
Path: /api/users

💡 You can use variables like: /api/users/{user_id}

Variables found: {user_id}
Configure variable 'user_id'? [Y/n]: Y

Variable 'user_id' source:
1. From previous test response
2. Environment variable
3. Generated value
4. User input

Choice [1-4]: 1

✅ Path configured: /api/users/{user_id}

Headers Configuration

📥 Request Headers:

Current headers:
✓ Content-Type: application/json

Add another header? [Y/n]: Y

Header name: Authorization
Header value: Bearer {{auth_token}}

✅ Added Authorization header

Headers summary:
✓ Content-Type: application/json
✓ Authorization: Bearer {{auth_token}}

Add more headers? [Y/n]: n

Request Body Builder

📦 Request Body:

Body type:
1. JSON object
2. Form data
3. Raw text
4. File upload
5. None

Choice [1-5]: 1

🔧 JSON Body Builder:

Current body: {}

Add field? [Y/n]: Y

Field name: name
Field type:
1. String
2. Number  
3. Boolean
4. Array
5. Object

Choice [1-5]: 1

Field value: "John Doe"

✅ Added field: name = "John Doe"

Current body:
{
  "name": "John Doe"
}

Add another field? [Y/n]: Y

2. Response Validation

Status Code Validation

📤 Response Validation:

Expected status code:
1. 200 - OK
2. 201 - Created  
3. 204 - No Content
4. 400 - Bad Request
5. 401 - Unauthorized
6. 404 - Not Found
7. 500 - Server Error
8. Custom code

Choice [1-8]: 2

✅ Expected status: 201 Created

Response Body Validation

📋 Response Body Validation:

Validation type:
1. Exact match
2. Schema validation
3. Field presence
4. Field types
5. Custom assertions

Choice [1-5]: 3

✅ Field Presence Validation

Required fields in response:
Field name: id
Add another field? [Y/n]: Y

Field name: email
Add another field? [Y/n]: n

✅ Required fields: id, email

Variable Extraction

🔧 Variable Extraction:

Extract variables from response? [Y/n]: Y

Variable name: user_id
JSONPath: $.id

✅ Will extract user_id from response.id

Variable name: auth_token  
JSONPath: $.token

✅ Will extract auth_token from response.token

Extract more variables? [Y/n]: n

3. Test Dependencies

🔗 Test Dependencies:

This test depends on:
1. Previous test in sequence
2. Specific test by name
3. Setup/teardown tests
4. No dependencies

Choice [1-4]: 2

Test name: "Login User"

✅ This test will run after "Login User" completes successfully

Real-Time Testing

Live API Testing

While building tests, you can test them immediately:

🧪 Test Current Configuration:

Test this endpoint now? [Y/n]: Y

🚀 Testing POST /api/users...

Request:
POST https://api.example.com/api/users
Headers:
  Content-Type: application/json
  Authorization: Bearer test-token
Body:
{
  "name": "John Doe",
  "email": "john@example.com"
}

Response:
✅ Status: 201 Created
✅ Response time: 234ms
✅ Required fields present: id, email

Variables extracted:
✓ user_id = "12345"

Continue building? [Y/n]: Y

Validation Preview

🔍 Validation Preview:

Your current test will validate:
✅ Status code: 201
✅ Response has field: id
✅ Response has field: email
✅ Response time < 5000ms
⚠️  No authentication header validation

Add auth header validation? [Y/n]: Y

Advanced Features

Test Data Management

🗃️  Test Data Configuration:

1. 📊 Use dynamic data generation
2. 📋 Load from CSV file
3. 🎲 Generate random data
4. 💾 Use saved fixtures
5. 🔄 Use data from previous tests

Choice [1-5]: 1

🎲 Dynamic Data Generation:

Generate data for field 'email':
1. Random email address
2. Specific domain email
3. Test email pattern

Choice [1-3]: 2

Domain: example.com

✅ Will generate: {{random_name}}@example.com

Environment Configuration

🌍 Environment Setup:

Configure environments? [Y/n]: Y

Environment name: development
Base URL: http://localhost:3000
Variables:
  api_key: dev-key-123
  auth_token: dev-token

Add another environment? [Y/n]: Y

Environment name: production  
Base URL: https://api.example.com
Variables:
  api_key: {{PROD_API_KEY}}
  auth_token: {{PROD_AUTH_TOKEN}}

✅ Configured 2 environments

Custom Assertions

🔧 Custom Assertions:

Add custom validation? [Y/n]: Y

Assertion type:
1. Response time validation
2. Custom JSONPath assertion
3. Header value validation
4. Response size validation
5. Custom JavaScript assertion

Choice [1-5]: 2

JSONPath: $.data.length
Condition:
1. equals
2. greater than
3. less than
4. contains

Choice [1-4]: 2

Value: 0

✅ Added assertion: Response data array should have more than 0 items

Output Generation

YAML Output

yaml
name: User Management API Tests
base_url: https://api.example.com
environments:
  development:
    base_url: http://localhost:3000
variables:
  user_id: ""
  auth_token: ""
tests:
  - name: Create New User
    request:
      method: POST
      path: /api/users
      headers:
        Content-Type: application/json
        Authorization: "Bearer {{auth_token}}"
      body:
        name: "John Doe"
        email: "john@example.com"
    expect:
      status: 201
      body:
        id: "{{user_id}}"
        email: "john@example.com"
    extract:
      user_id: "$.id"

JSON Output

json
{
  "name": "User Management API Tests",
  "base_url": "https://api.example.com",
  "tests": [
    {
      "name": "Create New User",
      "request": {
        "method": "POST",
        "path": "/api/users",
        "headers": {
          "Content-Type": "application/json"
        },
        "body": {
          "name": "John Doe",
          "email": "john@example.com"
        }
      },
      "expect": {
        "status": 201
      }
    }
  ]
}

Postman Collection Output

Generates a complete Postman collection with:

  • Organized folders
  • Environment variables
  • Pre-request scripts
  • Test scripts for validation

Integration Examples

CI/CD Pipeline Integration

bash
#!/bin/bash
# build_and_test.sh

# Build tests interactively (if needed)
if [ ! -f "api_tests.yaml" ]; then
    noiv build --template rest --output api_tests.yaml --base-url $API_URL
fi

# Run the tests
noiv test api_tests.yaml

Team Collaboration

bash
# Team member creates base tests
noiv build --template crud --output team_tests.yaml

# Another team member extends the tests
noiv build team_tests.yaml --interactive

# Version control the test files
git add team_tests.yaml
git commit -m "Add comprehensive user API tests"

Best Practices

1. Start with Templates

bash
# Use appropriate templates for faster setup
noiv build --template rest  # For REST APIs
noiv build --template crud  # For resource management
noiv build --template auth  # For authentication flows

2. Test as You Build

Always test your configurations immediately:

  • Use the live testing feature
  • Validate responses in real-time
  • Fix issues before completing the test

3. Organize Test Structure

tests/
├── auth/
│   ├── login_tests.yaml
│   └── registration_tests.yaml
├── users/
│   ├── crud_tests.yaml
│   └── profile_tests.yaml
└── products/
    ├── catalog_tests.yaml
    └── search_tests.yaml

4. Use Descriptive Names

yaml
# Good test names
- name: "Create User - Valid Data"
- name: "Create User - Missing Required Field"
- name: "Create User - Duplicate Email"

# Poor test names  
- name: "Test 1"
- name: "POST user"
- name: "Create"

5. Configure Variables Properly

yaml
# Use meaningful variable names
variables:
  user_id: ""           # ID of created user
  auth_token: ""        # JWT authentication token  
  base_endpoint: "/api" # API base path

# Not recommended
variables:
  x: ""
  token: ""
  id: ""

See Also

Released under the MIT License.