github.com/yandex/pandora@v0.5.32/components/providers/scenario/testdata/http_payload.yaml (about)

     1  locals:
     2    global-headers: &global-headers
     3      Content-Type: application/json
     4      Useragent: Yandex
     5  variable_sources:
     6    - name: users
     7      type: file/csv
     8      file: testdata/users.csv
     9      fields:
    10        - user_id
    11        - name
    12        - pass
    13      ignore_first_line: true
    14      delimiter: ','
    15    - name: filter_src
    16      type: file/json
    17      file: testdata/filter.json
    18    - name: variables
    19      type: variables
    20      variables:
    21        b: s
    22        header: yandex
    23  requests:
    24    - name: auth_req
    25      method: POST
    26      uri: /auth
    27      headers:
    28        <<: *global-headers
    29      tag: auth
    30      body: |
    31        {"user_id":  {{.request.auth_req.preprocessor.user_id}}}
    32      preprocessor:
    33        mapping:
    34          user_id: source.users[next].user_id
    35      postprocessors:
    36        - type: var/header
    37          mapping:
    38            Content-Type: Content-Type|upper
    39            httpAuthorization: Http-Authorization
    40        - type: var/jsonpath
    41          mapping:
    42            token: $.auth_key
    43        - type: assert/response
    44          headers:
    45            Content-Type: json
    46          body:
    47            - key
    48          size:
    49            val: 40
    50            op: '>'
    51        - type: assert/response
    52          body:
    53            - auth
    54      templater:
    55        type: html
    56    - name: list_req
    57      method: GET
    58      uri: /list
    59      headers: &auth-headers
    60        <<: *global-headers
    61        Authorization: Bearer {{.request.auth_req.postprocessor.token}}
    62      tag: list
    63      postprocessors:
    64        - type: var/jsonpath
    65          mapping:
    66            item_id: $.items[0]
    67            items: $.items
    68    - name: order_req
    69      method: POST
    70      uri: /order
    71      headers:
    72        <<: *auth-headers
    73      tag: order_req
    74      body: |
    75        {"item_id": {{.request.order_req.preprocessor.item}}}
    76      preprocessor:
    77        mapping:
    78          item: request.list_req.postprocessor.items[next]
    79    - name: order_req2
    80      method: POST
    81      uri: /order
    82      headers:
    83        Authorization: Bearer {{.request.auth_req.postprocessor.token}}
    84        Content-Type: application/json
    85        Useragent: Yandex
    86      tag: order_req
    87      body: |
    88        {"item_id": {{.request.order_req2.preprocessor.item}}  }
    89      preprocessor:
    90        mapping:
    91          item: request.list_req.postprocessor.items[next]
    92  calls: [ ]
    93  scenarios:
    94    - name: scenario_name
    95      weight: 50
    96      min_waiting_time: 10
    97      requests:
    98        - auth_req(1)
    99        - sleep(100)
   100        - list_req(1)
   101        - sleep(100)
   102        - order_req(3)
   103    - name: scenario_2
   104      requests:
   105        - auth_req(1)
   106        - sleep(100)
   107        - list_req(1)
   108        - sleep(100)
   109        - order_req(2)