Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hurl captures get object and use next variable #3226

Open
baerwang opened this issue Sep 10, 2024 · 0 comments
Open

hurl captures get object and use next variable #3226

baerwang opened this issue Sep 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@baerwang
Copy link
Contributor

baerwang commented Sep 10, 2024

Problem to solve

hurl captures get object and use next api

roles api response

{
  "success":true,
  "result":[
    {
      "uuid":"1",
      "name":"Reviewer",
      "created_at":"2024-05-29T04:09:40Z",
      "updated_at":"2024-07-10T12:20:46Z",
      "xxx": ....
    },
    {
      "uuid":"2",
      "name":"Admin",
      "created_at":"2024-05-29T04:09:40Z",
      "updated_at":"2024-07-10T12:20:46Z",
      "xxx": ....
    }
  ]
}

captures get values

GET {{openapi_server_v1}}/roles
Content-Type: application/json
Authorization: Bearer {{access_token}}
HTTP 200
[Captures]
admin: jsonpath "$.result[?(@.name=='Admin')]" nth 0
reviewer: jsonpath "$.result[?(@.name=='Reviewer')]" nth 0
[Asserts]
jsonpath "$.success" == true

get values and next api use

POST {{openapi_server_v1}}/api_tokens
Content-Type: application/json
Authorization: Bearer {{access_token}}

{
    "name": "admin",
    "role": {{admin}}
}

HTTP 201
[Asserts]
jsonpath "$.success" == true

error info

image

@baerwang baerwang added the enhancement New feature or request label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant