Environment
- Operating System: ubuntu
- Python version: 3.11
What you intend to do with scanapi ?
Hi folks, first of all, thank you for this great tool.
We are planning to use it and wanted to know if there is a feature to automatically retry endpoint calls until a resource becomes available (similar to a polling mechanism). This would be necessary for creating asynchronous resources that start in a pending state and later transition to a created state.
Expected behavior ?
The client should automatically send subsequent GET requests to the appropriate endpoint URL to check the resource's current data. This polling behavior should be configurable through dedicated options. Since the retry key is already used for connection failures, I propose using polling as the key for this new feature:
endpoints:
- name: my-api
path: ${BASE_URL}
requests:
- name: get_item
path: items/1
polling:
max_attempts: 5
delay: 3000 # ms
until: {{ response.json()["status"] == "created" }} # sucess stop condition
fail_when: {{ response.json()["status"] == "error" }} # error stop condition
tests:
- !include tests/status_code_is_200.yaml
scanapi has a discord server so feel free to join and say 👋 hello. Maybe share the issue link?
Environment
What you intend to do with scanapi ?
Hi folks, first of all, thank you for this great tool.
We are planning to use it and wanted to know if there is a feature to automatically retry endpoint calls until a resource becomes available (similar to a polling mechanism). This would be necessary for creating asynchronous resources that start in a pending state and later transition to a created state.
Expected behavior ?
The client should automatically send subsequent GET requests to the appropriate endpoint URL to check the resource's current data. This polling behavior should be configurable through dedicated options. Since the
retrykey is already used for connection failures, I propose usingpollingas the key for this new feature:scanapi has a discord server so feel free to join and say 👋 hello. Maybe share the issue link?