Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

Schemathesis

v1.0.3

Schemathesis

check-square

Schemathesis

Run Schemathesis API testing

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Schemathesis

uses: schemathesis/[email protected]

Learn more about this action in schemathesis/action

Choose a version

Schemathesis API testing

A GitHub Action for running Schemathesis API tests. If you use GitHub Actions, there is a native GitHub app that reports test results directly to your pull requests.

Usage

Minimal:

- uses: schemathesis/action@v1
  with:
    # API schema location
    schema: 'https://example.schemathesis.io/openapi.json'

All options:

- uses: schemathesis/action@v1
  with:
    # API schema location
    schema: 'https://example.schemathesis.io/openapi.json'
    # OPTIONAL. URL that will be used as a prefix for all API operations.
    # Required if the schema is provided as a file.
    # Otherwise, inferred from the schema.
    base-url: 'https://example.schemathesis.io/v2/'
    # OPTIONAL. Your Schemathesis.io token
    token: ${{ secrets.SCHEMATHESIS_TOKEN }}
    # OPTIONAL. API name from Schemathesis.io
    api-name: 'payments-api'
    # OPTIONAL. List of Schemathesis checks to run. Defaults to `all`
    checks: 'not_a_server_error'
    # OPTIONAL. Whether you'd like to see the results in a Web UI
    # Defaults to `true`
    report: 'true'
    # OPTIONAL. Maximum time in seconds to wait on the API schema availability
    wait-for-schema: '30'
    # OPTIONAL. Maximum number of generated examples for each endpoint
    max-examples: 50
    # OPTIONAL. Specify which version of Schemathesis should be used. 
    # Defaults to `latest`
    version: 'latest'
    # OPTIONAL. Schemathesis hooks module. Available for Schemathesis >= 3.18.5 only
    hooks: 'tests.hooks'
    # OPTIONAL. Extra arguments to pass to Schemathesis
    args: '-D negative'