Chaining

Chaining is a way to continue another test that was previously executed

This is the mechanism on how to chain scenarios for Autokin. Let us say that you want to Login the user then use the session token to retrieve user information.

    POST https://www.autokinjs.com/login
    Headers:
    Content-Type: application/json
    {
        "username": "juan",
        "password": "p3dr0"
    }

    Response:
    {
        "sessionId": "2AA21boNhOM5zR3Xgn96qw=="
    }

    GET https://www.autokinjs.com/user/1001
    Headers: 
    Content-Type: application/json
    SessionId: 2AA21boNhOM5zR3Xgn96qw==

    Response:
    {
        "id": 1001,
        "name": "Juan Pedro",
        "age": 30 
    }

So having that we can have this Feature definition:

As you see in the above example, we login then we store the session token to a variable userSessionToken, the variable name can be anything as long as a one word. Following to our next scenario, as needed by our API, we set the header SessionId to the value of the previously stored data by specifying that we are getting the stored value from the variable userSessionToken.

Last updated

Was this helpful?