Skip to content

Pass a parameter to stage #776

Description

@thejuliakors

It would be cool to have an opportunity to pass a parameter to the stage. It's possible to do this via parametrize mark, however, there can be cases when we want to pass the parameter we received and saved during previous stages.

I.e. we create two entities (in different ways / with different test data and in different stages) and then we want to delete them and pass the ID of each entity to the delete-stage. In order to do that we should write two very similar stages instead of one and passing first_entity_id/second_entity_id to there.

- id: create_first_entity
   ...
   save:
        json:
          first_entity_id: id

- id: create_second_entity
   ...
   save:
        json:
          second_entity_id: id

- id: delete_first_entity
    name: delete the first smth
    request:
      url: "{tavern.env_vars.API_URL}/v1/admin/smth/{first_entity_id}"
      method: DELETE
      headers: *headers
    response:
      status_code: 204

  - id: delete_second_entity
    name: delete the second smth
    request:
      url: "{tavern.env_vars.API_URL}/v1/admin/smth/{second_entity_id}"
      method: DELETE
      headers: *headers
    response:
      status_code: 204

Maybe, there is some way to do that?
If not, it would be a nice enhancement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions