Smoke Test

Test Anatomy

Test File Anatomy

This section explains the key elements of the generated test file, allowing you to quickly make adjustments, if needed.

  • The header of each test file shows when the test was generated and what command was used to generate it.

  • The body of the test file imports all relevant libraries and specifies the URL for all test requests.

  • Each method being tested has a function that consists of:

    • Invocation of Skyramp Client

    • Definition of the authentication header

    • Definition of the request body

    • Formation of the request

    • Assertion against expected status code

Test File Anatomy

This section explains the key elements of the generated test file, allowing you to quickly make adjustments, if needed.

  • The header of each test file shows when the test was generated and what command was used to generate it.

  • The body of the test file imports all relevant libraries and specifies the URL for all test requests.

  • Each method being tested has a function that consists of:

    • Invocation of Skyramp Client

    • Definition of the authentication header

    • Definition of the request body

    • Formation of the request

    • Assertion against expected status code

Test File Anatomy

This section explains the key elements of the generated test file, allowing you to quickly make adjustments, if needed.

  • The header of each test file shows when the test was generated and what command was used to generate it.

  • The body of the test file imports all relevant libraries and specifies the URL for all test requests.

  • Each method being tested has a function that consists of:

    • Invocation of Skyramp Client

    • Definition of the authentication header

    • Definition of the request body

    • Formation of the request

    • Assertion against expected status code

Python

Java

Typescript

Single Method Test Generation (POST)

# Generated by Skyramp v0.5.23 on 2025-06-22 01:14:33.086327 -0400 EDT m=+1.077145792
# Command: skyramp generate smoke rest https://demoshop.skyramp.dev/api/v1/products \
# 		--api-schema https://demoshop.skyramp.dev/openapi.json \
# 		--framework pytest \
# 		--language python \
# 		--method POST \

# Import of required libraries
import skyramp
import os
import time
# URL for test requests
URL = "https://demoshop.skyramp.dev"

# smoke test for /api/v1/products POST
def test_products_post():
    # Invocation of Skyramp Client
    client = skyramp.Client()
    # Definition of authentication header
    headers = {}
    if os.getenv("SKYRAMP_TEST_TOKEN") is not None:
        headers["Authorization"] = "Bearer " + os.getenv("SKYRAMP_TEST_TOKEN")

    # Request Body
    products_POST_request_body = r'''{
            "category": "Toys",
            "description": "Bear Soft Toy",
            "image_url": "https://images.app.goo.gl/cgcHpeehRdu5osot8",
            "in_stock": true,
            "name": "bigbear",
            "price": 9.99
        }'''
    
    # Execute Request
    products_POST_response = client.send_request(
        url=URL,
        path="/api/v1/products",
        method="POST",
        body=products_POST_request_body,
        headers=headers
    )
    # Generated Assertions
    assert products_POST_response.status_code == 201

if __name__ == "__main__":
    test_products_post()

Python

Java

Typescript

Single Method Test Generation (POST)

# Generated by Skyramp v0.5.23 on 2025-06-22 01:14:33.086327 -0400 EDT m=+1.077145792
# Command: skyramp generate smoke rest https://demoshop.skyramp.dev/api/v1/products \
# 		--api-schema https://demoshop.skyramp.dev/openapi.json \
# 		--framework pytest \
# 		--language python \
# 		--method POST \

# Import of required libraries
import skyramp
import os
import time
# URL for test requests
URL = "https://demoshop.skyramp.dev"

# smoke test for /api/v1/products POST
def test_products_post():
    # Invocation of Skyramp Client
    client = skyramp.Client()
    # Definition of authentication header
    headers = {}
    if os.getenv("SKYRAMP_TEST_TOKEN") is not None:
        headers["Authorization"] = "Bearer " + os.getenv("SKYRAMP_TEST_TOKEN")

    # Request Body
    products_POST_request_body = r'''{
            "category": "Toys",
            "description": "Bear Soft Toy",
            "image_url": "https://images.app.goo.gl/cgcHpeehRdu5osot8",
            "in_stock": true,
            "name": "bigbear",
            "price": 9.99
        }'''
    
    # Execute Request
    products_POST_response = client.send_request(
        url=URL,
        path="/api/v1/products",
        method="POST",
        body=products_POST_request_body,
        headers=headers
    )
    # Generated Assertions
    assert products_POST_response.status_code == 201

if __name__ == "__main__":
    test_products_post()

Python

Java

Typescript

Single Method Test Generation (POST)

# Generated by Skyramp v0.5.23 on 2025-06-22 01:14:33.086327 -0400 EDT m=+1.077145792
# Command: skyramp generate smoke rest https://demoshop.skyramp.dev/api/v1/products \
# 		--api-schema https://demoshop.skyramp.dev/openapi.json \
# 		--framework pytest \
# 		--language python \
# 		--method POST \

# Import of required libraries
import skyramp
import os
import time
# URL for test requests
URL = "https://demoshop.skyramp.dev"

# smoke test for /api/v1/products POST
def test_products_post():
    # Invocation of Skyramp Client
    client = skyramp.Client()
    # Definition of authentication header
    headers = {}
    if os.getenv("SKYRAMP_TEST_TOKEN") is not None:
        headers["Authorization"] = "Bearer " + os.getenv("SKYRAMP_TEST_TOKEN")

    # Request Body
    products_POST_request_body = r'''{
            "category": "Toys",
            "description": "Bear Soft Toy",
            "image_url": "https://images.app.goo.gl/cgcHpeehRdu5osot8",
            "in_stock": true,
            "name": "bigbear",
            "price": 9.99
        }'''
    
    # Execute Request
    products_POST_response = client.send_request(
        url=URL,
        path="/api/v1/products",
        method="POST",
        body=products_POST_request_body,
        headers=headers
    )
    # Generated Assertions
    assert products_POST_response.status_code == 201

if __name__ == "__main__":
    test_products_post()

© 2025 Skyramp, Inc. All rights reserved.

© 2025 Skyramp, Inc. All rights reserved.

© 2025 Skyramp, Inc. All rights reserved.