Git Product home page Git Product logo

apitester's Introduction

apitester

Testing tool for web services.

Run with: php tester.php apitester:runall tests.yml

Example tests file tests.yml

globals:
    request:
        base_url: http://your.api.com
        defaults:
            headers:
                apikey: your-api-key


sequences:
    -
        name: create_list
        variables:
            client_id: 211691
            list_name: %random_string%
        requests:
            -
                name: post_list_missing_name
                url: /clients/%client_id%/lists
                method: POST
                expects_response:
                    status_code: 400
                    format: json
                    json_values:
                        error_code: 47
            -
                name: post_list
                url: /clients/%client_id%/lists
                method: POST
                data:
                    format: url_encoded
                    values:
                        name: %list_name%
                expects_response:
                    status_code: 200
            -
                name: verify_created_list
                url: /clients/%client_id%/lists/%previous_request.json_data.id%
                method: GET
                expects_response:
                    status_code: 200
                    json_values:
                        id: %previous_request.json_data.id%
            -
                name: delete_created_list
                url: /clients/%client_id%/lists/%previous_request.json_data.id%
                method: DELETE
                expects_response:
                    status_code: 200
    -
        name: update_client
        variables:
            client_id: 211691
            client_name: %random_string%
        requests:
            -
                name: get_client
                url: /clients/%client_id%
                method: GET
                expects_response:
                    status_code: 200
                    format: json
                    json_values:
                        id: (equals:%client_id%)
            -
                name: update_client
                url: /clients/%client_id%
                method: PUT
                data:
                    format: url_encoded
                    values:
                        name: %client_name%

                expects_response:
                    status_code: 200

            -
                name: get_updated_client
                url: /clients/%client_id%
                method: GET
                expects_response:
                    status_code: 200
                    format: json
                    json_values:
                        name: %client_name%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.