Skip to content
7.1.2. Martin: End-to-end Testing

7.1.2. Martin: End-to-end Testing

Martin is an integration testing tool based on Postman/Newman. Tests are defined in one or more yaml files. The martin CLI generates a single postman collection file by combining these tests.

This is a copy of https://bitbucket.org/luthersystems/hyphae/src/master/martin/README.md





Building

go install
martin -h





General workflow

Collate test case files into single Postman collection. Note the file name postfix: .postman_collection.json

martin -n "Basic" cat examples/*{json,yaml} > examples/basic.postman_collection.json

Run newman on temporary collated collection

martin run -e ../../scaffold/tests/LocalDev.postman_environment.json examples/*{json,yaml}





Test cases

Test cases usually consist of multiple steps, and are defined in the format described below, one per yaml file. They may contain placeholders that are resolved upon execution.





Environment

Placeholder values for each environment are held in individual JSON files. These can be specified to the CLI when running a collection.

Example:

{
    "id": "8b7b1d43-0e23-4c8b-817a-f391b973acf7",
    "name": "Local Dev",
    "values": [
        {
            "key": "SCHEME",
            "value": "http",
            "description": "",
            "enabled": true
        }
    ]
}





Format

Supported fields: name - Name of the test case. This is the name of the Postman folder. headers - Headers to be included in every request/test step.

  • key: Header name.
  • value: Header value. Placeholders are resolved from the environment variables JSON.

tests - List of test steps. Translated to requests in the Postman collection.

name: Name of test step. path: Request path. URL will be assembled from protocol and server + path automatically when running. method: HTTP method. body: Request body, verbatim. test_script: Test assertions in JavaScript. Translated to Postman tests.





We use cookies to give you the best experience of using this website. By continuing to use this site, you accept our use of cookies. Please read our Cookie Policy for more information.